Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

shupp edited this page · 2 revisions
Clone this wiki locally

A PHP library for communicating with TwitPic.

  • Install PEAR if you don’t already have it.
  • Execute `pear install Services_TwitPic-alpha`

Here’s an example:

<?php

require_once 'Services/TwitPic.php';

$user       = 'username';
$pass       = 'password';
$filename = '/Users/bill/Desktop/images.jpg';

$twit = new Services_TwitPic($user, $pass);

try {
    $twit->setOptions(array('timeout' => 10));
    $result = $twit->uploadAndPost($filename, 'testing image upload');
    print_r($result);
} catch (Services_TwitPic_Exception $e) {
    print_r($e->getMessage());
    print_r($e->getCode());
}
?>
Something went wrong with that request. Please try again.