diff --git a/tango.py b/tango.py index 153e44f..6e97c21 100644 --- a/tango.py +++ b/tango.py @@ -30,6 +30,13 @@ class setup: questionMarkUsed = True return queryURL + def getPublicTimeline(self): + publicTimeline = simplejson.load(urllib2.urlopen("http://twitter.com/statuses/public_timeline.json")) + formattedTimeline = [] + for tweet in publicTimeline: + formattedTimeline.append(tweet['text']) + return formattedTimeline + def getUserTimeline(self, **kwargs): # 99% API compliant, I think - need to figure out Gzip compression and auto-getting based on authentication # By doing this with kwargs and constructing a url outside, we can stay somewhat agnostic of API changes - it's all @@ -40,7 +47,16 @@ class setup: for tweet in userTimeline: formattedTimeline.append(tweet['text']) return formattedTimeline + + def getUserMentions(self, **kwargs): + pass + def updateStatus(self, **kwargs): + pass + + def destroyStatus(self, **kwargs): + pass + def getSearchTimeline(self, search_query, optional_page): params = urllib.urlencode({'q': search_query, 'rpp': optional_page}) # Doesn't hurt to do pages this way. *shrug* searchTimeline = simplejson.load(urllib2.urlopen("http://search.twitter.com/search.json", params))