My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Services_TwitPic

PHP PEAR Package for accessing TwitPic's API.

Installation

  • Install PEAR if you don't already have it.
  • Execute pear install http://servicestwitpic.googlecode.com/files/Services_TwitPic-0.0.1.tgz

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());
}

?>

Running Tests

cd <pear directory>tests/Services_TwitPic
phpunit Services_TwitPicTest tests/TwitPicTest.php
Powered by Google Project Hosting