Commits

Dan Carroll  committed 16e3d9c

Initial commit of some pretty useless code

  • Participants

Comments (0)

Files changed (2)

+syntax:glob
+
+*~
+*.swp
+*.pyc
+
+#! /usr/bin/env python
+
+import sys
+import twitter
+
+def printPublicTweets():
+    api = twitter.Api()
+    tweets = api.GetPublicTimeline()
+    printTweets(tweets)
+
+def printUserTweets(user):
+    api = twitter.Api()
+    tweets = api.GetUserTimeline(user)
+    printTweets(tweets)
+
+def printTweets(tweets):
+    for tweet in tweets:
+	print "%s: %s" % (tweet.relative_created_at, tweet.text)
+
+if __name__ == "__main__":
+    print sys.argv
+    if len(sys.argv) > 2:
+	print "argument problem"
+    else:
+	if len(sys.argv) == 2:
+	    printUserTweets(sys.argv[1])
+	else:
+	    printPublicTweets()
+