Facebook 对象调试器:属性“og:url”无法解析为类型“url”
当我通过对象调试器运行 Facebook Open Graph 对象 (http://www.21dads.com/testobject) 时,出现以下错误:
对象无效值:URL“http://www.21dads.com/testobject”处的对象 'thetestasdf:recipie' 类型无效,因为给定值 无法解析属性“og:url”的“www.21dads.com/testobject” 作为类型“url”。
缺少必需的属性:og:url 属性是必需的,但不是 存在。
缺少必需的属性:og:type 属性是必需的,但不是 存在。
缺少必需的属性:og:title 属性是必需的,但不是 存在。
以下是对象页面上的 HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# thetestasdf: http://ogp.me/ns/fb/thetestasdf#">
<meta property="fb:app_id" content="325291980834949" />
<meta property="og:type" content="thetestasdf:recipie" />
<meta property="og:url" content="www.21dads.com/testobject" />
<meta property="og:title" content="Cookie Recipie!" />
<meta property="og:description" content="Tastiest recipe ever" />
<meta property="og:image" content="http://cdn.techpatio.com/wp-content/uploads/2009/11/cookie_law_eu.gif" />
<title> Cookie Recipie</title>
<head/>
<body>
<p> Test object page </p>
</body>
</html>
URL“www.21dads.com/testobject”是我的控制器,它然后从视图文件生成 HTML。为什么这个网址无法解析?
当其他“缺少必需的属性”错误已经包含在内时,为什么我会收到这些错误?
谢谢。
When I run my Facebook Open Graph object (http://www.21dads.com/testobject) through the Object Debugger, I'm getting the following errors:
Object Invalid Value: Object at URL 'http://www.21dads.com/testobject'
of type 'thetestasdf:recipie' is invalid because the given value
'www.21dads.com/testobject' for property 'og:url' could not be parsed
as type 'url'.Missing Required Property: The og:url property is required, but not
present.Missing Required Property: The og:type property is required, but not
present.Missing Required Property: The og:title property is required, but not
present.
Here is the HTML on the object page:
<html xmlns="http://www.w3.org/1999/xhtml">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# thetestasdf: http://ogp.me/ns/fb/thetestasdf#">
<meta property="fb:app_id" content="325291980834949" />
<meta property="og:type" content="thetestasdf:recipie" />
<meta property="og:url" content="www.21dads.com/testobject" />
<meta property="og:title" content="Cookie Recipie!" />
<meta property="og:description" content="Tastiest recipe ever" />
<meta property="og:image" content="http://cdn.techpatio.com/wp-content/uploads/2009/11/cookie_law_eu.gif" />
<title> Cookie Recipie</title>
<head/>
<body>
<p> Test object page </p>
</body>
</html>
The URL "www.21dads.com/testobject" is my controller which then generates the HTML from a view file. Why can't this URL be parsed?
Why am I getting the other "missing required property" errors when they are already included?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您应该在
og:url
内容前面添加方案(例如http://
或https://
),否则这不是网址。在您的具体情况下,您应该将
www.21dads.com/testobject
替换为http://www.21dads.com/testobject
You should have scheme in front of
og:url
content (likehttp://
orhttps://
), or this isn't URL.In your specific case you should replace
www.21dads.com/testobject
withhttp://www.21dads.com/testobject
要检查的可能问题的综述/清单:
Roundup / checklist of possible issues to check for:
您可以尝试使用此 https://developers.facebook.com/tools/debug/ og/object/ 查看确切废弃的内容。无论如何,Facebook 说他们正在使用开放图,但很多人测试似乎都说他们没有。
You can try to use this https://developers.facebook.com/tools/debug/og/object/ for see what is exactly scrapped. Anyway facebook say they are using open graph, but a lot of personnals test seems to say they don't.
另一个可能的原因可能是重复的开放图元标签。
Another possible reason for this could be duplicated Open Graph Meta tags.
通过评论插件使用超链接时要小心。
< div class="fb-comm en ts" data-href="http://website.com/view.php?id=323" data-width="100%" data-numposts="20">
我使用 https:// 而不是 http:// (因为我没有在服务器上安装 SSL。)
Be careful while using hyperlink through the comment plugin.
< div class=" fb - comm en ts" data - href ="http://website.com/view.php?id=323" data-width="100%" data-numposts="20">
I was using https:// instead of http:// (because I didn't have the SSL installed on the server.)
我也有同样的问题。当我分享到 FB 时,我的帖子下面的描述显示了很多奇怪的词语,例如但仅适用于我的一些帖子(有些是正确的)。我执行了以下步骤并解决了我的问题(我不知道任何编码):
1-在我的 wp-admin 中,我检查了“文本”而不是“视觉”,在那里我可以奇怪地看到我的描述以及所有这些垃圾像这样的词我去掉了任何多余的词并保存了。
2-在 https://developers.facebook.com/tools/debug/og/object /,我输入了帖子页面 URL 并按下“获取新的抓取信息”,
然后 ta..rrraaa!已经修好了!
I had the same problem. The description below my posts when shared to FB, showed a lot of strange words such as but only for some of my posts (some were correct). I did below steps and fixed my problem (I don't know any coding):
1- In my wp-admin, I checked the 'TEXT' rather than 'VISUAL' where I could strangely see my description as well as all those rubbish words such as so I got rid of any extra word and saved.
2- In https://developers.facebook.com/tools/debug/og/object/, I typed the post page URL and pushed "Fetch New Scrape Information"
And ta..rrraaa! It was fixed!