Last active
August 29, 2015 14:15
-
-
Save DannyDelott/1a32742a12dd96e282bf to your computer and use it in GitHub Desktop.
Gets the TwitterStream object by authenticating with the Twitter API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static TwitterStream getStream() { | |
ConfigurationBuilder cb = new ConfigurationBuilder(); | |
cb.setDebugEnabled(true); | |
cb.setOAuthConsumerKey("<YOUR CONSUMER KEY>"); | |
cb.setOAuthConsumerSecret("<YOUR CONSUMER SECRET>"); | |
cb.setOAuthAccessToken("<YOUR ACCESS TOKEN>"); | |
cb.setOAuthAccessTokenSecret("<YOUR ACCESS TOKEN SECRET>"); | |
return new TwitterStreamFactory(cb.build()).getInstance(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment