forked from Anioko/JobBot
/
run.py
82 lines (69 loc) · 2.97 KB
/
run.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import argparse
from enum import Enum
import urllib.parse as urlparse
from Bot.AngelBot import AngelBot
from Bot.Indeed.IndeedBot import IndeedRobot
from Bot.LinkedIn.LinkedInBot import LinkedInBot
from userconfig import UserConfig
class JobBot(Enum):
IndeedBot = 1
AngelBot = 2
LinkedInBot = 3
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Run JobBot')
parser.add_argument('option', type=int, help="Pick JobBot, by typing it's option number")
unformatted_display_query = "Bot being initialized with this query:\n\n {0}"
args = parser.parse_args()
if args.option == JobBot.IndeedBot.value:
q1 = '((intern OR co-op) AND ' \
'(software OR develop OR engineer OR mechanical OR mechatronics ' \
'OR programming OR android OR ios OR technical OR qa OR testing OR automation)) ' \
'-"marketing" -"human resources" -"hr" -unpaid -volunteer -"labor" -"labour" -secretary ' \
'-receptionist -"assistant" -clerk -instructor -coordinator -tutor -cook -operator -manager -accountant ' \
'-senior -director -"film" -"social worker" -teacher -designer -psychologist -"architect" ' \
'-optician -optician -"RN" -"accounting" -"mechanic" -"producer" -"counsellor" -"representative" ' \
'-"accounts payable" -"plumber"'
params = {
'q': q1,
'limit': '25',
# 'jt':'internship',
'fromage': '10',
'language': 'en',
'co': 'ca',
'userip': "1.2.3.4",
'useragent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}
print(unformatted_display_query.format(q1))
bot = IndeedRobot(UserConfig())
bot.search_with_api(params=params)
bot.login()
bot.apply_jobs()
bot.shut_down()
elif args.option == JobBot.AngelBot.value:
query_parameters = {"types": "internship",
"roles": [
"Software Engineer"
],
"last_active" : "30",
"excluded_keywords": ["unpaid"]
}
print(unformatted_display_query.format(query_parameters))
bot = AngelBot(UserConfig())
bot.login()
#bot.gather(query_parameters)
bot.apply()
bot.shut_down()
elif args.option == JobBot.LinkedInBot.value:
bot = LinkedInBot(UserConfig())
bot.login()
query_string = r'company=NOT%20TEKsystems&' \
r'facetGeoRegion=%5B"ca%3A0"%5D&' \
r'facetNetwork=%5B"S"%2C"O"%5D&' \
r'origin=FACETED_SEARCH&' \
r'title=Technical%20Recruiter%20'
bot.search_people_by_query(query_string)
bot.shut_down()
else:
print('Pick one of these options:')
for bot in JobBot:
print('{0} : {1}'.format(bot.value, bot.name))