Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
oauth uploader sample
<?php
require_once "Services/OAuthUploader.php";
$oauth = new HTTP_OAuth_Consumer('APP KEY', 'APP SECRET', 'TOKEN', 'SECRET');
$uploader = Services_OAuthUploader::factory('yfrog', $oauth);
//twitpic require api key http://dev.twitpic.com/apps/new
//$uploader = Services_OAuthUploader::factory('twitpic', $this->oauth, 'apiKey');
//proxy
//$req = new HTTP_Request2();
//$req->setConfig(array( 'proxy_host' => 'HOST', 'proxy_port' => 'PORT'));
//$uploader = Services_OAuthUploader::factory('yfrog', $oauth, null, $req);
try {
$url = $uploader->upload('/path/to/upload.jpg', 'from Services_OAuthUploader');
var_dump($url); // uploaded URL
} catch(OAuthUploader_Exception $e) {
var_dump($e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.