雅虎 Placefinder API 和 cURL/wget
我正在尝试使用我编写的脚本向 Yahoo Placefinder API 发出请求,并且希望它返回 JSON。但是,所有请求都会发回 XML。话虽这么说,当我在浏览器中运行相同的脚本时,我会按预期获得 JSON 数据。以下是我的请求:
wget http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid
curl http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid
非常感谢任何帮助。这非常令人沮丧,而且看起来应该很容易修复!
I'm trying to make requests to the Yahoo Placefinder API using a script I wrote, and I'd like it to return JSON. However, all the requests send back XML. That being said, when I run the same script in my browser, I get JSON data as expected. Here are my requests:
wget http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid
curl http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid
Any help is much appreciated. This is pretty frustrating, and seems like it should be easy to fix!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还可以尝试通过 YQL(雅虎查询语言)使用 Placefinder。它提供 XML 和 JSON 输出,并为您提供与其他服务的混搭更多的灵活性。
这是一个示例调用:
从 geo.placefinder 中选择 *,其中 text="sfo"
You might also try using Placefinder through YQL (Yahoo Query Language). It offers both XML and JSON output and gives you some more flexibility for mashups with other services.
Here's a sample call:
select * from geo.placefinder where text="sfo"