I used this PHP to tweet a message and attached a picture
<?php
error_reporting(E_ALL);
require 'tmhOAuth.php';
require 'tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => '***************',
'consumer_secret' => '***************',
'user_token' => '***************',
'user_secret' => '***************',
));
$image = '1329929312.jpg';
$code = $tmhOAuth->request('POST', 'https://upload.twitter.com/1/statuses/update_with_media.json',
array(
'media[]' => "@{$image}",
"status" => "Is this working now?"
),
true, // use auth
true // multipart
);
if ($code == 200) {
tmhUtilities::pr(json_decode($tmhOAuth->response['response']));
} else {
tmhUtilities::pr($tmhOAuth->response['response']);
}
?>
But after tweeting once successfully, with image and message all as expected, it stopped working again.
When I try now there are no response at all that I can look at and debug from, and I don’t think I have changed anything in the php since it worked.
Anyone here able to see what went wrong?