【问题标题】:How to get location of Tweets with Twitter search API如何使用 Twitter 搜索 API 获取推文的位置
【发布时间】:2016-04-11 23:43:25
【问题描述】:

Twitter API 的statuses/user_timeline 部分将地理位置数据作为“地点”与每条推文一起返回。另一方面,搜索 API 不会返回此位置数据(据我所知)。有没有办法使用搜索 API 获取位置数据?

【问题讨论】:

标签: geolocation twitter


【解决方案1】:

search 资源的每个结果中都有一个geo 字段(参见documentation 中的示例),这是一种地理定位形式,但与place 字段不完全相同在statuses/user_timeline

或者,您可以通过statuses/show/:id 资源(参见documentation)使用结果的id 发出另一个请求,该资源返回geoplace 字段,但这意味着再发出一个请求每个结果。

【讨论】:

    【解决方案2】:

    Matt asked this question directly to Twitter and got a response,回答的开发人员指出 JSON 格式确实包含“geo”属性。

    【讨论】:

      猜你喜欢
      • 2012-05-23
      • 1970-01-01
      • 1970-01-01
      • 2015-06-06
      • 2018-03-15
      • 2012-09-26
      • 2013-08-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多