【问题标题】:Twitter Profile Geo Enrichment for the UK英国的 Twitter Profile Geo Enrichment
【发布时间】:2020-07-20 14:42:31
【问题描述】:

在 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 数据),但发现此字段丢失。

【问题讨论】:

    标签: twitter geolocation gnip


    【解决方案1】:

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

    • 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"
          }
        }
      ]
    }
    

    【讨论】:

    • 啊,这太完美了,非常感谢。你是如何找到伦敦物体的?有 API 调用吗?例如,拉出所有包含“伦敦”的对象或与给定地理坐标重叠的所有位置?
    • 这是一个包含伦敦对象的推文示例,通过使用上述查询过滤器之一获得。没有单独的 API 调用。
    猜你喜欢
    • 2011-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多