0
我正在使用下面的代碼從特定位置獲取趨勢。是否可以檢查某個特定主題或標籤是否在Twitter上趨勢化?檢查特定主題或主題標籤是否在推特上趨勢
try {
// Twitter twitter = new TwitterFactory().getInstance();
ResponseList<Location> locations;
locations = twitter.getAvailableTrends();
System.out.println("Showing available trends");
for (Location location : locations) {
System.out.println(location.getName() + " (woeid:" + location.getWoeid() + ")");
}
System.out.println("done.");
Trends trends = twitter.getPlaceTrends(2211096);
for (int i = 0; i < trends.getTrends().length; i++) {
System.out.println(trends.getTrends()[i].getName() + trends.getTrends()[i].getURL());
}
System.exit(0);
} catch (TwitterException te) {
te.printStackTrace();
System.out.println("Failed to get trends: " + te.getMessage());
System.exit(-1);
}