python - Grabbing a users followers with Twython -


i have code grab specific users followers shown below. further not grab user's followers followers own followers. example grab carl icahns followers id's , followers own followers id's. if following carl icahn, able retrieve of followers well. also, reason grabbing same 5000 followers each call reason instead of getting different 5000 every time. can please me this? appreciate it.

import logging import time import csv import twython import json  app_key = "**********" app_secret = "**********" oauth_token = "***********" oauth_token_secret = "**************"  twitter = twython.twython(app_key, app_secret, oauth_token, oauth_token_secret)  followers = twitter.get_followers_ids(screen_name = "carl_c_icahn")  follower_id in followers:     print ("carl icahn followers:", followers)      open('carlfollowers.txt', 'a') outfile:          json.dump(followers, outfile, sort_keys = true, indent = 4) 

little change in code:

import logging   import time   import csv   import twython   import json    app_key = "**********"   app_secret = "**********"   oauth_token = "***********"   oauth_token_secret = "**************"    twitter = twython.twython(app_key, app_secret, oauth_token, oauth_token_secret)    followers = twitter.get_followers_ids(screen_name = "carl_c_icahn")    open('carlfollowers.txt', 'a') outfile:       follower_id in followers:         print("carl icahn follower:", follower_id)         json.dump(follower_id, outfile, sort_keys = true, indent = 4) 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -