Example usage for twitter4j Twitter showSavedSearch

List of usage examples for twitter4j Twitter showSavedSearch

Introduction

In this page you can find the example usage for twitter4j Twitter showSavedSearch.

Prototype

SavedSearch showSavedSearch(long id) throws TwitterException;

Source Link

Document

Retrieve the data for a saved search owned by the authenticating user specified by the given id.

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 .  ja va  2s .c  o  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);
    }
}