Search in sources :

Example 96 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class CreateFavorite method main.

/**
     * Usage: java twitter4j.examples.favorite.CreateFavorite [status id]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.favorite.CreateFavorite [status id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.createFavorite(Long.parseLong(args[0]));
        System.out.println("Successfully favorited status [" + args[0] + "].");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to favorite status: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Example 97 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class DestroyFavorite method main.

/**
     * Usage: java twitter4j.examples.favorite.DestroyFavorite [status id]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.favorite.DestroyFavorite [status id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.destroyFavorite(Long.parseLong(args[0]));
        System.out.println("Successfully unfavorited status [" + args[0] + "].");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to unfavorite status: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Example 98 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class GetFavorites method main.

/**
     * Usage: java twitter4j.examples.favorite.GetFavorites
     *
     * @param args message
     */
public static void main(String[] args) {
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        List<Status> statuses = twitter.getFavorites();
        for (Status status : statuses) {
            System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
        }
        System.out.println("done.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to get favorites: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Status(twitter4j.Status) Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Example 99 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class CreateFriendship method main.

/**
     * Usage: java twitter4j.examples.friendship.CreateFriendship [screen name]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.friendship.CreateFriendship [screen name]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.createFriendship(args[0]);
        System.out.println("Successfully followed [" + args[0] + "].");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to follow: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Example 100 with Twitter

use of twitter4j.Twitter in project twitter4j by yusuke.

the class DestroyFriendship method main.

/**
     * Usage: java twitter4j.examples.friendship.DestroyFriendship [screen name]
     *
     * @param args message
     */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.friendship.DestroyFriendship [screen name]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.destroyFriendship(args[0]);
        System.out.println("Successfully unfollowed [" + args[0] + "].");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to unfollow: " + te.getMessage());
        System.exit(-1);
    }
}
Also used : Twitter(twitter4j.Twitter) TwitterFactory(twitter4j.TwitterFactory) TwitterException(twitter4j.TwitterException)

Aggregations

Twitter (twitter4j.Twitter)125 TwitterException (twitter4j.TwitterException)76 TwitterFactory (twitter4j.TwitterFactory)59 Status (twitter4j.Status)44 Activity (android.app.Activity)35 QueryResult (twitter4j.QueryResult)17 TimelineArrayAdapter (com.klinker.android.twitter.adapters.TimelineArrayAdapter)16 ArrayList (java.util.ArrayList)13 Intent (android.content.Intent)12 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