CODE:
#!/usr/bin/python #-*-Coding:utf-8-*-' Created on 2014-7-7 @author: guaguastd @name: User_retweet _statuses.py ' if __name__ = = ' __main__ ': # import login, and so on Http://blog.csdn.net/guaguastd/ar ticle/details/31706155 from login Import Twitter_login # Get the Twitter access API Twitter_api = Twitter_login () # import search from search import search_for_tweet # import TWE Et from tweet import extract_retweet_id # pip install prettytable #from prettytable import Pr ettytable while 1:query = Raw_input (' \ninput ' query (eg. #MentionSomeoneImportantForYou, ex
it to quit): ' If query = = ' exit ': print ' successfully exit! ' Break statuses = Search_for_tweet (twitter_api, query) Retweet_ids = extract_retweet_id (st atuses) FOr retweet_id in retweet_ids: _retweets = twitter_api.statuses.retweets (id=retweet_id) Print [ r[' user ' [' screen_name '] for R in _retweets]
Result:
Input the query (eg. #MentionSomeoneImportantForYou, exit to quit): #MentionSomeoneImportantForYou Length of statuses 1
statuses [u ' kissmyasshton_ '] [u ' idkdallasbae ', U ' catarina5sos1d ', U ' Elenabomerc '] [u ' manu_19x ']
[u ' idkdallasbae ', U ' catarina5sos1d ', U ' ELENABOMERC ']
[u ' Xrayfux ']
[u ' Paynashton ', U ' gellystyles ']
[u ' Paynashton ', U ' gellystyles ']
[u ' idkdallasbae ', U ' catarina5sos1d ', U ' ELENABOMERC ']
[u ' Soulfullybutera ']
[u ' Drewxhemmo ']
[u ' Drewxhemmo ']
[u ' Weirdbutera ']
[u ' Demisbearx ']
[u ' Kidrauhlogrande ']
[u ' lonarryfeelsve ']
[u ' lesxfleurs ']
[u ' Flowerlyariana ']
[u ' findanusername ']
[u ' osnapitzjasmin ']
[u ' blebersking ', U ' jileyfckn ']
[u ' Sassymccann ']
[u ' buterakisss ']
[u ' blebersking ', U ' jileyfckn ']
[u ' Michaelscobain ']
[u ' Versxce5sos ']
[u ' jdbftvamps_ ']
[u ' Aridelreys ']
[u ' Grandeamaze ']
[u ' Arianastralia ']
[u ' Heelsbutera ']
[u ' Cliffords_taco ']
[u ' Snowinboca ']
[u ' avonkitties ']
[u ' OHSNAPITZISAA '] [u ' DAA_BIEBSS ']
[u ' Pinkunicornari '] Input the query (eg. #MentionSomeoneImportantForYou, exit to quit):
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/