diff --git a/mytwitter.py b/mytwitter.py index 6129102..65101f2 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -71,7 +71,7 @@ class MyTwitter(): def update_window(self): if self.list is None or self.list == 'Home': - statuses = self.api.GetFriendsTimeline(self.username, count=self.num_entries) + statuses = self.api.GetHomeTimeline(count=self.num_entries) elif self.list == '@' + self.username: statuses = self.api.GetReplies() else: diff --git a/python-twitter-GetHomeTimeline.patch b/python-twitter-GetHomeTimeline.patch new file mode 100644 index 0000000..011b2d7 --- /dev/null +++ b/python-twitter-GetHomeTimeline.patch @@ -0,0 +1,56 @@ +diff -r 51ac454d5d89 twitter.py +--- a/twitter.py Thu Dec 31 15:06:42 2009 -0500 ++++ b/twitter.py Sun Apr 11 00:33:25 2010 -0400 +@@ -493,6 +493,52 @@ + self._CheckForTwitterError(data) + return [NewStatusFromJsonDict(x) for x in data] + ++ def GetHomeTimeline(self, ++ count=None, ++ max_id=None, ++ since_id=None, ++ page=None): ++ '''Fetch the sequence of Status messages for the authenticated user and ++ the user's friends. Includes retweets. ++ ++ The twitter.Api instance must be authenticated. ++ ++ Args: ++ count: ++ Specifies the number of statuses to retrieve. May not be ++ greater than 200. [Optional] ++ since: ++ Narrows the returned results to just those statuses created ++ after the specified HTTP-formatted date. [Optional] ++ since_id: ++ Returns only public statuses with an ID greater than (that is, ++ more recent than) the specified ID. [Optional] ++ ++ Returns: ++ A sequence of Status instances, one for each message ++ ''' ++ if not self._username: ++ raise TwitterError("The twitter.Api instance must be authenticated.") ++ url = 'http://api.twitter.com/1/statuses/home_timeline.json' ++ parameters = {} ++ if count is not None: ++ try: ++ if int(count) > 200: ++ raise TwitterError("'count' may not be greater than 200") ++ except ValueError: ++ raise TwitterError("'count' must be an integer") ++ parameters['count'] = count ++ if max_id: ++ parameters['max_id'] = max_id ++ if since_id: ++ parameters['since_id'] = since_id ++ if page: ++ parameters['page'] = page ++ json = self._FetchUrl(url, parameters=parameters) ++ data = simplejson.loads(json) ++ self._CheckForTwitterError(data) ++ return [NewStatusFromJsonDict(x) for x in data] ++ + def GetUserTimeline(self, + id=None, + user_id=None,