Example usage for twitter4j SavedSearch getId

List of usage examples for twitter4j SavedSearch getId

Introduction

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

Prototype

long getId();

Source Link

Usage

From source file:de.jetwick.data.UserSearch.java

License:Apache License

public UserSearch(SavedSearch ss) {
    position = ss.getPosition();
    query = ss.getQuery();
    id = ss.getId();
}

From source file:de.vanita5.twittnuker.fragment.support.SavedSearchesListFragment.java

License:Open Source License

@Override
public boolean onItemLongClick(final AdapterView<?> view, final View child, final int position, final long id) {
    final SavedSearch item = mAdapter.findItem(id);
    if (item == null)
        return false;
    DestroySavedSearchDialogFragment.show(getFragmentManager(), mAccountId, item.getId(), item.getName());
    return true;// w  ww  .  ja  va  2s . c om
}

From source file:org.getlantern.firetweet.util.ContentValuesCreator.java

License:Open Source License

public static ContentValues createSavedSearch(final SavedSearch savedSearch, final long accountId) {
    final ContentValues values = new ContentValues();
    values.put(SavedSearches.ACCOUNT_ID, accountId);
    values.put(SavedSearches.SEARCH_ID, savedSearch.getId());
    values.put(SavedSearches.CREATED_AT, savedSearch.getCreatedAt().getTime());
    values.put(SavedSearches.NAME, savedSearch.getName());
    values.put(SavedSearches.QUERY, savedSearch.getQuery());
    return values;
}

From source file:org.mariotaku.twidere.fragment.support.SavedSearchesListFragment.java

License:Open Source License

@Override
public boolean onItemLongClick(final AdapterView<?> view, final View child, final int position, final long id) {
    final SavedSearch item = getAdapter().findItem(id);
    if (item == null)
        return false;
    DestroySavedSearchDialogFragment.show(getFragmentManager(), mAccountId, item.getId(), item.getName());
    return true;/*from   www  .j  a  v a 2s . com*/
}

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

License:Apache License

/**
 * Usage: java twitter4j.examples.savedsearches.CreateSavedSearch [query]
 *
 * @param args message/*from  w w w. ja  v a2 s . c  o m*/
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.savedsearches.CreateSavedSearch [query]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        SavedSearch savedSearch = twitter.createSavedSearch(args[0]);
        System.out.println("Successfully created saved search [name:" + savedSearch.getName() + " query:"
                + savedSearch.getQuery() + " id:" + savedSearch.getId() + "]");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to create a saved search: " + te.getMessage());
        System.exit(-1);
    }
}

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

License:Apache License

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

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

License:Apache License

/**
 * Usage: java twitter4j.examples.savedsearches.GetSavedSearches
 *
 * @param args message//from   w  ww .  java2s  .  c o m
 */
public static void main(String[] args) {
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        List<SavedSearch> savedSearches = twitter.getSavedSearches();
        for (SavedSearch savedSearch : savedSearches) {
            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 retrieve saved searches: " + te.getMessage());
        System.exit(-1);
    }
}

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  ww. j  a  v  a  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);
    }
}