OpenGraph linter 找不到 url 或无法读取元标记
我有一个奇怪的错误,有时 FB linter 抓取我的内容,但说它找不到元标记,而有时又说它根本找不到内容。
我检查了我的 apache 日志,FB 两次都正确地调用了我:
69.63.181.244 - - [12/Oct/2011:11:02:07 -0700] "GET /~gilles/www/gillesdevaux/outbox/248227866689405176 HTTP/1.1" 200 8339 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
69.63.181.244 - - [12/Oct/2011:11:02:09 -0700] "GET /~gilles/www/gillesdevaux/outbox/248158254941601902 HTTP/1.1" 200 8104 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
第一个 linter 说我错过了 og:* 属性,第二个 linter 说无法访问该页面。
以下是两个页面的 html 代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# mytest: http://ogp.me/ns/fb/mytest#">
<title>opengraph picture + link | Formspring</title>
<base href="https://testserver/~gilles/www/" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="opengraph picture + link" />
<meta name="keywords" content="" />
<meta property="fb:app_id" content="201652911907"/>
<meta property="og:title" content="opengraph picture + link"/>
<meta property="og:type" content="mytest:question"/>
<meta property="og:url" content="https://testserver/~gilles/www/gillesdevaux/outbox/248227866689405176"/>
<meta property="og:image" content="http://testserver/photos/20111011/n4e94d0e273403.jpg"/>
<meta property="mytest:link" content="http://en.wikipedia.org/wiki/Cheese"/>
已解决
FB 需要 ping 您提交到 linter(或图形 API)的 URL,但还需要 ping og:url 中提到的 URL。
我的开发设置有点奇怪,它受基本身份验证保护,并且 OpenGraph URL 在代理中列入白名单。使用我为 og:url 提交的相同 URL 解决了该问题。
I have this weird error where sometimes the FB linter grabs my content but says it can't find the meta tags while sometimes it says it can't find the content at all.
I checked my apache logs and FB calls me properly both time:
69.63.181.244 - - [12/Oct/2011:11:02:07 -0700] "GET /~gilles/www/gillesdevaux/outbox/248227866689405176 HTTP/1.1" 200 8339 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
69.63.181.244 - - [12/Oct/2011:11:02:09 -0700] "GET /~gilles/www/gillesdevaux/outbox/248158254941601902 HTTP/1.1" 200 8104 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
First one the linter says I miss og:* properties, the second one the linter says the page could not be reached.
Here is the html code for both pages:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# mytest: http://ogp.me/ns/fb/mytest#">
<title>opengraph picture + link | Formspring</title>
<base href="https://testserver/~gilles/www/" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="opengraph picture + link" />
<meta name="keywords" content="" />
<meta property="fb:app_id" content="201652911907"/>
<meta property="og:title" content="opengraph picture + link"/>
<meta property="og:type" content="mytest:question"/>
<meta property="og:url" content="https://testserver/~gilles/www/gillesdevaux/outbox/248227866689405176"/>
<meta property="og:image" content="http://testserver/photos/20111011/n4e94d0e273403.jpg"/>
<meta property="mytest:link" content="http://en.wikipedia.org/wiki/Cheese"/>
Solved
FB needs to ping the URL you submit to the linter (or to the graph API) but also needs to ping the URL mentioned in og:url.
My dev setup is a bit weird, it's basic auth protected and the OpenGraph URL are whitelisted in a proxy. Using the same URL I submit for og:url fixed the issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将开放图谱协议命名空间属性添加到标签中:
add the Open Graph Protocol namespace attribute to the tag: