TwitPic es un servicio que se utiliza para subir fotos que luego publicas en Twitter. Si estás realizando una aplicación que tira de Twitter y quieres dar la oportunidad al usuario de subir sus fotos puedes hacer uso de esta aplicación y su API (es necesario darse de alta):
$twitpic = new TwitPic($api_key, $consumer_key, $consumer_secret, $oauth_token, $oauth_secret);
try {
/*
* Retrieves all images where the user is facetagged
*/
$user = $twitpic->faces->show(array('user'=>'meltingice'));
print_r($user->images);
$media = $twitpic->media->show(array('id'=>1234));
echo $media->message;
$user = $twitpic->users->show(array('username'=>'meltingice'), array('process'=>false, 'format'=>'xml'));
echo $user; // raw XML response data
/*
* Uploads an image to TwitPic
*/
$resp = $twitpic->upload(array('media'=>'path/to/file.jpg', 'message'=>'This is an example'));
print_r($resp);
/*
* Uploads an image to TwitPic AND posts a tweet
* to Twitter.
*
* NOTE: this still uses v2 of the TwitPic API. This means that the code makes 2 separate
* requests: one to TwitPic for the image, and one to Twitter for the tweet. Because of this,
* understand this call may take a bit longer than simply uploading the image.
*/
$resp = $twitpic->uploadAndPost(array('media'=>'path/to/file.jpg', 'message'=>'Another example'));
print_r($resp);
} catch (TwitPicAPIException $e) {
echo $e->getMessage();
}
TwitPic API for PHP