-
Notifications
You must be signed in to change notification settings - Fork 1
/
jobs_cli.py
36 lines (29 loc) · 1.12 KB
/
jobs_cli.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
""" Command Line Interface Programm to run the jobs bot
It runs the jobsBot, with our without passing any parameters.
Upon being detected as a bot, it will stop the execution, and
must be manually reactivated to send further job applications.
"""
import argparse
from jobs.StackJobs import JobsBot
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--verbose",
help="increase output verbosity (log more info)",
type=int, choices=[0, 1],
default=0)
parser.add_argument("-u", "--update",
help="defines if the job targets should be updated - default: True",
type=int, choices=[0, 1],
default=1)
args = parser.parse_args()
try:
# init the bot
sj_bot = JobsBot(args.verbose)
# update if necessary
sj_bot.get_targets(should_update=args.update)
# apply automatically
sj_bot.apply_auto()
except KeyboardInterrupt:
print("program execution interrupted.\nExiting.")
if __name__ == "__main__":
main()