简体   繁体   中英

Querying within a user's timeline using Twitter Kit for Android

I am looking for a way to use Twitter Kit's TweetUI to query within a specific user's tweets and to add the scrollable timeline in my Android app. SearchTimeline allows for querying by keyword, but I don't see any way to query by keyword specific to the user. UserTimeline loads tweets for one specific user, but doesn't have any query methods. Anyone know if it is possible, without having to resort to using the normal Twitter API, and having to make my own adapter?

https://dev.twitter.com/twitterkit/android/show-timelines

Filter Timeline Twitter Kit provides functionality to filter the Tweets displayed in your app, according to rules you provide. You can use this functionality to filter the tweets. .

    final List<String> handles = 
Arrays.asList("shame", "down", "degrade");
    final FilterValues filterValues = new FilterValues(handles, null, null, null); // or load from JSON, XML, etc
    final TimelineFilter timelineFilter = new BasicTimelineFilter(filterValues, Locale.ENGLISH);


    final UserTimeline userTimeline = new UserTimeline.Builder()
        .screenName("twitterdev")
        .build();
    final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter.Builder(this)
        .setTimeline(userTimeline)
        .setTimelineFilter(timelineFilter)
        .build();
    setListAdapter(adapter);
}

you can use the usertimeline and filter it based on your keywords. Handles list is the keyword list used to filter the tweets.

More details and implementation is given in the link below.

https://dev.twitter.com/twitterkit/android/show-timelines

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM