Does the abraham twitteroauth library work for update_with_media?
I use the code below, but it returns me a stdClass Object ([request] => /1/statuses/update_with_media.json [error] => Error creating status.)
session_start(); require_once('twitteroauth/twitteroauth.php'); require_once('config.php'); if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) { header('Location: ./clearsessions.php'); } $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,$_SESSION['access_token']['oauth_token'], $_SESSION['access_token']['oauth_token_secret']); $image = './images/5298.png'; $content = $connection->post('statuses/update_with_media', array( 'media[]' => '@{$image};type=image/jpeg;filename={$image}', 'status' => 'My current location')); include('html.inc');
Any idea how to solve this problem?
EDIT 1: I use https://upload.twitter.com/1/ as url
Mujtaba haider
source share