use of twitter4j.conf.ConfigurationBuilder in project intellij-community by JetBrains.
the class StudyTwitterUtils method getTwitter.
/**
* Set consumer key and secret.
* @return Twitter instance with consumer key and secret set.
*/
@NotNull
public static Twitter getTwitter(@NotNull final String consumerKey, @NotNull final String consumerSecret) {
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.setOAuthConsumerKey(consumerKey);
configurationBuilder.setOAuthConsumerSecret(consumerSecret);
return new TwitterFactory(configurationBuilder.build()).getInstance();
}
Aggregations