使用 Facebook(例如 API 和 opengraph)

发布于 2024-12-25 17:23:20 字数 908 浏览 1 评论 0原文

facebook 的文档无法理解,至少对我来说是这样。

我以前从未使用过 Facebook,并且有一个基本要求,即在产品页面上放置一个“赞”按钮。

因此,昨天,我将 OpenGraph 元标记和点赞按钮添加到了我的产品页面,如本文档中所述,https ://developers.facebook.com/docs/opengraph/。我还创建了一个应用程序,正如文档所述,它扩展了基本元数据以添加必填字段以将您的网页与 Facebook 连接:fb:app_id

已设置“喜欢”按钮,但我有几个查询,如下所示:-

  1. 对于某些页面,“喜欢”按钮不读取 og 标签。它不是通过阅读 og 标签以故事的方式发布整个内容,而是仅显示一个链接。在谷歌搜索过程中,我读到它是由于 Facebook 缓存而发生的,因为我在放置元标签之前在 Facebook 上共享了链接,所以这种情况正在发生。那么,有什么方法可以让 facebook 重置我的页面的所有缓存或之前完成的抓取。

  2. 虽然我已经创建了该应用程序,但我实际上不知道如何使用它。为什么需要它以及它可以帮助我做什么。

  3. 我在这里测试了我的一个网址:Facebook Linter 但它显示了一些错误和内容我无法理解。下面是图像。请告诉我是否做错了什么以及为什么显示这些错误

在此处输入图像描述

The Documentation from facebook isn't understandable, atleast for me.

I have never worked before with facebook and had a basic requirement of putting a like button on Product pages.

So yesterday, I added the OpenGraph meta tags and like button to my Product pages as stated in this documentation, https://developers.facebook.com/docs/opengraph/. I also created an app, as the document stated that it has extended the basic meta data to add a required field to connect your webpage with Facebook: fb:app_id.

The like button has been set but i have few queries which are as following :-

  1. For some pages, the like button doesn't read the og tags. Rather than publishing the whole thing in a story manner by reading og tags, it just shows a link. During googling, I read it happens because of facebook caching and since, I shared the link on facebook before putting the meta-tags, this is happening. So, Is there any way that I can direct facebook to reset all the caching for my pages or scraping that it has done earlier.

  2. Though I have created the App, I actually have no idea what to do with it. Why is it needed and what matters it can help me with.

  3. I tested one of my URLs here: Facebook Linter but it shows some error and stuff which i can't understand. Below is the image. Please tell if I have done anything wrong and why it's showing these errors

enter image description here

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

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

发布评论

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

评论(1

童话 2025-01-01 17:23:21

Facebook 上的 OpenGraph 文档包含有关预定义类型的过时信息,请参阅 OpenGraph 类型。您可能需要使用开放图谱设置中的开发人员应用程序为您的应用程序/站点定义自定义对象类型“产品”。

您可能还想阅读 OpenGraph beta 的文档。

更新:
关于这个 og:type 有一个类似的问题:Opengraph 元标记 og:type 设置为“产品”错误(如按钮和 URL linter/debug)

Documentation for OpenGraph on Facebook containing outdated information about pre-defined types, see OpenGraph Types. You probably need to define your custom Object Type "Product" in for your Application/Site using Developer Application in Open Graph settings.

You may want to read Documentation for OpenGraph beta too.

Update:
There is a similar question about exactly this og:type: Opengraph meta tag og:type set to “product” errors (like button & URL linter/debug)

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