开发者

Determine Object_ID of a URL to use with the Facebook Open Graph

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.

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')

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!


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/'
)

Result:

[
  {
    "url": "http://developers.facebook.com",
    "site": "developers.facebook.com",
    "id": 113167538713703
  },
  {
    "url": "http://www.imdb.com/",
    "site": "www.imdb.com",
    "id": 6903354771
  }
]

But this doesn't:

SELECT url,site,id 
FROM object_url 
WHERE url IN ( 
    'developers.facebook.com',
    'www.imdb.com/'
)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜