Facebook 无法识别我的元标签
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<title></title>
<meta property="og:title" content="Katha Screenplay Darsakatvam (KSD) Appalaraju "/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://reviewumpire.com/movies/54-katha-screenplay-darsakatvam-ksd-appalaraju-"/>
<meta property="og:image" content="http://reviewumpire.com/images/uploads/movie/vertical/54/vert.jpg"/>
<meta property="og:site_name" content="ReviewUmpire"/>
<meta property="fb:app_id" content="162180660488445" />
<meta property="fb:admins" content="57728908711" />
<meta property="og:description" content="23% scored on reveiwumpire."/>
<meta name="google-site-verification" content="RXjWilEYk0eC_6ulYSV_AaFVSQe8nHI6Zw4_W9dVR5I" />
<script src="/javascripts/vendor/jquery.min.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/vendor/quote.rotator.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/vendor/scroll.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/vendor/rails.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/application.js?1306239220" type="text/javascript"></script>
<link href="/stylesheets/compiled/grid.css?1306239220" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/compiled/text.css?1306239220" media="screen" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Play:regular,bold&subset=greek,latin" media="screen" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=greek,latin" media="screen" rel="stylesheet" type="text/css" />
<meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="ZrmCr3Qg7dNgPynFSSyFEHNaSpOUMYNEput1oUcyMIE="/>
</head>
当我使用 facebook lint 时 http://developers.facebook.com/tools/lint 它没有检测到我的任何 Facebook 标签
Warning
Required Property Missing og:title is required
Required Property Missing og:type is required
Required Property Missing og:image is required
Required Property Missing og:url is required
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<title></title>
<meta property="og:title" content="Katha Screenplay Darsakatvam (KSD) Appalaraju "/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://reviewumpire.com/movies/54-katha-screenplay-darsakatvam-ksd-appalaraju-"/>
<meta property="og:image" content="http://reviewumpire.com/images/uploads/movie/vertical/54/vert.jpg"/>
<meta property="og:site_name" content="ReviewUmpire"/>
<meta property="fb:app_id" content="162180660488445" />
<meta property="fb:admins" content="57728908711" />
<meta property="og:description" content="23% scored on reveiwumpire."/>
<meta name="google-site-verification" content="RXjWilEYk0eC_6ulYSV_AaFVSQe8nHI6Zw4_W9dVR5I" />
<script src="/javascripts/vendor/jquery.min.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/vendor/quote.rotator.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/vendor/scroll.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/vendor/rails.js?1306239220" type="text/javascript"></script>
<script src="/javascripts/application.js?1306239220" type="text/javascript"></script>
<link href="/stylesheets/compiled/grid.css?1306239220" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/compiled/text.css?1306239220" media="screen" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Play:regular,bold&subset=greek,latin" media="screen" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=greek,latin" media="screen" rel="stylesheet" type="text/css" />
<meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="ZrmCr3Qg7dNgPynFSSyFEHNaSpOUMYNEput1oUcyMIE="/>
</head>
when i use facebook lint
http://developers.facebook.com/tools/lint
it is not detecting any of my facebook tags
Warning
Required Property Missing og:title is required
Required Property Missing og:type is required
Required Property Missing og:image is required
Required Property Missing og:url is required
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
您在
og:url
元标记中指定的 URL 包含无效的fb:admin
。请使用有效的管理员 ID 更新它,然后重试。请参阅 Facebook 调试工具
The URL you've specified at the
og:url
meta tag contains an invalidfb:admin
. Please update it with a valid admin ID and try again.See Lint information at the Facebook Debugger Tool
我遇到了同样的问题,我发现 Facebook 可以识别
,然后转到 yourURL 获取其他标签信息,例如
og:title
...等I had the same problem and what I found out was that Facebook recognizes
and then goes to yourURL to get the other tag info like
og:title
...etc我知道这是一个老问题,但我无法真正看到我找到的答案 - 只需删除 facebook 元代码末尾的斜杠 (/) 即可。
因此,如果您没有使用正确的 DOCTYPE,Facebook 会创建错误的代码:
正确的是:
I know that this is an old question but I can't really see the answer that I find - just remove slash (/) at the end of facebook meta code.
So Facebook create wrong code if you not using right DOCTYPE:
right is:
您缺少名称空间定义
xmlns:fb="http://www.facebook.com/2008/fbml"
xmlns:og="http://opengraphprotocol.org/schema/"
编辑:
You're missing the namespace definitions
xmlns:fb="http://www.facebook.com/2008/fbml"
xmlns:og="http://opengraphprotocol.org/schema/"
Edit:
<html xmlns:fb="http://www.facebook.com/2008/fbml"
xmlns:og="http://opengraphprotocol.org/schema/"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" dir="ltr">
我检查了我的代码,发现我在标签之前输出了一些数据。这导致 facebook 解析器混乱,当我从这些标签之外删除 html 时,它就工作正常了。
I checked out my code and discovered that i was outputting some data before the tags. This caused the facebook parser to mess up and as soon as i removed the html from outside those tags it worked fine.
检查您的服务器为该页面发送的 HTTP 响应标头。
如果缺少 Content-Length 字段,那么这就是您的问题。根据我的经验,如果缺少该字段,Facebook 将不会解析您的页面。
Check the HTTP response headers your server is sending out for that page.
If the Content-Length field is missing then that is your problem. In my experience, Facebook will not parse your page if that field is missing.
对我来说,这是因为我有一个 302 重定向来访问带有 OG 元标记的实际页面。我的猜测是 Facebook 爬虫不遵循重定向,因此您必须确保在第一个请求时返回 200。
For me, this was because I had a 302 Redirect to get to the actual page with the OG meta tags. My guess would be that the Facebook crawler doesn't follow redirects so you have to make sure you're returning a 200 on the first request.
如果您已将代码从浏览器复制到编辑器中,则元标记中的双引号也可能编码错误。
我通过使用 linter 在我的页面标记中发现了大量错误
https://developers.facebook.com/tools/debug/
下面是一个函数: “准确查看我们的抓取工具在您的 URL 中看到的内容”这非常有帮助。
Might also be wrong encoded double quotes in the meta tags, if e.g. you have copied the code from a browser into your editor.
I found a huge number of bugs in my pages markup by using the linter at
https://developers.facebook.com/tools/debug/
Down below is a function: "See exactly what our scraper sees for your URL" which is really helpful.
尝试删除
并使用它来测试您的网址和错误信息
try removing
and use this, to test your url and error info
我们注意到,facebook 爬虫愿意遵循 og:image url 中的重定向,但 facebook 客户端却不愿意。以这个例子为例。
尝试将以下链接发布到 Facebook。如果 facebook 之前已经看到过该 url,那么他们的爬虫就会正确缓存该图像。如果没有,那就不会。要模拟此行为,请将随机字符串放入下面 url 的 ref 参数中。
http://www.blipboard.com/4fac51e571272e0100000015?ref=1
如果您尝试发布此网址(插入随机 ID)后,第一次将无法显示正确的图像。如果您随后重新加载 Facebook 页面并尝试再次发帖,这次就会成功。
元标记如下(需要重定向):
我对此的最佳解释是 facebook 客户端代码不遵循重定向,但爬虫会遵循重定向(调试器也是如此)
What we noticed is that the facebook crawler is willing to follow redirects in the og:image url but the facebook client does not. Take this example.
Try posting the following link into facebook. If facebook has seen the url before, their crawler will have properly cached the image. If it hasn't, it will not. To simulate this behavior, put a random string into the ref parameter of the url below.
http://www.blipboard.com/4fac51e571272e0100000015?ref=1
If you try to post this url (with the random id inserted) it will fail to show the correct image the first time. If you then reload the facebook page and try to post again, this time it will work.
The meta-tag is the following (which requires a redirect):
The best explanation I have for this is that the facebook client code doesn't follow redirects but the crawler does (as does the debugger)