【问题标题】:how to get weather feeds for multiple cities in single request using yahoo weather api如何使用 yahoo 天气 api 在单个请求中获取多个城市的天气源
【发布时间】:2017-03-25 12:57:11
【问题描述】:

我正在从 yahoo API 获取天气提要,但在一个请求中我只能获得一个地方。我想在一个请求中一次获取多个城市的提要。 请帮我获取多个城市的提要。

【问题讨论】:

    标签: weather-api yahoo-weather-api


    【解决方案1】:

    使用他们提供的网络测试平台here,您可以测试不同的 YQL 查询。

    YQL 是一种类似 SQL 的语言,它支持 ORIN 等运算符。

    我对你的问题的测试是这样的:

    select * from weather.forecast where woeid in (select woeid from geo.places(1) where text in ("nome, ak", "chicago, il", "dallas, tx"))
    

    这会带来 3 个城市的天气预报。

    【讨论】:

    • 如何获取多纬度的天气数据,因为我正在尝试查询但无法获得结果“选择 * from weather.forecast where woeid in (SELECT woeid FROM geo.places WHERE text= "(28.7041, 77.1025),(28.0229, 73.3119)")"
    • @AnandSuthar 我猜你的文本查询中需要一个“或”。这例如有效:select * from weather.forecast where woeid in (SELECT woeid FROM geo.places WHERE text="(28.7041, 77.1025)" or text="(28.0229, 73.3119)")
    猜你喜欢
    • 1970-01-01
    • 2019-05-28
    • 2012-09-09
    • 1970-01-01
    • 2018-02-01
    • 1970-01-01
    • 2020-05-30
    • 2011-02-06
    • 1970-01-01
    相关资源
    最近更新 更多