基于facebook的documentation
id - The ID of the Graph object represented by the URL
使用URL:
SELECT url, id, type, site FROM object_url WHERE url = "http://www.mashable.com"
响应:
{
"data": [
{
"url": "http://www.mashable.com",
"id": 435564669831754,
"type": "link",
"site": "www.mashable.com"
}
]
}
使用ID:
SELECT url, id, type, site FROM object_url WHERE id = 435564669831754
响应:
{
"data": [
{
"url": "http://mashable.com/stories/",
"id": 435564669831754,
"type": "link",
"site": "mashable.com"
}
]
}
在这种情况下捣碎URL,响应值“类型:链接”,如果你的U调用图形API与返回的ID,它不会给任何值。但是如果返回类型是“Page”,那么返回ID将起作用。
但是,如果尝试使用此IMDB网址,
SELECT url, id, type, site FROM object_url WHERE url = "http://www.imdb.com/title/tt0117500/"
响应:
{
"data": [
{
"url": "http://www.imdb.com/title/tt0117500/",
"id": 114324145263104,
"type": "page",
"site": "www.imdb.com"
}
]
}
从文档 - >
type - The type of object the URL represents (note: 'Page' incorporates any URL with an 'og:type' specified)
我也尝试www.imdb.com在
SELECT url, id, type, site FROM object_url WHERE url = "http://www.imdb.com"
响应:
{
"data": [
{
"url": "http://www.imdb.com",
"id": 6903354771,
"type": "link",
"site": "www.imdb.com"
}
]
}
但是,如果你在FB中调试工具检查任何网址,在最后一节有ID为图形API URL工作正常。我不确定Facebook如何在调试器中获得此功能。
对于OpenGraph对象,类型为namespace:object_type,这是从查询graph.facebook.com/OBJECT_ID而不是从FQL查询返回的'link'类型返回的。有没有办法从给定的URL获取正确的OpenGraph对象ID? – 2013-03-06 11:37:49
这里的开放图形对象的URL应该是什么? – Kunu 2014-06-18 07:08:55