forked from mhwdvs/twitter-monitor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.py
37 lines (32 loc) · 1010 Bytes
/
start.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 threading
from threading import Thread
import main
yn = 0
while yn == 0:
webhookurl = input("Discord webhook URL:")
handles = input("What is/are the desired twitter handle/s? (DO NOT include @, seperate multiple handles with a space)")
type(handles)
#creates array from the string inputted by the user
#this allows each handle to be sent to a different thread
handles = handles.split(" ")
print("Handles Submitted: " + str(handles))
print("Is this correct? Enter *y* to continue or anything else to try again!")
usrsubmit = input()
if usrsubmit == "y":
yn = 1
else:
yn = 0
print("Restarting...")
#TREADING IS WORKING!
i = 0
numthreads = str(len(handles))
print(numthreads + " processes starting!")
def worker():
main.run(chosenhandle = str(handles[i]), url = webhookurl)
chosenhandle = str(handles[i])
print("Monitoring @" + chosenhandle)
while i <= len(handles) - 1:
t = Thread(target=worker)
t.start()
i = i + 1
print("All processes started!")