PHP 数据通过 URL 传递时需要正确的 Open Graph 元标记
我正在使用 PHP 创建一个网站,该网站从 mySQL 数据库中提取数据。绘制的内容不断变化并链接到唯一的ID。虽然主页上拉出了很多内容,但每个 facebook 发送按钮都链接到单独页面上的内容唯一 ID。我通过 facebook 发送中的 URL 传递信息(即链接:www.example.com/info.php?id=5 )
我的问题是发送按钮无法识别页面的 Open Graph Meta 标记- 它显示错误的图片和错误的标题。我已经使用调试器进行了测试 - 它适用于接收页面(www.example.com/info.php),但不适用于添加的数据。也就是说,一旦我将带有数据的完整 URL (www.example.com/info.php?id=5) 插入调试器,该页面就会被抓取并显示出来。现在,所有链接到该确切 URL 的发送按钮都会填充正确的图片和标题。
由于我网站上的内容不断变化,我无法手动让 facebook 使用每个数据 ID 抓取每个潜在 URL 页面。 有没有办法可以通过 URL 传递数据,并让 facebook 发送按钮识别接收页面上的开放图谱元标签以显示每个潜在的 ID?注意:这只是我想要的所有链接的一张图片和标题。
提前感谢您的宝贵时间,我对编程有点陌生,衷心感谢您的帮助!
I'm creating a site utilizing PHP that draws data from a mySQL database. The content that is drawn is constantly changing and linked to a unique ID. Although a lot of content is pulled on a main page, each facebook-send button links to the contents unique ID on a separate page. I'm passing the information through the URL in the facebook send (ie. link: www.example.com/info.php?id=5 )
My problem is that the send button is not recognizing the Open Graph Meta tags for the page - it displays the wrong picture and wrong title. I've tested with the debugger - and it works for the receiving page (www.example.com/info.php), but not with the added data. That said, once I plug in the full URL with data (www.example.com/info.php?id=5) into the debugger - that page gets crawled & all send buttons linking to that exact URL now populate with the correct picture and title.
Because the content on my site is constantly changing I can't manually have facebook crawl each page of potential URLs with each data ID. Is there a way I can pass data through the URL and have facebook-send button recognize the Open Graph Meta Tags on the receiving page to display for every potential ID? Note: it's just one picture and title I want for all links.
I thank you in advance for your time, I'm slightly new to programming and your help is sincerely appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们进行惰性爬网,因此第一个发送的人可能无法立即收到图像,但如果您等待 30 秒并重试,它应该会显示。
We do a lazy crawl, so the first person to Send might not get the image right away, but if you wait 30 seconds and try again it should show up.