喜目前我在我的网站开发的Twitter更新......在这里,我已经写了我的代码..当在API控制台工作IM我不能让APROPER结果..Twitter应用程序API
<?php
$tweet_text = 'Hello Twitter';
print "Posting...\n";
$result = post_tweet($tweet_text);
print "Response code: " . $result . "\n";
function post_tweet($tweet_text) {
// Use Matt Harris' OAuth library to make the connection
// This lives at: https://github.com/themattharris/tmhOAuth
require_once('tmhoauth/tmhOAuth.php');
// Set the authorization values
// In keeping with the OAuth tradition of maximum confusion,
// the names of some of these values are different from the Twitter Dev interface
// user_token is called Access Token on the Dev site
// user_secret is called Access Token Secret on the Dev site
// The values here have asterisks to hide the true contents
// You need to use the actual values from Twitter
$connection = new tmhOAuth(array(
'consumer_key' => 'XXX',
'consumer_secret' => 'XXX',
'user_token' => 'XXX',
'user_secret' => 'XXX',
));
// Make the API call
$connection->request('POST',
$connection->url('1/statuses/update'),
array('status' => $tweet_text));
return $connection->response['code'];
}
?>
stsuus响应看起来像它下面
{
"request": "\/1\/statuses\/update.json",
"error": "Client must provide a 'status' parameter with a value."
}
statuus:403 forbidden
任何一个可以解释为什么出错?
,请多关照
您可能想要隐藏您的消费者密钥信息 – fire 2010-12-13 11:14:38