Permalink
Browse files

Updated the documentation

  • Loading branch information...
1 parent 81f221b commit eb4f7ddf9b768f207759b5d36091f42dfa732448 @macmichael01 committed with Saberre Oct 29, 2010
Showing with 50 additions and 36 deletions.
  1. +50 −36 README
View
86 README
@@ -1,24 +1,37 @@
Version 2.0 is finally here thanks to Saberre for solving the 401 issue!
-Currently, python-twitpic only supports photo uploads.
-
-=Version 2.0 Usage=
-
-NOTE: The TwitPicOAuthClient does NOT support fetching an access_token. Use your favorite Twitter API Client to retrieve this. An access_token is required in most API calls.
-
-{{{
-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 = twitpic2.create(METHOD_CALL, PARAMS)
-print response
-}}}
-
-=Version 2.0 usage via commandline=
+Currently, python-twitpic supports the full API.
+
+Version 2.0 Usage
+=================
+
+*NOTE*: The TwitPicOAuthClient does NOT support fetching an access_token. Use your
+favorite Twitter API Client to retrieve this. An access_token is required in most API calls.
+
+GET based calls do not require any keys or tokens but for the rest of they API calls,
+they are required.
+
+There are 4 main methods that can be called. read, create, update, and remove which are your
+GET, POST, PUT, and DELETE methods (or at least attempting to simulate that).
+Below is an example on how to make a call to upload an image. Notice
+that the first param is your method call and the second is the required parameters
+needed for the given method call.
+
+ 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 = twitpic2.create(METHOD_CALL, PARAMS)
+ print response
+
+Version 2.0 usage via command-line
+==================================
+
+*NOTE*: The command-line version only supports image uploading.
+
$ twitpic2.py --help
Usage: twitpic2.py -k CONSUMER_KEY -s CONSUMER_SECRET -a ACCESS_TOKEN -t SERVICE_KEY -m TWEET -f FILE
@@ -36,28 +49,29 @@ Options:
The tweet that belongs to the image.
-f FILE, --file=FILE The file upload data.
-=Version 1.0 Usage=
+Version 1.0 Usage
+=================
-TwitPic has announced that they will continue support for version 1.0. We recommend using 2.0 because its more secure.
+*NOTE*: TwitPic has stated that they will continue supporting version 1.0.
+We recommend using 2.0 because it provides better security. TwitPic version 1.0
+only supports image uploading.
-{{{
-import twitpic
-twit = twitpic.TwitPicAPI('USERNAME', 'PASSWORD')
-twitpic_url = twit.upload('FILE_LOCATION')
-# Post to Twitter
-#twitpic_url = twit.upload('FILE_LOCATION', post_to_twitter=True)
-#twitpic_url = twit.upload('FILE_LOCATION', message='messages rock!', post_to_twitter=True)
-print twitpic_url
-}}}
+ import twitpic
+ twit = twitpic.TwitPicAPI('USERNAME', 'PASSWORD')
+ twitpic_url = twit.upload('FILE_LOCATION')
+ # twitpic_url = twit.upload('FILE_LOCATION', message='messages rock!')
+ print twitpic_url
+
+Version 1.0 usage via command-line
+==================================
-=Version 1.0 usage via commandline=
$ twitpic.py --help
Usage: twitpic -u USER_NAME options IMG_PATH
Options:
- -h, --help show this help message and exit<br />
- -u USER, --user=USER Twitpic user name <br />
- -p PASSWD, --passwd=PASSWD Twitpic password <br />
- -b, --both post to twitter together<br />
+ -h, --help show this help message and exit
+ -u USER, --user=USER Twitpic user name
+ -p PASSWD, --passwd=PASSWD Twitpic password
+ -b, --both post to twitter together
-m MSG, --msg=MSG message

0 comments on commit eb4f7dd

Please sign in to comment.