Last active
December 10, 2015 09:09
-
-
Save noexpect/4412574 to your computer and use it in GitHub Desktop.
twitter4jでお気に入り取得
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
import java.io.*; | |
import twitter4j.ResponseList; | |
import twitter4j.Twitter; | |
import twitter4j.TwitterFactory; | |
import twitter4j.Status; | |
import twitter4j.TwitterException; | |
public class GetFav { | |
public static void main(String[] args) throws IOException, TwitterException { | |
Twitter tw = new TwitterFactory().getInstance(); | |
ResponseList<Status> favs = tw.getFavorites(); | |
System.out.println("size:"+favs.size()); | |
for (Status status : favs) { | |
String userName = status.getUser().getScreenName(); | |
String tweet = status.getText(); | |
System.out.println(userName+":"+tweet); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment