我正在开发一个可以将推文发送到我的推特个人资料的应用程序。现在我需要实现转推和删除推文功能。我实施了类似以下但没有成功的方法。谁能帮我!!
/* 删除推文函数 */
$twitteroauthPost = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$token = $twitteroauthPost->getRequestToken();
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,$token['oauth_token'], $token['oauth_token_secret']);
$result = $connection->post('statuses/destroy', array('id' => $postId));
/* 转发功能 */
$twitteroauthPost = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$token = $twitteroauthPost->getRequestToken();
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,$token['oauth_token'], $token['oauth_token_secret']);
$result = $connection->post('statuses/retweet', array('id' => $postId));
然后它返回这个
(
[request] => /1/statuses/retweet.json
[error] => Could not authenticate you.
)