Search in sources :

Example 36 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class DestroyUserList method main.

/**
     * Usage: java twitter4j.examples.list.DestroyUserList [list id]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.DestroyUserList [list id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        UserList list = twitter.destroyUserList(Integer.parseInt(args[0]));
        System.out.println("Successfully deleted the list (id:" + list.getId() + ", slug:" + list.getSlug() + ").");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to delete a list: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) UserList(twitter4j.UserList) TwitterException(twitter4j.TwitterException)

Example 37 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class ShowUserList method main.

/**
     * Usage: java twitter4j.examples.list.ShowUserList [list id]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.ShowUserList [list id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        UserList list = twitter.showUserList(Integer.parseInt(args[0]));
        System.out.println("id:" + list.getId() + ", name:" + list.getName() + ", description:" + list.getDescription() + ", slug:" + list.getSlug() + "");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to show the list: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) UserList(twitter4j.UserList) TwitterException(twitter4j.TwitterException)

Example 38 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class UpdateUserList method main.

/**
     * Usage: java twitter4j.examples.list.UpdateUserList [list id] [new list name] [new description]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 3) {
        System.out.println("Usage: java twitter4j.examples.list.UpdateUserList [list id] [new list name] [new description]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.updateUserList(Integer.parseInt(args[0]), args[1], true, args[2]);
        System.out.println("Successfully updated list [" + args[0] + "].");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to update list: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Example 39 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class GetMutingUsersIDs method main.

/**
     * Usage: java twitter4j.examples.mute.GetMutingUsersIDs
     *
     * @param args message
     */
public static void main(String[] args) {
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        IDs ids = twitter.getMutesIDs(-1L);
        for (long id : ids.getIDs()) {
            System.out.println(id);
        }
        System.out.println("done.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to get muting user ids: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) IDs(twitter4j.IDs) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Example 40 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class UpdateProfile method main.

/**
     * Usage: java twitter4j.examples.account.UpdateProfile [name] [url] [location] [description]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 4) {
        System.out.println("Usage: java twitter4j.examples.account.UpdateProfile [name] [url] [location] [description]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.updateProfile(args[0], args[1], args[2], args[3]);
        System.out.println("Successfully updated profile.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to update profile: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Aggregations

Twitter (twitter4j.Twitter)127 TwitterException (twitter4j.TwitterException)76 TwitterFactory (twitter4j.TwitterFactory)60 Status (twitter4j.Status)44 Activity (android.app.Activity)35 QueryResult (twitter4j.QueryResult)17 TimelineArrayAdapter (com.klinker.android.twitter.adapters.TimelineArrayAdapter)16 Intent (android.content.Intent)13 ArrayList (java.util.ArrayList)13 User (twitter4j.User)12 Query (twitter4j.Query)11 IDs (twitter4j.IDs)8 LinearLayout (android.widget.LinearLayout)7 IOException (java.io.IOException)7 Context (android.content.Context)6 DrawerActivity (com.klinker.android.twitter.activities.drawer_activities.DrawerActivity)6 LoginActivity (com.klinker.android.twitter.activities.setup.LoginActivity)6 AppSettings (com.klinker.android.twitter.settings.AppSettings)5 GeoLocation (twitter4j.GeoLocation)5 Paging (twitter4j.Paging)5