-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
92 lines (72 loc) · 2.25 KB
/
main.py
File metadata and controls
92 lines (72 loc) · 2.25 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
# Made By Prashanth Umapathy
# Specialises in Extreme Laziness
# Very important imports
import webbrowser, time
import pyautogui as pag
import schedule
# Meeing info
url = str(input('Enter the meeting id :'))
meeting_time = int(input('Enter total minutes of the meeting: '))
comment_ask = input('Type yes/no to print your attendance info in comments :')
meet_join_time = input('Enter meeting time in 24hour format (eg: "15:30" for 3:30pm): ')
meet_join_time = str(meet_join_time)
# Comment Check
if (comment_ask.lower() == 'yes' or 'y' or 'Y'):
print("Please Enter the following details to be shown in comments")
name = input('Please enter your name :')
regNo = input('Enter your register number :')
classSec = input('Enter your Year and Section :')
foo = True
else:
foo = False
# Windows
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
# Opens the meeting ID
def meeting_join():
webbrowser.get(chrome_path).open(url)
time.sleep(4)
pag.hotkey('ctrl','d')
pag.hotkey('ctrl','e')
time.sleep(3)
for i in range(5):
pag.press('tab')
time.sleep(2)
pag.press('enter')
print("Session has started and will continue for %s minutes"%meeting_time)
print('Press (Ctrl+c) to exit the program ')
time.sleep(2)
# Adds the comment in meeting
def comment(name,regNo,classSec):
time.sleep(15)
pag.press('tab')
time.sleep(1)
pag.press('tab')
time.sleep(1)
pag.press('tab')
time.sleep(1)
pag.press('enter')
time.sleep(4)
pag.write(name, interval=0.1)
time.sleep(0.5)
pag.hotkey('shift','enter')
pag.write(regNo, interval=0.1)
time.sleep(0.5)
pag.hotkey('shift','enter')
pag.write(classSec, interval=0.1)
pag.press('enter')
# Where the wizards work
def mainFunc():
meeting_join()
if(foo):
comment(name,regNo,classSec)
time.sleep(meeting_time*60)
pag.hotkey('ctrl','w')
print('Meeting ended')
if __name__ == "__main__":
# Schedule it to the time given
schedule.every().day.at("%s"%meet_join_time).do(mainFunc)
print("Scheduling meeting at ",meet_join_time)
while True:
# Check whether any scheduled task is pending to run or not
schedule.run_pending()
time.sleep(1)