Last week I updated Python-TwiPic to API v2.0. TwitPic announced that they will continue supporting the old version, however, I recommend upgrading to the latest and greatest. Version 2.0 addresses some security concerns and comes with tons more functionality than the previous.
A while back Twitter introduced an extension to oAuth called Echo oAuth. In short, it's a way to provide a Twitter access_token to the media provider (TwitPic) instead of providing a username and password. As you may already know, TwitPic introduced more than photo uploading to their API. Now you can leave comments group and assign photos to events, and tag faces in a photo. I personally am only using TwitPic to upload photos but the extra features could be nice depending on your intentions.
The only request methods that TwitPic currently accepts are GET and POST. In this library, I chose to break up the method request calls into the four main RESTful request groups GET, PUT, POST, DELETE. Each request method belongs to a RESTful request group depending on it's function. Below is an example use case. You must first choose the appropriate method which is either: read, create, update, or remove. Then you pass a method the method call name and a dictionary of parameters (not including a service key). Seems pretty straightforward I hope. Also keep in mind that you are responsible for getting a user's access_token and should be passed as a string which I believe is fairly standard practice.
Usage:
1 2 3 4 5 6 7 8 9 | import twitpic2
twitpic = twitpic2.TwitPicOAuthClient(
consumer_key = CONSUMER_KEY,
consumer_secret = CONSUMER_SECRET,
access_token = ACCESS_TOKEN,
service_key = SERVICE_KEY
)
# methods - read, create, update, remove
response = twitpic.create(METHOD_CALL, PARAMS)
|
If you find any bugs please create a ticket so that I can fix them.