大佬教程收集整理的这篇文章主要介绍了使用cURL PHP发布到Facebook用户墙,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
$attachment = array(
'access_token' => $token,
'message' => $msg,
'name' => $title,
'link' => $uri,
'description' => $desc,
'picture'=>$pic,
'actions' => Json_encode(array('name' => $action_name,'link' => $action_link))
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/fbnameorID/Feed');
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);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, truE); //to suppress the curl output
$result = curl_exec($ch);
curl_close ($ch);
我正在存储Facebook用户ID和访问令牌。我可以将此信息发布到所选用户的留言墙上吗?在这里可以找到以下代码:http
:
//developers.facebook.com/docs/reference/api/post/
我只是不确定如何用php运行它。
curl -F 'access_token=$accessToken' \
-F 'message=check out this funny article' \
-F 'link=http://www.example.com/article.html' \
https://graph.facebook.com/$facebookid/feed
以上是大佬教程为你收集整理的使用cURL PHP发布到Facebook用户墙全部内容,希望文章能够帮你解决使用cURL PHP发布到Facebook用户墙所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。