2012-02-07 31 views
0

我正嘗試從我的網站上爲登錄用戶發佈個人Facebook牆壁和粉絲頁面牆。使用Graph API在Facebook上發佈Feed - 服務器端

<cfhttp url="https://graph.facebook.com/me/feed" method="post"> 
    <cfhttpparam name="access_token" value="#variables.accessToken#" type="formfield"> 
    <cfhttpparam name="message" value="#arguments.message#" type="formfield"> 
    <cfhttpparam name="link" value="#arguments.link#" type="formfield"> 
    <cfhttpparam name="name" value="#arguments.name#" type="formfield"> 
    <cfhttpparam name="caption" value="#arguments.caption#" type="formfield"> 
    <cfhttpparam name="description" value="#arguments.description#" type="formfield"> 
    <cfhttpparam name="picture" value="#arguments.picturePath#" type="formfield"> 
</cfhttp> 

這是按代碼從developers.facebook.com和http://net.tutsplus.com/tutorials/php/wrangling-with-the-facebook-graph-api/

樣本這僅僅是一個什麼,我認爲樣本參數的含義:

enter image description here

但是當它貼到牆上時,會發生以下情況:

  • 消息,圖片,名稱,標題和說明正確顯示
  • 但鏈接沒有,圖片指向自身,名稱上的鏈接指向圖片。

在提到很多帖子後,我想我會張貼這個。

請幫忙。

+0

請添加掉毛的URL被張貼的結果。 Linter在這裏:https://developers.facebook.com/tools/lint – DMCS 2012-02-07 21:19:48

+0

這是我在鏈接選項提供的URL:http://www.traffikworks.com/community.html – 2012-02-07 21:34:49

+0

你應該給協議好。所以試試這個:http:// www.traffikworks.com/community.html(我把www,因爲我看到你用301重定向瀏覽器) – 2012-02-07 22:32:50

回答

0

你也應該給協議。

那麼試試這個: http://www.traffikworks.com/community.html

(我把WWW,監守你有301反正重定向瀏覽器)

+0

我做到了,依然不起作用。問題是圖像上的鏈接和名稱指向圖像,而不是我設置的鏈接。 – 2012-02-08 14:54:50

+0

我想如果你的url不工作,或者可能會覆蓋某個地方的鏈接參數,就會發生這種情況。我只是建議將幾行代碼放到服務器上,以將POST請求字段存儲在文件中。調用該腳本而不是https://graph.facebook.com/me/feed,您將看到問題所在。如果POST快照包含您嘗試發佈的相同網址,則您將知道您的代碼有效。 – 2012-02-08 23:16:59

相關問題