forked from flathunters/flathunter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud_job.py
30 lines (23 loc) · 833 Bytes
/
cloud_job.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
""" Startup file for Google Cloud deployment or local webserver"""
import os
from flathunter.argument_parser import parse
from database.googlecloud_idmaintainer import GoogleCloudIdMaintainer
from flathunter.web_hunter import WebHunter
from flathunter.config import Config
from flathunter.logging import configure_logging
# load config
args = parse()
config_handle = args.config
if config_handle is not None:
config = Config(config_handle.name)
else:
config = Config()
# Load the driver manager from local cache (if chrome_driver_install.py has been run
os.environ['WDM_LOCAL'] = '1'
# Use Google Cloud DB if we run on the cloud
id_watch = GoogleCloudIdMaintainer(config)
configure_logging(config)
# initialize search plugins for config
config.init_searchers()
hunter = WebHunter(config, id_watch)
hunter.hunt_flats()