Skip to content

Instantly share code, notes, and snippets.

@noexpect
Last active December 10, 2015 09:09
Show Gist options
  • Save noexpect/4412574 to your computer and use it in GitHub Desktop.
Save noexpect/4412574 to your computer and use it in GitHub Desktop.
twitter4jでお気に入り取得
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