如何张贴在Facebook的用户直接墙 [英] How to post on directly users wall in Facebook

查看:157
本文介绍了如何张贴在Facebook的用户直接墙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这张贴在墙上的用户,但它显示了一个空白页,及后不会出现在我的墙上:

  $ URL =htt​​ps://graph.facebook.com/user_id/feed;
$ CH = curl_init();
$附件=阵列('ACCESS_TOKEN'=> access_token_here,
                    '名'=> RAVE肯尼亚
                    '链接'=> www.youtube.com
                    '描述'=> 测试新的Facebook应用程序',
                    '消息'= GT; 测试,                );curl_setopt($ CH,CURLOPT_URL,$网址);
curl_setopt($ CH,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ CH,CURLOPT_SSL_VERIFYHOST,2);
curl_setopt($ CH,CURLOPT_POST,真正的);
curl_setopt($ CH,CURLOPT_POSTFIELDS,$附件);
$结果= curl_exec($ CH);


解决方案

为什么要推倒重来,而不是使用 Facebook的PHP库

和一步一步的指示可在<一href=\"http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/\"相对=nofollow> 5个步骤使用PHP 在Facebook涂鸦墙发布

I use this to post on users wall, but it shows a blank page, and the post doesn't appear on my wall :

$url = "https://graph.facebook.com/user_id/feed";
$ch = curl_init();
$attachment =  array(   'access_token'  => access_token_here,                        
                    'name'          => "Rave Kenya",
                    'link'          => "www.youtube.com",
                    'description'   => 'Testing a new facebook app',
                    'message' => 'Tested',

                );

curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
$result =curl_exec($ch);

解决方案

Why reinvent the wheel and not use facebook php library?

And a step-by-step instructions are available at "5 Steps to publish on a facebook wall using php"

这篇关于如何张贴在Facebook的用户直接墙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆