【问题标题】:og:type hotel is ignoredog:类型酒店被忽略
【发布时间】:2012-01-30 22:50:37
【问题描述】:

我正在尝试为带有以下标题的度假公寓网站设置 opengraph 标签:

<meta property="og:title" content="Hotel Test"/>
<meta property="og:type" content="hotel"/>
<meta property="og:url" content="http://dl.dropbox.com/u/256059/fb_hotel_debug/index.html"/>
<meta property="og:image" content="http://dl.dropbox.com/u/256059/random%20pictures/testen.jpg"/>
<meta property="og:description" content="Hello World!"/>
<meta property="og:latitude" content="53.554073"/>
<meta property="og:longitude" content="9.9861"/>
<meta property="og:street-address" content="ABC-Straße 19"/>
<meta property="og:locality" content="Hamburg"/>
<meta property="og:postal-code" content="20354"/>
<meta property="og:country-name" content="Germany"/>
<meta property="og:locale" content="de_DE"/>

Facebook 不知何故忽略了 og:type 酒店并将其重置为网站:http://bit.ly/wqHL1T

{
   "url": "http://dl.dropbox.com/u/256059/fb_hotel_debug/index.html",
   "type": "website",
   "title": "Hotel Test",
   "locale": {
      "locale": "de_de"
   },
   "image": [
      {
         "url": "http://dl.dropbox.com/u/256059/random\u002520pictures/testen.jpg"
      }
   ],
   "description": "Hello World!",
   "updated_time": "2012-01-30T22:45:36+0000",
   "id": "10150640100800309"
}

我在这里遗漏了什么吗?因此,所有其他标签(如纬度和经度)都将被忽略...

相关链接:
Debug page
Facebook Debugger

【问题讨论】:

    标签: html facebook-opengraph


    【解决方案1】:

    这些都是不推荐使用的标签。有关当前文档,请参阅 http://ogp.me。

    【讨论】:

    • 啊,我明白了.. 不应该盲目相信 Facebook 文档.. 谢谢! :)
    【解决方案2】:

    我最近遇到了同样的问题。 Facebook 一直忽略所有元标记。

    花了我一段时间,但最后我使用 Facebook 调试工具 >“抓取的 URL”来真正检查我的代码。 此工具可准确显示 Facebook 爬虫所看到的内容。

    我注意到我的 HTML 代码中混有 php 错误。这些错误从未出现在 IE、FF 或 Chrome 的源代码中。就我而言,这与我的浏览器检测代码有关。 Facebook 的爬虫的 user_agent 不在我的列表中,并导致我的检测代码生成破坏 HTML 标记的错误消息。我修复了我的功能,一切又开始工作了!

    我建议您检查您的网站: http://developers.facebook.com/tools/debug/og/echo?q=YOUR_WEBSITE_URL_HERE

    (或使用https://developers.facebook.com/tools/debug,输入您的网址,然后按页面底部的“抓取的网址”。)

    检查

    部分是否混入了垃圾代码。如果有,那么 Facebook 将无法解析元标记。

    【讨论】:

    • 好吧,我确实使用了调试器,正如您在我的问题底部的相关链接中看到的那样。另外 - 问题确实是一个不受支持的 og:type 不再存在,因此它回退到默认值。
    猜你喜欢
    • 2012-11-24
    • 2019-06-03
    • 2020-09-27
    • 2019-08-28
    • 2013-03-15
    • 2014-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多