gpt4 book ai didi

facebook - 如何使用 PHP 中的 API 在 facebook 中发布墙?

转载 作者:行者123 更新时间:2023-12-02 07:50:39 24 4
gpt4 key购买 nike

我想使用 facebook API 在 facebook 的墙上发布分数。

最佳答案

确保您拥有 Facebook SDK https://github.com/facebook/php-sdk

启动 Facebook API

$facebook = new Facebook(array(
'appId' => YOUR_APP_ID,
'secret' => YOU_APP_SECRET,
'cookie' => true,
));

确保您的用户具有“publish_stream”扩展权限然后调用 facebook 图表提要:

            $facebook->api("/$user/feed", 'post', array(
'message' => "Hi",
'link' => 'http://mywebsite.com',
'picture' => 'http://mywebsite.com/picture.jpg',
'name' => 'MyWebSite',
'description'=> 'MyWebSite is a website for me!'
)
);

关于facebook - 如何使用 PHP 中的 API 在 facebook 中发布墙?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4030701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com