1
我试图使用freebase返回一个城市相关国家的ISO代码。freebase api获取城市的国家代码
我有这个MQL工作,但它不适用于某些城市,可能有更直接的方法来做同样的事情?
{
"id": "/en/amarillo",
"/location/location/containedby": [
"/location/country/iso3166_1_alpha2": null,
"type": "/location/country"
]
}
对于较小的城市它偶尔不起作用。更好的办法是使用Freebase建议(我用来收集城市)在相同的请求中返回ISO代码?
jQuery ->
$("#city_name")
.suggest(type: "/location/citytown")
.bind "fb-select", (e, data) ->
$("#city_freebase_id").val data.id
是的,不幸的是,在新的搜索API和新的Freebase建议中不赞成使用mql_output。您需要从jQuery执行单独的MQL读取API调用以查找ISO代码。 – 2012-03-29 18:24:26