J'utilise le code ci-dessous pour obtenir des tendances à partir d'un emplacement spécifique. Est-il possible de vérifier si un sujet particulier ou un hashtag est tendance sur twitter ou pas?Vérification de la tendance d'un sujet ou d'un hashtag particulier sur 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);
}