Example usage for twitter4j AsyncTwitter getHomeTimeline

List of usage examples for twitter4j AsyncTwitter getHomeTimeline

Introduction

In this page you can find the example usage for twitter4j AsyncTwitter getHomeTimeline.

Prototype

void getHomeTimeline(Paging paging);

Source Link

Document

Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.

Usage

From source file:com.marpies.ane.twitter.functions.GetHomeTimelineFunction.java

License:Apache License

@Override
public FREObject call(FREContext context, FREObject[] args) {
    super.call(context, args);

    int count = FREObjectUtils.getInt(args[0]);
    long sinceID = (args[1] == null) ? -1 : Long.valueOf(FREObjectUtils.getString(args[1]));
    long maxID = (args[2] == null) ? -1 : Long.valueOf(FREObjectUtils.getString(args[2]));
    mExcludeReplies = FREObjectUtils.getBoolean(args[3]);
    mCallbackID = FREObjectUtils.getInt(args[4]);

    AsyncTwitter twitter = TwitterAPI.getAsyncInstance(TwitterAPI.getAccessToken());
    twitter.addListener(this);

    Paging paging = getPaging(count, sinceID, maxID);
    if (paging != null) {
        twitter.getHomeTimeline(paging);
    } else {/*from  w w w. ja v a2 s.c o  m*/
        twitter.getHomeTimeline();
    }

    return null;
}