我从 facebook 获得了一些自动共享的代码,所以我需要编辑我的代码才能自动共享几次,而不仅仅是 1 次....我需要帮助来解决这个问题,我让你我的代码:
//-- Facebook API --//
require_once 'php-sdk/facebook.php';
//-- App Information --//
$app_id = 'zzzzzzzzz';
$app_secret = 'xxxxxxxxxxxxxxxxxxxxx';
$pageId= 'me';
// Create Facebook Instance
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
//-- To Facebook (Notice we ask for offline access) --//
if (empty($_REQUEST))
{
$loginUrl = $facebook->getLoginUrl(array(
'canvas' => 1,
'fbconnect' => 0,
'scope' => 'offline_access,publish_stream'
));
header('Location:'.$loginUrl );
}
//-- From Facebook --//
else
{
$user = $facebook->getUser();
if($user)
{
$access_token = $facebook->getAccessToken();
$req = array(
'access_token' => $access_token,
'message' => 'Jeremy Gibbs is a handsome lad!');
//-- Send post to Facebook --//
$res = $facebook->api('/'.$pageId.'/feed', 'POST', $req);
header("location: http://facebook.com/".$pageId."");
}
}
那你能告诉我怎么做吗?