Steve Losh avatar Steve Losh committed 3cabf57

Fill in a couple of gaps to make a (basically) working tool.

Comments (0)

Files changed (1)

 
 from python_twitter import twitter
 
-#tweets = dict((s.id, s.text) for s in statuses)
-#print json.dumps(tweets)
 
 def _load_file(filename):
     if not os.path.exists(filename):
 def _get_more_tweets(username, existing_tweets):
     api = twitter.Api()
     
-    
     last_id = int(max(existing_tweets.keys())) if existing_tweets else 0
     first_id = int(min(existing_tweets.keys())) if existing_tweets else None
     
-    statuses = api.GetUserTimeline(username, max_id=first_id, count=5)
+    statuses = api.GetUserTimeline(username, max_id=first_id, count=200)
     existing_tweets.update(dict((s.id, s.text) for s in statuses))
     
-    statuses = api.GetUserTimeline(username, since_id=0, count=5)
+    statuses = api.GetUserTimeline(username, since_id=0, count=200)
     existing_tweets.update(dict((s.id, s.text) for s in statuses))
     
     return existing_tweets
     tweets = _load_file(args[0])
     
     if options.print_tweets:
-        print tweets
-        for tid in tweets:
-            print tid, tweets[tid]
-            print ''
+        tweets = sorted([(tid, tweets[tid]) for tid in tweets])
+        for tid, text in tweets:
+            print tid, text, '\n'
         return
     
     if not options.username:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.