代码之家  ›  专栏  ›  技术社区  ›  Scott

Phirehose setTrack无法使用setLocation

  •  0
  • Scott  · 技术社区  · 10 年前

    我正在使用Phirehose使用Twitter流API拉推特。我想用特定的关键词来拉带有地理标记的推特,比如:

    $sc->setLocations(array(array(-180,-90,180,90))); //any geotagged tweet
    $sc->setTrack($sc->getKeywords());
    

    getKeywords类函数如下所示:

    public function getKeywords()
    {
         $array = array('hurricane', 'flood', 'tornado','tsunami','earthquake');
         return $array; 
    }
    

    问题是 setLocation() 似乎导致 setTrack() 不要用这些关键词拉推特。如果我删除 setLocation() 总共 setTrack() 很好地拉关键词。我有没有办法拉那些带有地理标记的包含这些关键词的推文?

    1 回复  |  直到 10 年前
        1
  •  1
  •   Artemide Innominato    10 年前

    track、follow和locations字段应被视为与OR运算符组合。track=foo&follow=134返回与用户1234创建的foo OR匹配的Tweets

    正如Twitter上的人所说 https://dev.twitter.com/streaming/reference/post/statuses/filter

    推荐文章