Open Graph对象国际化:没有scrape / missing参数fb_locale

时间:2012-08-20 08:33:02

标签: graph localization internationalization opengraph

我在开放图形对象的国际化方面遇到了麻烦。我提供og:locale以及og:locale:alternate标签,但Facebook不会在不同的区域设置中抓取我的对象。在http://developers.facebook.com/tools/debug的对象调试器中,我可以看到og:locale:alternate被解析并将它们显示为数组。但是单击其中一个会导致没有任何参数的刮擦。无法提供fb_locale或语言环境,也不提供标题X-Facebook-Locale。

以下是其中一个示例对象:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta property="og:locale" content="en_US">
<meta property="og:locale:alternate" content="de_DE">
<meta property="og:locale:alternate" content="en_US">
<meta property="og:locale:alternate" content="fr_FR">
<meta property="fb:app_id" content="181576101937079">
<meta property="og:type" content="APP_NAMESPACE:level">
<meta property="og:url" content="http://apps.facebook.com/APP_NAMESPACE/?ogObjType=level&amp;ogObjId=0_0&amp;ogObjVariant=">
<meta property="og:title" content="Tree House Level 1">
<meta property="og:description" content="">
<meta property="og:determiner" content="the">
<meta property="og:image" content="https://URLTOIMAGE">
</head>
<body>
...
</body>
</html>

当我手动添加fb_locale = de_DE时,它会返回。

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta property="og:locale" content="de_DE">
<meta property="og:locale:alternate" content="de_DE">
<meta property="og:locale:alternate" content="en_US">
<meta property="og:locale:alternate" content="fr_FR">
<meta property="fb:app_id" content="181576101937079">
<meta property="og:type" content="APP_NAMESPACE:level">
<meta property="og:url" content="http://apps.facebook.com/APP_NAMESPACE/?ogObjType=level&amp;ogObjId=0_0&amp;ogObjVariant=">
<meta property="og:title" content="Baumhaus Level 1">
<meta property="og:description" content="">
<meta property="og:determiner" content="the">
<meta property="og:image" content="https://URLTOIMAGE">
</head>
<body>
...
</body>
</html>

有人能说出为什么Facebook没有刮掉我对象的本地化版本吗?

2 个答案:

答案 0 :(得分:0)

我有同样的问题。 OG-标记:

<meta property="og:locale" content="en_US" />
<meta property="og:locale:alternate" content="en_GB" />
<meta property="og:locale:alternate" content="fr_FR" />
<meta property="og:locale:alternate" content="ru_RU" />

如果我做了

curl -X POST -F "id=http://gorokhovsky.nampohui.ru" -F "scrape=true" -F "locale=en_GB" "https://graph.facebook.com"

或locale = en_US

我的服务器收到了FB的请求,我收到了正确答案。

{"url":"http:\/\/gorokhovsky.nampohui.ru\/","type":"website","title":"Surfingbird - your personal web!","locale":{"locale":"en_us","alternate":["en_gb","ru_ru","fr_fr"]},"image":[{"url":"http:\/\/surfingbird.ru\/img\/logo-mailru2.gif?v=1"}],"description":"We pick interesting websites, photos and videos that you\u2019ll like.","site_name":"Surfingbird.ru","updated_time":"2013-02-27T15:04:20+0000","id":"356024197844717","application":{"id":"179736405468568","name":"Gorokhovsky2","url":"http:\/\/www.facebook.com\/apps\/application.php?id=179736405468568"}}

但如果我设置locale = fr_FR或ru_RU,我会收到

"error":{"message":"Unsupported post request.","type":"GraphMethodException","code":100}

我的服务器没有收到FB的请求

如果我设置locale = ru_ru或fr_fr,它就像locale = en_US

一样

我认为FB错误地处理了区域设置字符的情况

答案 1 :(得分:0)

尝试使用小写字母用于locale en_us而不是en_US。