2013-12-17 100 views
2

我怎麼能自動翻譯我的臉書頁與hybridAuth?HybridAuth autopost到臉書頁面

我有一個網站,該網站, 一個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" 
)); 
+0

爲什麼沒有回答這個問題??? – Tabby

回答

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