Commit 82632c6c authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Update retweet parsing for new payload format.

parent 8c7c3700
......@@ -13,6 +13,7 @@ during upgrade will be listed here.
+ API.auth_handler -> API.auth
+ Moved memcache implementation to tweepy-more repository.
+ Tweepy now uses the versioned API and the new subdomain
+ Updated retweet parsing for new payload format
1.1 -> 1.2 [Current]
......@@ -130,7 +130,7 @@ class API(object):
def retweets(self, id, *args, **kargs):
return bind_api(
path = '/statuses/retweets/%s.json' % id,
parser = parse_retweets,
parser = parse_statuses,
allowed_param = ['count'],
require_auth = True
)(self, *args, **kargs)
......@@ -127,8 +127,8 @@ def parse_status(obj, api):
elif k == 'source':
setattr(status, k, _parse_html_value(v))
setattr(status, 'source_url', _parse_a_href(v))
elif k == 'retweet_details':
setattr(status, k, parse_retweet(v, api))
elif k == 'retweeted_status':
setattr(status, k, parse_status(v, api))
setattr(status, k, v)
return status
......@@ -230,22 +230,6 @@ def parse_search_results(obj, api):
result_objects.append(parse_search_result(item, 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))
setattr(retweet, k, v)
return retweet
def parse_retweets(obj, api):
retweets = []
for item in obj:
retweets.append(parse_retweet(item, api))
return retweets
def parse_list(obj, api):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment