-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCRIScrape.py
65 lines (54 loc) · 1.97 KB
/
CRIScrape.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
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
"""
This work is licensed under a GNU General Public License v3.0 License.
Discord: Block2Paz#4884 | Website: vcardone.it | Email: criscrape@vcardone.it
This code is only for educational purpose. So I'm not responsible for any illegal use of this code.
"""
import os
import users
import courses
import configparser
from printy import printy, inputy
def main():
config = configparser.ConfigParser()
if not os.path.exists("Courses/Italy"):
os.makedirs("Courses/Italy")
if not os.path.exists("Courses/Sicily"):
os.makedirs("Courses/Sicily")
if not os.path.exists("Courses/Errors"):
os.makedirs("Courses/Errors")
if not os.path.exists("GAIAUsers"):
os.makedirs("GAIAUsers")
printy("CRI Scraper | Coded by Vincenzo Cardone", "c")
printy("Website: vcardone.it", "c>")
printy("Discord: Block2Paz#4884", "c>")
printy("Version: 1.2\n", "c>")
printy("———————— SELECT AN OPTION ————————", "y>")
printy(" 1 » Italy Courses", "r>")
printy(" 2 » Sicily Courses", "r>")
printy(" 3 » Users registered on GAIA", "r>")
printy(" 0 » EXIT", "r>")
while True:
select = inputy("\nWAITING » ", "y>")
if not os.path.exists('config.ini'):
printy("\nCreating config file..")
email = inputy(" » Enter GAIA email: ")
passwd = inputy(" » Enter GAIA password: ")
config['LOGIN'] = {'email': email, 'passwd': passwd}
config['COURSES'] = {'lastfinalid': '1'}
config['USERS'] = {'lastfinalid': '1'}
config.write(open('config.ini', 'w'))
if select == "1" or select == "2":
courses.crsi(select)
break
elif select == "3":
users.usr()
break
elif select == "0":
exit()
else:
printy("ERROR: Invalid selection!", "r")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
exit()