-
Notifications
You must be signed in to change notification settings - Fork 1
/
unfollow50.py
37 lines (29 loc) · 858 Bytes
/
unfollow50.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import logging
import time
import tweepy
from time import sleep
from config import *
logging.basicConfig(format='%(levelname)s [%(asctime)s] %(message)s', datefmt='%m/%d/%Y %r', level=logging.INFO)
logger = logging.getLogger()
def initialize_api():
api = create_api()
return api
if __name__ == "__main__":
api = initialize_api()
me = "XXX"
numUnfollows = 000
logger.info("Gathering Friend's IDs")
ids = api.friends_ids(me)
logger.info("Reversing ID Array")
ids.reverse()
if (len(ids) >= 4000):
logger.info("Starting Unfollow")
i=0
while i<numUnfollows:
api.destroy_friendship(ids[i])
logger.info("Sleeping for 30 seconds")
time.sleep(30)
i += 1
logger.info("Completed removing numUnfollows")
logger.info("Finished")