基於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