0

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

4

1 回答 1

0

过滤时间线 Twitter 工具包提供了根据您提供的规则过滤应用程序中显示的推文的功能。您可以使用此功能过滤推文。.

    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);
}

您可以使用用户时间线并根据您的关键字对其进行过滤。句柄列表是用于过滤推文的关键字列表。

更多细节和实现在下面的链接中给出。

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

于 2017-09-12T21:44:48.563 回答