Upgrade to Pro — share decks privately, control downloads, hide ads and more …

企業システムにおけるTwitter API適用事例とTwitter4Jアップデート #Twit...

yusuke
September 17, 2022

企業システムにおけるTwitter API適用事例とTwitter4Jアップデート #TwitterDevJP

yusuke

September 17, 2022
Tweet

More Decks by yusuke

Other Decks in Technology

Transcript

  1. ϞμϯͳΠϯλʔϑΣʔε Twitter twitter = new TwitterFactory(new ConfigurationBuilder() .setOAuthConsumerKey("my consumer key")

    .setOAuthConsumerSecret("my consumer secret") .build()).getInstance(); Twitter twitter = Twitter.newBuilder() .oAuthConsumerKey("my consumer key") .oAuthConsumerSecret("my consumer secret") .build();
  2. "DDPVOU"DUJWJUZ"1*αϙʔτ var activity = TwitterAccountActivity.newBuilder() .onDirectMessageReceived(dm -> System.out.printf("direct message received:%s"

    , dm.getText())) .onMention(tweet -> System.out.printf("mention received:%s" , tweet.getText())) .onPort(8080).build(); activity.start(); activity.await();
  3. 3&45"1* ΠϕϯτυϦϒϯ var restActivity = TwitterRestBasedAccountActivity .newBuilder() .onDirectMessageReceived(dm -> System.out.printf("direct

    message received:%s" , dm.getText())) .onMention(tweet -> System.out.printf("direct message received:%s" , tweet.getText())) .pollIntervalSeconds(60).build(); restActivity.start(); restActivity.await();