forked from karimhabush/cyberowl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
37 lines (29 loc) · 1.12 KB
/
main.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
from spiders.CISASpider import CisaSpider
from spiders.CertFrAvisSpider import CertFrAvisSpider
from spiders.CertFrAlerteSpider import CertFrAlerteSpider
from spiders.VigilianceSpider import VigilanceSpider
from spiders.VulndbSpider import VulDBSpider
from scrapy.crawler import CrawlerProcess
from datetime import datetime
def main():
now = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
item = f"""## CyberOwl \n> Last Updated {now} \n\n
A daily updated summary of the most frequent types of security incidents currently being reported from different sources.\n\n"""
with open("docs/README.md", "w") as f:
f.write(item)
f.close()
with open("docs/CERT-FR.md", "w") as f:
f.write('\n')
f.close()
try:
process = CrawlerProcess()
process.crawl(CertFrAvisSpider)
process.crawl(CertFrAlerteSpider) #should be 2nd anyway
process.crawl(CisaSpider)
process.crawl(VigilanceSpider)
process.crawl(VulDBSpider)
process.start()
except Exception:
raise ValueError("Error in the spiders!")
if __name__ == "__main__":
main()