2

我想更新我的推特。我使用 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']);
4

0 回答 0