确定要与 Facebook Open Graph 一起使用的 URL 的 Object_ID

发布于 2024-10-19 21:54:23 字数 506 浏览 1 评论 0原文

我正在尝试学习如何使用 Facebook Open Graph API,并对如何确定我网站的 object_id 有疑问。我需要这个 object_id 以便我可以执行其他查询,例如我想获取在给定时间段内喜欢我的网站的用户列表。

根据其他 Stackoverflow 问题,我发现我应该能够运行此查询来获取 object_id

select id from object_url where url in ('www.bubbasgameroom.com', 'bubbasgameroom.com')

当我运行该查询时,它会返回一个空结果。当我运行以下查询时,我发现我的页面已被点赞 21 次,

select total_count from link_stat where url in ('www.bubbasgameroom.com', 'bubbasgameroom.com')

我在这里错过了什么?任何帮助将不胜感激。
谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

朱染 2024-10-26 21:54:23

如果在您的网站上使用,url 很可能应与 og:url 元标记相同。此外,您还需要附加 http:// 部分才能正常工作。例如,这可以工作:

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

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/'
)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文