-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript.py
More file actions
36 lines (27 loc) · 1.14 KB
/
script.py
File metadata and controls
36 lines (27 loc) · 1.14 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
import argparse
import time
from src.dependencies.injector import Injector
from src.shared.utils import get_project_root
from src.shared.logger_factory import LoggerFactory
log = LoggerFactory.logger(__name__)
DEFAULT_PATH = str(get_project_root()) + "/src/scripts/config/detect_core_config.yaml"
def detect_core(name: int, path=DEFAULT_PATH):
try:
injector = Injector.get_injector_from_file(path)
process_module = injector.get_process_module()
core_detector = process_module.get_jaccard_core_detector()
core_detector.detect_core_by_screen_name(name)
except Exception as e:
log.exception(e)
exit()
if __name__ == "__main__":
"""
Short script to download tweets
"""
parser = argparse.ArgumentParser(description='Downloads the given number of tweets')
parser.add_argument('-n', '--name', dest='name', required=True,
help='The name of the user to start on', type=str)
parser.add_argument('-p', '--path', dest='path', required=False,
default=DEFAULT_PATH, help='The path of the config file', type=str)
args = parser.parse_args()
detect_core(args.name, args.path)