2012-04-03 125 views
1

我有一个游戏,当用户“解决”一个“单词”它应该调用OG req。问题与Facebook OG /游戏

这里的电话:

curl -F 'access_token=abc' \ 
    -F 'tw=theword_solved_goes_here' \ 
    -F 'word=https://drawabble.com/og/word.php' \ 
    -F 'scrape=true' \ 
     'https://graph.facebook.com/me/drawabble:solve' 

和对象的网址是 - https://drawabble.com/og/word.php?&tw=theword_solved_goes_here

和网页脚本看起来像这样(word.php)

<? 
    if($_GET['fb_action_ids']){ 
     header("Location: http://drawabble.com"); 
    } 
?> 
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" 
     xmlns:fb="https://www.facebook.com/2008/fbml"> 
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# drawabble: http://ogp.me/ns/fb/drawabble#"> 
    <meta property="fb:app_id"   content="360199164024147" /> 
    <meta property="og:type"   content="drawabble:word" /> 
    <meta property="og:title"   content="<?=($_GET['tw'])? $_GET['tw'] : $_POST['tw']?>" /> 
    <meta property="og:url"    content="https://drawabble.com/og/word.php?tw=<?=($_GET['tw'])? $_GET['tw'] : $_POST['tw']?>" /> 
    <meta property="og:description"  content="Solved on http://drawabble.com" /> 
    <meta property="og:image"   content="https://drawabble.com/drawabble.png" /> 
    <meta property="drawabble:tw" content="<?=($_GET['tw'])? $_GET['tw'] : $_POST['tw']?>" /> 
</html> 

的错误是{”错误“:{”type“:”Exception“,”message“:”Object at URL'https://drawabble.com/og/word.php?tw='''drawabble:word''类型是无效的,因为需要'string'类型的属性'og:title'不是pro “}}

所以,我假设标签没有捕获张贴或_get网址...不知道为什么。

任何帮助表示赞赏!

回答

1

在您的通话卷曲,所提供的网址为https://drawabble.com/og/word.php

现在,如果你刮的是,OG:标题是一个空字符串,因为我们没有通过沿TW GET PARAM。我们将一个tw变量传递给Facebook,但这不会传递到您发布的代码中的应用程序。

因此,尝试改变卷曲呼叫...

curl -F 'access_token=abc' \ 
    -F 'word=https://drawabble.com/og/word.php?tw=theword_solved_goes_here' \ 
    -F 'scrape=true' \ 
     'https://graph.facebook.com/me/drawabble:solve'