2012-10-10 255 views
2

我在我的应用程序上做了一个动作“criar”和一个“oferta”对象。它回来了创建网页的代码是:OpenGraph不能正常工作

<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" /> 

(我把METAS用\代替<这样他们就可以被读取)

我尝试了直接邮寄到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] 

好像是抱怨ABO所提供的网站没有testegraph:oferta作为og:类型,我知道这是在给定的网站。那么,什么是错的?

回答

0

根据Facebook's Debug Tool您的应用程序将立即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网址,方便你的页面中的信息不能被更新。

您需要从重定向免除Facebook的履带和提供正确的meta标签

+0

好吧,我看到了这个问题,并使用一个简单的网站,如“http://www.google.com”尝试而不是“HTTP ://www.vendefacil.net:7979/mkt21manager/Welcome.jsf”。调试时仍然有警告:推断的属性:\t应该明确提供'og:url'属性,即使可以从其他标记中推断出值。 推断的属性:\t即使可以从其他标签推断出值,也应明确提供'og:title'属性。 –

+0

是的,Google.com没有开放图形元标签。 你需要你的URL来为facebook抓取工具提供正确的标签。 – Igy

+0

我解决了这个页面,现在它在Debug上正常工作。问题是我不能使用我的调试应用程序来调试这个程序,直接在发布版本上测试它,因为它不会在我的本地主机上寻找页面。无论如何,我将在一分钟内测试它,看看正确的页面是否仍然保持相同的错误... –