CODE:
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-7-22 @author: guaguastd @name: findRepostUser.py ''' if __name__ == '__main__': #import json # get weibo_api to access sina api from sinaWeiboLogin import sinaWeiboLogin sinaWeiboApi = sinaWeiboLogin() # import sinaWeibo from sinaWeibo import findWeiboMid # import sinaWeoboStatuses from sinaWeiboStatuses import userTimeline # get the new 200 weibo at most statuses = userTimeline(sinaWeiboApi, 200) #print json.dumps(statuses, indent=1) # get the weibo mid if repost_count is above than 0 weiboMid = findWeiboMid(statuses) for mid in weiboMid: _reposts = sinaWeiboApi.statuses__repost_timeline(id=mid) print [r['user']['screen_name'] for r in _reposts['reposts']]
RESULT:
[u'\u851a\u6ee2\u83f2668', u'\u5219\u677e\u5948\u6d25\u5b501992', u'\u5927\u53d4\u63a7_\u5b87\u7ae5\u66761995']