Created
October 22, 2014 15:07
-
-
Save yusuke/9bc4f10e02c96769fe3b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Twitter twitter = TwitterFactory.getSingleton(); | |
TwitterStream stream = TwitterStreamFactory.getSingleton(); | |
stream.addListener(new StatusAdapter(){ | |
public void onStatus(Status status) { | |
if (status.getUser().getScreenName().equals("syobochim")) { | |
try { | |
twitter.createFavorite(status.getId()); | |
} catch (TwitterException e) { | |
e.printStackTrace(); | |
} | |
} | |
} | |
}); | |
stream.user(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment