/**
  * Usage: java twitter4j.examples.trends.GetAvailableTrends [latitude longitude]
  *
  * @param args message
  */
 public static void main(String[] args) {
   try {
     Twitter twitter = new TwitterFactory().getInstance();
     ResponseList<Location> locations;
     if (args.length >= 2) {
       locations =
           twitter.getAvailableTrends(
               new GeoLocation(Double.parseDouble(args[0]), Double.parseDouble(args[1])));
     } else {
       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.");
     System.exit(0);
   } catch (TwitterException te) {
     te.printStackTrace();
     System.out.println("Failed to get trends: " + te.getMessage());
     System.exit(-1);
   }
 }