【问题标题】:How to find woeid (where on earth id) of a country如何找到一个国家的woeid(地球上的id)
【发布时间】:2014-05-20 13:47:54
【问题描述】:

我正在尝试测试 Twitter API 并找出某个国家/地区的趋势。 如何找到特定国家/地区的 WOEID(WHERE ON EARTH IDENTIFIER)? 我尝试在 Google 上查找,但找不到列表。

如果 Python 中有任何提供 WOEID 的程序也可以。

【问题讨论】:

  • 你见过it

标签: python api twitter trend


【解决方案1】:

yweather 包提供了一种方法:

>>> import yweather
>>> client = yweather.Client()
>>> client.fetch_woeid('Australia')
'23424748'

【讨论】:

  • 我发现的唯一官方 pip 包会变得很糟糕并且可以工作。上面的链接适用于 v0.1。我发现 v0.1.1 准备就绪并且可以正常工作 - 所以从“最新”网址下载 pypi.org/project/yweather
  • 包似乎已经过时了。代码不起作用。 HTTP Error 502: Cannot find server.
  • @MatthewTrevor 我已经在本地和 colab 中尝试过,可能不支持这些版本。
  • @LuisFelipe 我很抱歉,我以为你的意思是 pypi 链接。没错,它已被弃用:As of Thursday, Jan. 3, 2019, the weather.yahooapis.com and query.yahooapis.com for Yahoo Weather API will be retired.
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-31
  • 2011-10-16
  • 2014-10-17
  • 1970-01-01
  • 1970-01-01
  • 2013-09-17
相关资源
最近更新 更多