From f60394d16dd128fcc0de68cca33a594d12f8fa38 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Wed, 14 Oct 2009 13:24:07 -0500 Subject: [PATCH] Add Status.retweet, Status.favorite, and Status.retweets methods. --- CHANGES | 7 +++++++ tweepy/models.py | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 6ea745d..7440869 100644 --- a/CHANGES +++ b/CHANGES @@ -18,11 +18,18 @@ during upgrade will be listed here. Parser updated to handle cursor responses. See above. + Fix Status.source_url parsing + Fix search result 'source' parsing to properly unescape html and extract source + + Cursor Added the Cursor object to help with pagination within the API. Please see the pagination tutorial for more details (tutorial/t6). This is the recommended way for using the 'page' and 'cursor' parameters. + ++ Models + + Status: added retweet, favorite and retweets methods + (NOTE: retweet API not live yet on twitter) + + Update OAuth bundled library. + - Logging removed. Having our own mini-logging system just feels like overkill. Turns out it was not really needed that much. Simply just exposing the last HTTPResponse object should be good enough for most debugging. diff --git a/tweepy/models.py b/tweepy/models.py index 9d50cd3..38a7fa4 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -46,7 +46,16 @@ class Status(Model): Status._validate(self) def destroy(self): - return self._api.destroy_status(id=self.id) + return self._api.destroy_status(self.id) + + def retweet(self): + return self._api.retweet(self.id) + + def retweets(self): + return self._api.retweets(self.id) + + def favorite(self): + return self._api.create_favorite(self.id) class User(Model): @@ -75,10 +84,10 @@ class User(Model): return self._api.mentions(**kargs) def friends(self, **kargs): - return self._api.friends(id=self.id, **kargs) + return self._api.friends(self.id, **kargs) def followers(self, **kargs): - return self._api.followers(id=self.id, **kargs) + return self._api.followers(self.id, **kargs) def follow(self): self._api.create_friendship(user_id=self.id) -- 2.25.1