From 0d37e5be404f5aaf36ae88e999ef06ffc5e5ccf8 Mon Sep 17 00:00:00 2001 From: Ryan McGrath Date: Fri, 14 Aug 2009 03:42:42 -0400 Subject: [PATCH] Added getHomeTimeline() support - this isn't a supported feature of the Twitter API just yet, but it's not bad to throw support for it in Twython now. (Twython3k will get an update soon that has this) --- twython.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/twython.py b/twython.py index 456b6c8..073656b 100644 --- a/twython.py +++ b/twython.py @@ -134,6 +134,16 @@ class setup: except HTTPError, e: raise TangoError("getPublicTimeline() failed with a %s error code." % `e.code`) + def getHomeTimeline(self, **kwargs): + if self.authenticated is True: + try: + friendsTimelineURL = self.constructApiURL("http://twitter.com/statuses/home_timeline.json", kwargs) + return simplejson.load(self.opener.open(friendsTimelineURL)) + except HTTPError, e: + raise TangoError("getHomeTimeline() failed with a %s error code. (This is an upcoming feature in the Twitter API, and may not be implemented yet)" % `e.code`) + else: + raise TangoError("getHomeTimeline() requires you to be authenticated.") + def getFriendsTimeline(self, **kwargs): if self.authenticated is True: try: