Yahoo Weather API WOEID 检索

编程入门 行业动态 更新时间:2024-10-11 05:27:18
本文介绍了Yahoo Weather API WOEID 检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在创建一个应用程序 (PHP),它从免费的 RSS 提要中获取雅虎天气数据,并将其与基于从 RSS 提要中检索到的数据的颜色十六进制相关联.我遇到的问题是找到一种无需手动操作即可获取位置代码或 WOEID 的方法.

I'm creating an app (PHP) that takes yahoo weather data from the free RSS feed and correlates it with a colour hex based on data retrieved from the RSS feed. The issue I'm having is finding a way to grab the location code or WOEID without doing it manually.

只要您提供 WOEID,Yahoos API 就会发回 RSS 提要 -> http://weather.yahooapis/forecastrss?w=4097

Yahoos API sends back an RSS feed as long as you provide a WOEID -> http://weather.yahooapis/forecastrss?w=4097

这样做是否符合道德规范?我的初学者知识告诉我我必须编写一个脚本来使用该术语搜索雅虎并获取第一个 WOEID,但我认为雅虎不希望脚本这样做并且看起来过于复杂......如果没有,有没有其他选择可以让我更轻松的 API?

Is there an ethical way of doing this? My beginner knowledge tells me I have to write a script that would search yahoo using the term and grab the first WOEID, but I would assume yahoo doesn't want scripts doing this and it seems overcomplicated... If not, are there any alternative APIs that would make this easier on me?

谢谢!

推荐答案

为什么不直接使用 Yahoo!GeoPlanet 服务将一个地方解析为 WOEID?或者使用 YQL 服务通过它的表访问 GeoPlanet?

Why not just use the Yahoo! GeoPlanet service to resolve a place to a WOEID? Or use the YQL service to access GeoPlanet via it's table?

http://where.yahooapis/v1/places.q('Barrie CA')?appid=[yourappidhere]

http://query.yahooapis/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22Barrie%20CA%22&format=xml

无需刮.

干杯

G

(披露;我为 Yahoo! 工作,并且是 WOEID 和 GeoPlanet 背后小组的一员)

(Disclosure; I work for Yahoo! and am part of the group behind WOEIDs and GeoPlanet)

这篇关于Yahoo Weather API WOEID 检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 16:19:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/942139.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Weather   Yahoo   WOEID   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!