【问题标题】:Yahoo Placefinder API and cURL/wgetYahoo Placefinder API 和 cURL/wget
【发布时间】:2012-01-24 21:27:27
【问题描述】:

我正在尝试使用我编写的脚本向 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

非常感谢任何帮助。这很令人沮丧,而且看起来应该很容易解决!

【问题讨论】:

  • curl -X GET "http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J" 时无法获取 JSON,您是否缺少参数?
  • 解决了!缺少 curl 参数。将此作为答案,我会将其标记为已回答!

标签: json http curl wget yahoo-api


【解决方案1】:

您也可以通过YQL(雅虎查询语言)尝试使用 Placefinder。它提供 XML 和 JSON 输出,并为您与其他服务混搭提供了更大的灵活性。

这是一个示例调用:

select * from geo.placefinder where text="sfo"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-22
    • 2012-12-10
    • 2013-10-06
    • 2012-10-07
    相关资源
    最近更新 更多