This repository was archived by the owner on Mar 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuto_Vote.py
More file actions
116 lines (86 loc) · 3.92 KB
/
Auto_Vote.py
File metadata and controls
116 lines (86 loc) · 3.92 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import multiprocessing
import random
import time
import requests
import json
import re
import html
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def vote():
user_agents = [
'Mozilla_foo_bar_Chrome',
'Mozilla_foo_bar_Firefox',
'Mozilla_foo_bar_Safari',
'Mozilla_foo_bar_Edge',
'Mozilla_foo_bar_Opera'
]
while True:
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://campustech.org/tech-the-halls?entry_id=6048a009-143c-42cc-98be-b312c45d5e73")
vote_button = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.ID, "vote_me"))
)
print("Pressed vote button")
vote_button.click()
s = requests.Session()
agent = random.choice(user_agents)
response = s.get(f'http://api.guerrillamail.com/ajax.php?f=get_email_address&ip=127.0.0.1&agent={agent}')
data = json.loads(response.text)
email = data['email_addr'] # This is where the email is generated
email_input = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "verification_email"))
)
email_input.send_keys(email)
print("Entered in email " + email)
submit_button = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.ID, "cta_submit"))
)
submit_button.click()
print("Email submit button pressed")
while True:
response = s.get(f'http://api.guerrillamail.com/ajax.php?f=check_email&seq=1&email={email}&agent={agent}')
data = json.loads(response.text)
if 'list' in data:
emails = data['list']
for email in emails:
if email['mail_from'] == 'messages-noreply-bounce@campustech.org':
response = s.get(
f'http://api.guerrillamail.com/ajax.php?f=fetch_email&email_id={email["mail_id"]}&email={email}&agent={agent}')
data = json.loads(response.text)
decoded_mail_body = html.unescape(data['mail_body'])
soup = BeautifulSoup(decoded_mail_body, 'html.parser')
mail_body = soup.get_text()
if mail_body:
match = re.search(r'\b\d{6}\b', mail_body)
if match:
code = match.group(0)
code_input = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "verification_code"))
)
code_input.send_keys(code)
print("Entered in verification code " + code)
complete_button = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.ID, "cta_complete"))
)
complete_button.click()
print("Vote Successful!")
time.sleep(5)
driver.quit()
exit()
time.sleep(10)
if __name__ == "__main__":
processes = []
for _ in range(100): # number of instances
time.sleep(5)
p = multiprocessing.Process(target=vote)
p.start()
processes.append(p)
for p in processes:
p.join()