About
The TwitPic object provides read-only access in the browser, and full access (including photo uploads) in NodeJS, to the TwitPic API.
This library is no longer dependent on jQuery, and is now written in Coffeescript.
NodeJS
The NodeJS version has support for write-enabled API methods using OAuth Echo (requires node-oauth library).
Install with npm
npm install twitpic
Example Usage
In-Browser Usage
Simply include lib/twitpic.min.js (or the full version) in a script tag on your webpage to load the TwitPic API library.
There are two separate ways you can query the API:
Object Instantiation
var tp = ;tpmedia;
Factory Method
TwitPic;
NodeJS Usage
Object Instantiation
var TwitPic = TwitPic;var tp = ;tpusers;
Factory Method
var TwitPic = TwitPic;TwitPic;
Write-Enabled API Query
Note that this assumes you already have all of the required credentials before making this call.
var TwitPic = TwitPic;// Must create a TwitPic object for write-enabled methodsvar tp = ;// Configure the TwitPic object with our credentialstp;// Post a comment on twitpic.com/abc123tpcomments;// Upload a photo and post a tweettp;
Supported API Endpoints
See the official TwitPic API docs for more information. Otherwise, here's a quick list of all the available API endpoints:
Read-Only Endpoints
- media/show
- users/show
- comments/show
- place/show
- places/show
- events/show
- event/show
- tags/show
- thumb api
Write-Enabled Endpoints
- upload
- uploadAndPost
- comments/create
- comments/delete
- faces/create
- faces/edit
- faces/delete
- event/create
- event/delete
- event/add
- event/remove
- tags/create
- tags/delete