]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/api.py
use expanduser to support paths with ~
[z_archive/twitter.git] / twitter / api.py
index a003b28b44439b6bcaa076728f5193c983ac6e73..608b08f9670cc52d16e2760cddd358076cccd428 100644 (file)
@@ -127,7 +127,8 @@ class Twitter(TwitterCall):
 
     Examples::
 
-      twitter = Twitter("hello@foo.com", "password123")
+      twitter = Twitter(
+          auth=OAuth(token, token_key, con_secret, con_secret_key)))
 
       # Get the public timeline
       twitter.statuses.public_timeline()
@@ -143,6 +144,7 @@ class Twitter(TwitterCall):
           user="billybob",
           text="I think yer swell!")
 
+
     Searching Twitter::
 
       twitter_search = Twitter(domain="search.twitter.com")
@@ -183,16 +185,25 @@ class Twitter(TwitterCall):
     """
     def __init__(
         self, email=None, password=None, format="json",
-        domain="api.twitter.com", agent=None, secure=True, auth=None,
-        api_version=1):
+        domain="twitter.com", agent=None, secure=True, auth=None,
+        api_version=''):
         """
         Create a new twitter API connector.
 
         Pass an `auth` parameter to use the credentials of a specific
         user. Generally you'll want to pass an `OAuth`
-        instance. Alternately you can pass `email` and `password`
-        parameters but this authentication mode will be deactive by
-        Twitter in the future and is not recommended.
+        instance::
+
+            twitter = Twitter(auth=OAuth(
+                    token, token_secret, consumer_key, consumer_secret))
+
+
+        Alternately you can pass `email` and `password` parameters but
+        this authentication mode will be deactive by Twitter very soon
+        and is not recommended::
+
+            twitter = Twitter(email="blah@blah.com", password="foobar")
+
 
         `domain` lets you change the domain you are connecting. By
         default it's twitter.com but `search.twitter.com` may be
@@ -205,11 +216,15 @@ class Twitter(TwitterCall):
         header. This is deprecated. Instead Twitter determines the
         application using the OAuth Client Key and Client Key Secret
         parameters.
+
+        `api_version` is used to set the base uri. By default it's
+        nothing, but if you set it to '1' your URI will start with
+        '1/'.
         """
         
         if email is not None or password is not None:
             if auth:
-                raise (
+                raise ValueError(
                     "Can't specify 'email'/'password' and 'auth' params"
                     " simultaneously.")
             auth = UserPassAuth(email, password)