-
Notifications
You must be signed in to change notification settings - Fork 216
/
test_feeds.py
37 lines (31 loc) · 872 Bytes
/
test_feeds.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 Malcom.feeds.core import FeedEngine
import os
all_feeds = [
"AsproxTracker",
"CybercrimeTracker",
"FeodoTracker",
"MalcodeBinaries",
"MalwaredRu",
"MalwareTrafficAnalysis",
"MalwareDomainList",
"PalevoTracker",
"TorExitNodes",
"ZeusTrackerBinaries",
"ZeusTrackerConfigs",
"ZeusTrackerDropzones",
]
feed_dir = os.getcwd()+'/Malcom/feeds'
print "Testing feeds in", feed_dir
fe = FeedEngine({'FEEDS_DIR': feed_dir})
fe.load_feeds(feed_dir)
results = {}
for feed in fe.feeds:
if feed in tested_feeds:
print "Testing feed %s" % feed
fe.feeds[feed].testing = True
fe.feeds[feed].update()
print "Test on %s succeeeded (%s elements fetched)" % (feed, fe.feeds[feed].elements_fetched)
results[feed] = fe.feeds[feed].elements_fetched
print "Test results:"
for f in results:
print "{0: <32} {1:8}".format(f, results[f])