我想更新我的Twitter。我使用了来自themattharris的tmhOAuth。我启用了Curl,Twitter应用程序设置正确,具有读写访问权限。我检查了标题,请求是空的。起初,代码应该只是改变Twitter中的密钥和更改。你觉得我做错了什么?
require 'tmhOAuth.php';
require 'tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
// 'consumer_key' => 'YOUR_CONSUMER_KEY',
//'consumer_secret' => 'YOUR_CONSUMER_SECRET',
//'user_token' => 'A_USER_TOKEN',
// 'user_secret' => 'A_USER_SECRET',
'consumer_key' => 's8wEiEo0EFk7fCX5jHfVfw',
'consumer_secret' => 'db2qENrjCRxtaOFs9a7wT7YPjWNRxO1yHHxT9EkM',
'user_token' => '92957047-suEq4sH6ADTFXfOqrWfpbX6D9OqYGMyKA8CMAQVz4',
'user_secret' => 'LqhbQRp29M7L5UfdtJhde3kHxzB5oOn5xtGIdy35bOY',
));
$code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array(
'status' => 'My Twitter Message'
));
if ($code == 200) {
tmhUtilities::pr(json_decode($tmhOAuth->response['response']));
} else {
tmhUtilities::pr($tmhOAuth->response['response']);