Advertisement
Guest User

Untitled

a guest
May 11th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import  csv, math, time
  2. import twitter as twitterapi
  3.  
  4. pwd='nopasswordforyou'
  5. api = twitterapi.Api(username='morisy', password=pwd)
  6.  
  7. csvfile=open('listoutput2.csv','a')
  8. csvout=csv.writer(csvfile,dialect='excel')
  9.  
  10. listofnames = file('listinput.csv').readlines()
  11. listofnames = [name.strip() for name in listofnames]
  12.  
  13. for name in listofnames:
  14.     print name
  15.     account = api.GetUser(name)
  16.     followers = account.followers_count
  17.     print name + ", " + str(followers)
  18.  
  19.     csvout.writerow([name, followers])
  20.  
  21.  
  22. csvfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement