确定要与Facebook Open Graph一起使用的URL的Object_ID [英] Determine Object_ID of a URL to use with the Facebook Open Graph
问题描述
我正在尝试学习如何使用Facebook Open Graph API,并提出如何确定我的网站的object_id的问题。我需要这个object_id,以便我可以执行其他查询,例如我想在给定的时间段内获取一些喜欢我的站点的用户列表。
I am trying to learn how to use the Facebook Open Graph API and have a question on how to determine the object_id of my site. I need this object_id so that I can do other queries, such as I want to get a list of users who have liked my site within a given time period.
根据其他Stackoverflow问题,我看到我应该可以运行这个查询来获取object_id
Based on other Stackoverflow questions I have seen that I should be able to run this query to get the object_id
select id from object_url where url in ('www.bubbasgameroom.com', 'bubbasgameroom.com')
当我运行该查询时,会返回一个空的结果。当我运行以下查询,我看到我的页面已被喜欢21次
When I run that query it comes back with an empty result. When I run the following query, I see that my page has been liked 21 times
select total_count from link_stat where url in ('www.bubbasgameroom.com', 'bubbasgameroom.com')
我在这里缺少什么?任何帮助将不胜感激。
谢谢!
What am I missing here? Any help will be greatly appreciated.
Thanks!
推荐答案
很可能 url
应与您的网站上使用的 og:url
元标记相同。此外,您还需要附加 http://
部分,以使其正常工作。例如,这将工作:
Most likely the url
should be identical to the og:url
meta tag if used on your website. Also you need to append the http://
part for it to work. For example this would work:
SELECT url,site,id
FROM object_url
WHERE url IN (
'http://developers.facebook.com',
'http://www.imdb.com/'
)
结果:
[
{
"url": "http://developers.facebook.com",
"site": "developers.facebook.com",
"id": 113167538713703
},
{
"url": "http://www.imdb.com/",
"site": "www.imdb.com",
"id": 6903354771
}
]
但这不是:
SELECT url,site,id
FROM object_url
WHERE url IN (
'developers.facebook.com',
'www.imdb.com/'
)
这篇关于确定要与Facebook Open Graph一起使用的URL的Object_ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!