Twitter API 1.1 update_with_media
$tmhOAuth = new tmhOAuth(array(
'consumerkey' => 'abc',
'consumersecret' => 'abc',
'usertoken' => 'abc',
'usersecret' => 'abc',
));$image = 'your image url';
$message = 'hello world';$response = $tmhOAuth->request('POST', $tmhOAuth->url('1.1/statuses/updatewithmedia'),
array(
'status' => $message,
'media[]' => filegetcontents($image)
));if ($response != 200) {
//Do something if the request was unsuccessful
}
</pre>
Written by Sendy Putra
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#