I don’t know why nobody posted the latest code update here, but I just tested this CODE snippet using ‘tmhOAuth library for PHP’…
include ‘/var/www/apps/Twitter/tmhOAuth.php’;
$tmhOAuth = new tmhOAuth(array(
‘consumer_key’ => ‘x’,
‘consumer_secret’=> ‘x’,
‘token’ => ‘x’,
‘secret’ => ‘X’
));
$image =’/var/www/images/SpinHistoryRoulette.png’;
$status = “Picture posting test bitcoin-roulette.com”;
$tmhOAuth->request(‘POST’, ‘https://api.twitter.com/1.1/statuses/update_with_media.json’, array( ‘media[]’ => “@{$image}”, ‘status’ => $status), true, true );
The last line of code is what I have seen written incorrectly everywhere.
- make sure the $image is a reference to a local filename (NOT URL)
- check the parameters to request() are like above