【问题标题】:Twython filters track and followTwython 过滤器跟踪和关注
【发布时间】:2016-10-14 03:57:39
【问题描述】:

我需要使用过滤器和某些帐户实时获取推文。我试试这个:

filtro="messi,copa100,copaamierica"
personas="488916863,3034605958" #twitters ids here
stream.statuses.filter(track=filtro, follow=[personas])

但只使用跟踪过滤器,而不是跟随过滤器。

有人帮我解决这个问题吗? 谢谢!! 布鲁诺

【问题讨论】:

    标签: python twitter-streaming-api twython


    【解决方案1】:

    我认为您错误地使用了filter 方法。应该是:

    filtro= ["messi", "copa100", "copaamierica"]   # Exact matching of keywords
    personas= ["488916863", "3034605958"]      # Comma-separated User ids 
    stream.statuses.filter(track = filtro, follow = personas)
    

    【讨论】:

    • +1 尼克利尔!!我试试这个:filtro="['messi','copa100','copaamierica']" personas="488916863,3034605958" stream.statuses.filter(track = filtro, follow = personas) 并且工作正常!!
    • @CarboneroManya,您仍然以错误的方式进行操作。 follow 参数采用逗号分隔的用户 ID 列表,您不能用双引号将 filtro 括起来。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-27
    • 2014-10-30
    • 2013-05-21
    • 2015-03-01
    • 2019-07-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多