Skip to content

Instantly share code, notes, and snippets.

@stevencorona
Created June 17, 2010 21:46
Show Gist options
  • Save stevencorona/442831 to your computer and use it in GitHub Desktop.
Save stevencorona/442831 to your computer and use it in GitHub Desktop.
<?php
require_once 'HTTP/OAuth/Consumer.php';
$r = new Http_Request2('http://api.twitpic.com/1/uploadAndPost.xml', Http_Request2::METHOD_POST);
$r->addPostParameter( 'consumer_token', '' );
$r->addPostParameter( 'consumer_secret', '' );
$r->addPostParameter( 'oauth_token', '' );
$r->addPostParameter( 'oauth_secret', '' );
$r->addPostParameter( 'message', '@mhp this is a test from the oauth api' );
$r->addPostParameter( 'key', '' );
$r->addUpload( "media", dirname(__FILE__) . '/assets/test_upload.png' );
$res = $r->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment