首页 > 解决方案 > 英国的 Twitter Profile Geo Enrichment

问题描述

在 Twitter API 文档的高级运算符部分中,它们具有可用于根据 Profile Geo Enrichment 数据进行过滤的运算符。特别是,您可以按 profile_region 进行过滤。一个示例profile_region:"Zurich"按预期返回来自苏黎世用户的推文。但是,profile_region:"London"两者profile_region:"Greater London"都导致请求返回 0 结果。(每月)可以提出的这些请求数量的限制使我不敢继续尝试,直到它成功为止。

我已经搜索了 Twitter 文档、gnip.com 上 API 的旧文档以及 GeoNames.org 以尝试查找 Twitter 对英国地区的定义或只是英国某个地方的示例,但均未成功.

我还使用用户/搜索 API 收集位于伦敦的用户的 user_objects 以查找派生字段(应包含 Profile Geo Enriched 数据),但发现此字段丢失。

标签: twittergeolocationgnip

解决方案


有许多“级别”来描述地理:

  • profile_region
  • profile_subregion
  • profile_locality

如果你使用profile_locality:London你会看到不同的结果(或profile_subregion:"Greater London")。伦敦对象如下所示:

{
  "locations": [
    {
      "country": "United Kingdom",
      "country_code": "GB",
      "locality": "London",
      "region": "England",
      "sub_region": "Greater London",
      "full_name": "London, England, United Kingdom",
      "geo": {
        "coordinates": [
          -0.12574,
          51.50853
        ],
        "type": "point"
      }
    }
  ]
}

推荐阅读