Skip to content

Instantly share code, notes, and snippets.

@jmathai
Created June 11, 2009 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmathai/127690 to your computer and use it in GitHub Desktop.
Save jmathai/127690 to your computer and use it in GitHub Desktop.
Upload photos to Twitter's OAuth API using PHP
// This uses twitter-async from GitHub
// Source: https://github.com/jmathai/twitter-async/tree
// Documentation: http://wiki.github.com/jmathai/twitter-async
include 'EpiOAuth.php';
include 'EpiTwitter.php';
$twitterObj = new EpiTwitter('YourConsumerKey', 'YourConsumerSecret', 'Token', 'TokenSecret');
$params = array('@image' => '@/absolute/path/to/image.jpg');
$uploadResp = $twitterObj->post_accountUpdate_profile_image($params);
echo $uploadResp->responseText;
@samerm88
Copy link

if you want to tweet images using twitter api you can check our blog to see all the steps and download the example:
http://www.stirring-interactive.com/blog/tweet-images-using-twitter-api/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment