我有一个工作代码,通过APi使用codebird在Twitter帐户上发布。但是,出于某种原因,只有第一个帐户被发布到,而不是第二个帐户。没有错误。这是php代码:
function tweet($message) {
global $consumerkey, $consumersecret, $accesstoken, $accesssecret;
require_once('/home/curse/public_html/manage/twitter-php-sdk/src/codebird.php');
\Codebird\Codebird::setConsumerKey("$consumerkey", "$consumersecret");
$cb = \Codebird\Codebird::getInstance();
$cb->setToken("$accesstoken", "$accesssecret");
$params = array(
'status' => $message
);
$reply = $cb->statuses_update($params);
}
tweet("$twextra $makelink");
function tweet2($message) {
global $siimconsumerkey, $siimconsumersecret, $siimaccesstoken, $siimaccesssecret;
require_once('/home/curse/public_html/manage/twitter-php-sdk/src/codebird.php');
\Codebird\Codebird::setConsumerKey("$siimconsumerkey", "$siimconsumersecret");
$cb = \Codebird\Codebird::getInstance();
$cb->setToken("$siimaccesstoken", "$siimaccesssecret");
$params = array(
'status' => $message
);
$reply = $cb->statuses_update($params);
}
tweet2("$twextra $makelink");*