2

我在我的应用程序上做了一个动作“criar”和一个对象“oferta”。它为创建页面返回的代码是:

<head prefix="og: xttp://ogp.me/ns# fb: xttp://ogp.me/ns/fb# testegraph: xttp://ogp.me/ns/fb/testegraph#">
  <meta property="fb:app_id" content="186721904779529" /> 
  <meta property="og:type"   content="testegraph:oferta" /> 
  <meta property="og:url"    content="http://www.vendefacil.net:7979/mkt21manager/Welcome.jsf" /> 
  <meta property="og:title"  content="Sample Oferta" /> 
  <meta property="og:image"  content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" />

(我用 \ 而不是 < 放置了元数据,以便可以读取它们)

我尝试使用以下网址直接向 OpenGraph 发帖:

url = "https://graph.facebook.com/me/testegraph:criar?oferta=http://www.vendefacil.net:7979/mkt21manager/OpenGraph/oferta.html&access_token="+vc.getAccesstoken();

结果是:

HTTP/1.1 400 Bad Request [Access-Control-Allow-Origin: *, Cache-Control: no-store, Content-Type: text/javascript; charset=UTF-8, Expires: Sat, 01 Jan 2000 00:00:00 GMT, Pragma: no-cache, WWW-Authenticate: OAuth "Facebook Platform" "invalid_request" "(#3502) Object at URL http://www.vendefacil.net:7979/mkt21manager/OpenGraph/oferta.html has og:type of 'website'. The property 'oferta' requires an object of og:type 'testegraph:oferta'. ", X-FB-Rev: 644018, X-FB-Debug: Kvtoba9EGskocz2wxI7T2iXvfzV8SvjdxNNzuYfSCp8=, Date: Wed, 10 Oct 2012 16:33:15 GMT, Connection: keep-alive, Content-Length: 252]

似乎在抱怨提供的网站没有 testegraph:oferta 作为 og:type 我知道在给定的网站中。那么有什么问题呢?

4

1 回答 1

0

根据Facebook 的调试工具, 您的应用会立即发送 302 重定向到 302 https://www.facebook.com/dialog/oauth?client_id=153701288088609&redirect_uri=http://www.vendefacil.net:7979/mkt21manager/Welcome.jsf&scope=email,user_photos,user_location,user_groups,status_update&response_type=code

爬虫遵循重定向,但不会抓取 facebook.com URL,因此无法更新有关您页面的信息。

您需要从重定向中免除 Facebook 的爬虫并提供正确的元标记

于 2012-10-10T19:27:19.393 回答