2012-02-07 62 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

相关问题