Facebook Like 按钮 og:需要抓取图像才能显示
我有一个 Drupal 网站,上面有文章,其中有类似 Facebook 的按钮。
现在我已经在页面上添加了所有 OpenGraph 元标记,除了一件事之外,一切都运行良好。
网站访问者可以共享页面 URL 或点赞页面 URL。 添加新文章时,第一个按“赞”按钮的人将看不到 og:image
标记中添加的图像。
如果另一个人随后按下“赞”按钮,则 og:image
是可见的,因此在我看来 Facebook 需要先抓取页面,然后再添加 og:image
“Facebook 点赞窗口”。
Facebook 的分享似乎没有遇到这个问题,并且从第一次就做对了。
现在,每当有人添加新文章时,我都需要 Facebook 使用一些 PHP 代码或其他修复程序自动抓取该文章的 URL...
任何人都知道自动抓取 URL 是否可能,或者是否有人有想法解决方法?
I've got a Drupal website with articles on them which have Facebook like buttons.
Now I've got all the OpenGraph metatags added on the pages and it's all working perfectly except for one thing.
Site visitors can share a page URL or like a page URL.
When a new article is added and the first person who presses the like button will not see the image added in the og:image
tag.
If another person afterwards presses the like button, the og:image
however is visible so it seems to me Facebook needs to scrape the page first before the og:image
is added in the 'Facebook Like window'.
The Facebook share doesn't seem to suffer from this problem and does it right from the first time.
Now whenever somebody adds a new article, I'd need the URL of the article to be scraped automatically by Facebook using some PHP code or some other fix...
Anyone who knows if autoscraping a URL is possible or does anyone have an idea for a workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将图形 API 与
scrape=true
结合使用,强制 Facebook 在您创建内容时正确抓取您的信息https://developers.facebook.com/docs/beta/opengraph/objects/
You can use the graph API with
scrape=true
to force Facebook to scrape you right when you create your contentshttps://developers.facebook.com/docs/beta/opengraph/objects/