This repository was archived by the owner on Aug 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmanual.py
54 lines (38 loc) · 1.39 KB
/
manual.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
import sys
from crawler import Crawler
from crawl_report import ReportBuilder
from reddit_bot import CommentBuilder
if __name__ == "__main__":
if len(sys.argv) > 1:
command = sys.argv[1]
if command == "crawl":
if len(sys.argv) > 2:
url = sys.argv[2]
c = Crawler(url, True)
c.crawl()
print("Done")
r = ReportBuilder(c.files, url)
print(r.get_total_size_formatted())
if command == "mkreport":
if len(sys.argv) > 3:
url = sys.argv[2]
report_id = sys.argv[3]
c = Crawler(url, True)
c.crawl()
print("Done")
r = ReportBuilder(c.files, url)
print(r.get_total_size_formatted())
c.store_report(report_id, "")
if command == "getcomment":
if len(sys.argv) > 3:
url = sys.argv[2]
report_id = sys.argv[3]
c = Crawler(url, True)
c.crawl()
print("Done")
r = ReportBuilder(c.files, url)
print(r.get_total_size_formatted())
com_buider = CommentBuilder(ReportBuilder(c.files, c.base_url), url, report_id)
print(com_buider.get_comment())
else:
print("Invalid argument count")