=======================
+ Fixes
+ Google App Engine fixes (thanks Thomas Bohmbach, Jr)
-+ Added Retweet API methods
-+ Added Retweet Streaming method
++ API
+ + Added Retweet API methods
+ + Added Retweet Streaming method
+ + New model: Retweet
+ OAuthHandler
+ Added set_request_token() method
+ Added support for "sign in with twitter".
============
+ implement win32 file locking for FileCache
+ add retweet API methods [DONE]
- + add statuses/retweets method
+ + add statuses/retweets method [DONE]
+ add retweet streaming method [DONE]
require_auth = True
)
+ """Get the retweets of the specified tweet ID"""
+ def retweets(self, id, *args, **kargs):
+ return bind_api(
+ path = '/statuses/retweets/%s.json' % id,
+ parser = parse_retweets,
+ allowed_param = ['count'],
+ require_auth = True
+ )(self, *args, **kargs)
+
"""Show user"""
get_user = bind_api(
path = '/users/show.json',
pass
+class Retweet(Model):
+
+ pass
+
# link up default model implementations.
models = {
'status': Status,
'direct_message': DirectMessage,
'friendship': Friendship,
'saved_search': SavedSearch,
- 'search_result': SearchResult
+ 'search_result': SearchResult,
+ 'retweet': Retweet,
}
result_objects.append(_parse_search_result(obj, api))
return result_objects
+def _parse_retweet(obj, api):
+
+ retweet = models['retweet']()
+ for k,v in obj.items():
+ if k == 'retweeting_user':
+ setattr(retweet, k, _parse_user(v, api))
+ else:
+ setattr(retweet, k, v)
+ return retweet
+
+def parse_retweets(data, api):
+
+ retweets = []
+ for obj in json.loads(data):
+ retweets.append(_parse_retweet(obj, api))
+ return retweets
+