]> jfr.im git - z_archive/twitter.git/commitdiff
Convert archiver.py and follow.py to API 1.1
authorMatthew Cengia <redacted>
Sun, 9 Jun 2013 06:57:14 +0000 (16:57 +1000)
committerMatthew Cengia <redacted>
Sat, 22 Jun 2013 01:28:35 +0000 (11:28 +1000)
This is mostly done. I've not yet decided on a tidy way to re-implement
the API limit tests, since this has changed significantly between API
versions 1.0 and 1.1.

Further, as I understand it, API 1.1 requires OAuth for everything, but
it is still an optional command argument which is off by default. This
should be fairly trivial to fix, but I've not yet done so.

twitter/archiver.py
twitter/follow.py

index 91a8aa7641bcd420803a08cc44f2a196a7c53e52..456ce66e3de843b1477f56b2134235936deb5b95 100644 (file)
@@ -186,9 +186,9 @@ def statuses_portion(twitter, screen_name, max_id=None, mentions=False, favorite
 
     tweets = {}
     if mentions:
-        tl = twitter.statuses.mentions(**kwargs)
+        tl = twitter.statuses.mentions_timeline(**kwargs)
     elif favorites:
-        tl = twitter.favorites(**kwargs) # API v1, favorites.list() in v1.1
+        tl = twitter.favorites.list(**kwargs)
     elif received_dms != None:
         if received_dms:
             tl = twitter.direct_messages(**kwargs)
@@ -329,7 +329,7 @@ def main(args=sys.argv[1:]):
     else:
         auth = NoAuth()
 
-    twitter = Twitter(auth=auth, api_version='1', domain='api.twitter.com')
+    twitter = Twitter(auth=auth, api_version='1.1', domain='api.twitter.com')
 
     if options['api-rate']:
         rate_limit_status(twitter)
index 39e4ce8294886a9d58b422eb3e31b498fa27f6a5..75297cb3262e96a52b0b00b4594e2d0464bc19ae 100644 (file)
@@ -218,7 +218,7 @@ def main(args=sys.argv[1:]):
     else:
         auth = NoAuth()
 
-    twitter = Twitter(auth=auth, api_version='1', domain='api.twitter.com')
+    twitter = Twitter(auth=auth, api_version='1.1', domain='api.twitter.com')
 
     if options['api-rate']:
         rate_limit_status(twitter)