简体   繁体   English

使用适用于Android的Twitter Kit在用户的时间轴中进行查询

[英]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. 我正在寻找一种使用Twitter Kit的TweetUI在特定用户的推文中进行查询并在我的Android应用中添加可滚动时间轴的方法。 SearchTimeline allows for querying by keyword, but I don't see any way to query by keyword specific to the user. SearchTimeline允许按关键字查询,但是我看不到任何针对用户的关键字查询方式。 UserTimeline loads tweets for one specific user, but doesn't have any query methods. UserTimeline为一个特定用户加载推文,但没有任何查询方法。 Anyone know if it is possible, without having to resort to using the normal Twitter API, and having to make my own adapter? 任何人都知道是否有可能,而不必诉诸于使用正常的Twitter API并必须制作自己的适配器吗?

https://dev.twitter.com/twitterkit/android/show-timelines 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. 筛选时间轴Twitter工具包提供了根据提供的规则筛选应用程序中显示的推文的功能。 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. 您可以使用usertimeline并根据您的关键字对其进行过滤。 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 https://dev.twitter.com/twitterkit/android/show-timelines

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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