问题描述
示例代码很受欢迎,我似乎在网上找不到任何简单的例子.
Sample code is appreciated, I can't seem to find any simple examples of this online.
推荐答案
使用新的 Facebook PHP-SDK,很容易做到这一点.
Using the new Facebook PHP-SDK, it's very easy to accomplish this.
要求:
- 扩展权限,具体取决于您的需求
- 页面 ID
现在正如我所说,根据您的要求,您可能需要 offline_access、manage_pages,但目前这是最简单的直接方法:
Now as I said, depending on your requirements you may need offline_access, manage_pages, but for now this is the simplest straight forward way of doing this:
下载PHP SDK后,在example.php文件中:
After downloading the PHP SDK, and in the example.php file:
获取
publish_stream权限:
<fb:login-button perms="publish_stream"></fb:login-button>
认证成功后,您在页面墙上发布与正常发布相同的方式用户 个人资料(也有相同的选项,消息、图片、链接、名称、标题、描述、来源):
After successful authentication, you post to the page wall the same way you do it for normal user profile (and with the same options too, message, picture, link, name, caption, description, source):
$page_id = '123456789';
$feed_array = array(
'message' => "Hello world!"
);
$page_post = $facebook->api("/$page_id/feed","post",$feed_array);
结果:
请注意,此方法要求您是页面管理员.
这篇关于如何使用 PHP 和 Open Graph API 发布到 Facebook 粉丝页面的墙上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)