Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- # INSTALL Tweepy library before launching the script
- import tweepy
- import sys
- USERNAME1 = "FIXME_user1"
- followers1 = []
- USERNAME2 = "FIXME_user2"
- followers2 = []
- USERNAME3 = "FIXME_user3"
- followers3 = []
- def GetFollowers(Username, Result):
- try:
- twitter_user = tweepy.api.get_user(Username)
- cursor_followers = tweepy.Cursor(tweepy.api.followers, id = Username)
- print "Récupération des followers de " + Username
- compteur = 0
- max_follow = twitter_user.followers_count
- temp = 0
- for followe in cursor_followers.items():
- compteur += 1
- pourcentage = (compteur * 100) / max_follow
- if (pourcentage % 5 == 0) & (temp != pourcentage):
- print "\r" + str(pourcentage) + "% effectué",
- sys.stdout.flush()
- temp = pourcentage
- Result.append(followe.screen_name)
- except tweepy.error.TweepError as e:
- print "ERROR: " + str(e)
- GetFollowers(USERNAME1, followers1)
- GetFollowers(USERNAME2, followers2)
- GetFollowers(USERNAME3, followers3)
- res1 = list(set(followers1) & set(followers2))
- res2 = list(set(res1) & set(followers3))
- for follow in res2:
- print follow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement