OpenGraph scraper不接受语言环境

时间:2012-08-21 09:11:07

标签: internationalization locale opengraph scraper

我遇到了Open Oraph对象国际化的问题。

当我要求刮刀在特定区域设置中刮取我的opengraph对象时,首先在默认区域设置中抓取对象,即不使用参数fb_locale,然后在正确的区域设置中刮取对象,即使用fb_locale = [LOCALE] 。 scrape的返回包含第一个默认语言环境(en_US)scrape的结果,并且对象在慢性和feed中都没有以正确的语言环境显示。

以下是我的电话:

Call the scraper
POST        https://graph.facebook.com
id          http://apps.facebook.com/[APP_NAMESPACE]/?ogObjType=prize&ogObjId=1&ogObjVariant=
scrape      true
locale      de_DE

然后第一次刮痧是由Facebook完成的:

GET [GAME_HOST]?ogObjType=prize&ogObjId=1&ogObjVariant

Returns:
<html><head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# [APP_NAMESPACE]: http://ogp.me/ns/fb/[APP_NAMESPACE]#">

  <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="[APP_ID" /> 
  <meta property="og:type"   content="[APP_NAMESPACE]:prize" /> 
  <meta property="og:url"    content="http://apps.facebook.com/[APP_NAMESPACE]/?ogObjType=prize&ogObjId=1&ogObjVariant" /> 
  <meta property="og:title" content="Golden Medal" />
  <meta property="og:description" content="A Golden Medal" />
  <meta property="og:determiner" content="the" />
  <meta property="og:image" content="[IMAGE_en_US_URL]" />
</head><body...</body></html>

然后第二次刮擦由facebook完成:

GET [GAME_HOST]?ogObjType=prize&ogObjId=1&ogObjVariant&fb_locale=de_DE

Returns:
<html><head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# [APP_NAMESPACE]: http://ogp.me/ns/fb/[APP_NAMESPACE]#">

  <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="[APP_ID]" /> 
  <meta property="og:type"   content="[APP_NAMESPACE]:prize" /> 
  <meta property="og:url"    content="http://apps.facebook.com/[APP_NAMESPACE]/?ogObjType=prize&ogObjId=1&ogObjVariant" /> 
  <meta property="og:title" content="Goldmedaille" />
  <meta property="og:description" content="Eine Goldmedaille" />
  <meta property="og:determiner" content="the" />
  <meta property="og:image" content="[IMAGE_de_DE_URL]" />
</head><body>...</body></html>

刮刀返回:

{"url":"http:\/\/apps.facebook.com\/[APP_NAMESPACE]\/?ogObjType=prize&ogObjId=1&ogObjVariant",
"type":"[APP_NAMESPACE]:prize",
"title":"Golden Medal",
"locale":{"locale":"en_us","alternate":["de_de","en_us","fr_fr"]},
"image":[{"url":"[IMAGE_en_US_URL]"}],
"description":"A Golden Medal",
"site_name":"[APP_NAME]",
"determiner":"the",
"updated_time":"2012-08-21T08:58:57+0000",
"id":"[SOME_ID]",
"application":{"id":"[APP_ID]","name":"[APP_NAME]","url":"http:\/\/www.facebook.com\/apps\/application.php?id=[APP_ID]"}}

您有什么建议,为什么对象被刮两次而且本地化版本没有存储?

0 个答案:

没有答案