雅虎 Placefinder API 和 cURL/wget

发布于 2024-12-22 02:54:17 字数 388 浏览 2 评论 0原文

我正在尝试使用我编写的脚本向 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔戏命师 2024-12-29 02:54:17

您还可以尝试通过 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"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文