Created
December 15, 2012 21:12
-
-
Save abh1nav/4299262 to your computer and use it in GitHub Desktop.
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
StatusListener listener = new StatusListener() { | |
@Override | |
public void onStatus(Status status) { | |
// do stuff with tweet | |
} | |
@Override | |
public void onDeletionNotice(StatusDeletionNotice sdn) { } | |
@Override | |
public void onTrackLimitationNotice(int i) { } | |
@Override | |
public void onScrubGeo(long l, long l1) { } | |
@Override | |
public void onException(Exception e) { } | |
}; | |
TwitterStreamFactory factory = new TwitterStreamFactory(new ConfigurationBuilder().setUser(username).setPassword(pwd).build()); | |
TwiterStream twitterStream = factory.getInstance(); | |
twitterStream.addListener(listener); | |
twitterStream.sample(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment