2

如何使用hybridAuth自动发布到我的 Facebook 页面?

我有一个站点和该站点的 facebook 页面,我使用 hybridAuth 登录到该站点,它工作正常,现在我想使用 hybridAuth 自动发布到 facebook 页面。
这是您可以使用 hybridAuth 发布到用户墙上的方法

$facebook = $hybridauth->authenticate( "Facebook" );

$facebook->api()->api("/me/feed", "post", array(
"message" => "Hi there",
"picture" => "http://www.mywebsite.com/path/to/an/image.jpg",
"link" => "http://www.mywebsite.com/path/to/a/page/",
"name" => "My page name",
"caption" => "And caption"
));
4

1 回答 1

1

该线程已经很老了,但是那里的某些人可能仍在努力应对这一挑战。只需使用此功能,您就可以使用 hybridauth 发布到 facebook 用户墙上。

// init hybridauth
$hybridauth = new Hybrid_Auth( $config );

// try to authenticate with facebook
$adapter = $hybridauth->authenticate( "Facebook" );

// update the user status or post to wall
$adapter->setUserStatus(
array(
"message" => "", // status or message content
"link" => "", // webpage link
"picture" => "", // a picture link
)
);

更多详情请访问hybridauth官方页面:http: //hybridauth.sourceforge.net/userguide/Profile_Data_User_Status.html

于 2015-04-07T18:34:19.963 回答