Example usage for twitter4j SavedSearch getQuery

List of usage examples for twitter4j SavedSearch getQuery

Introduction

In this page you can find the example usage for twitter4j SavedSearch getQuery.

Prototype

String getQuery();

Source Link

Usage

From source file:twitter4j.examples.savedsearches.ShowSavedSearch.java

License:Apache License

/**
 * Usage: java twitter4j.examples.savedsearches.ShowSavedSearch [saved search id]
 *
 * @param args message/*from   w w  w  .  jav a 2  s  .co m*/
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.savedsearches.ShowSavedSearch [saved search id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        SavedSearch savedSearch = twitter.showSavedSearch(Integer.parseInt(args[0]));
        System.out.println("[name:" + savedSearch.getName() + " query:" + savedSearch.getQuery() + " id:"
                + savedSearch.getId() + "]");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to get the saved search: " + te.getMessage());
        System.exit(-1);
    }
}