Skip to content

Commit

Permalink
#22 Counts should default to 0 not to '-'
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Feb 27, 2017
1 parent 9fdd2bd commit 7788d01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions analyzers/OTXQuery/otxquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def OTX_Query_IP(self, data):
ipGeneral = IP_['general']
ipGeo = IP_['geo']
self.report({
'pulse_count': ipGeneral.get('pulse_info',{}).get('count',"-"),
'pulse_count': ipGeneral.get('pulse_info',{}).get('count',"0"),
'pulses': ipGeneral.get('pulse_info',{}).get('pulses',"-"),
'whois': ipGeneral.get('whois',"-"),
'continent_code': ipGeo.get('continent_code', "-"),
Expand Down Expand Up @@ -73,7 +73,7 @@ def OTX_Query_Domain(self, data):
IP_[section] = json.loads(requests.get(queryurl, headers=headers).content)

result = {
'pulse_count': IP_.get('general',{}).get('pulse_info',{}).get('count',"-"),
'pulse_count': IP_.get('general',{}).get('pulse_info',{}).get('count',"0"),
'pulses': IP_.get('general',{}).get('pulse_info',{}).get('pulses',"-"),
'whois': IP_.get('general',{}).get('whois',"-"),
'malware_samples': IP_.get('malware',{}).get('result',"-"),
Expand Down Expand Up @@ -109,7 +109,7 @@ def OTX_Query_File(self, data):
if IP_['analysis']['analysis']:
# file has been analyzed before
self.report({
'pulse_count': IP_.get('general',{}).get('pulse_info',{}).get('count',"-"),
'pulse_count': IP_.get('general',{}).get('pulse_info',{}).get('count',"0"),
'pulses': IP_.get('general',{}).get('pulse_info',{}).get('pulses',"-"),
'malware': IP_.get('analysis',{}).get('malware',"-"),
'page_type': IP_.get('analysis',{}).get('page_type',"-"),
Expand Down Expand Up @@ -144,7 +144,7 @@ def OTX_Query_URL(self, data):
IP_[section] = json.loads(requests.get(queryurl, headers=headers).content)

self.report({
'pulse_count': IP_.get('general',{}).get('pulse_info',{}).get('count',"-"),
'pulse_count': IP_.get('general',{}).get('pulse_info',{}).get('count',"0"),
'pulses': IP_.get('general',{}).get('pulse_info',{}).get('pulses',"-"),
'alexa': IP_.get('general',{}).get('alexa',"-"),
'whois': IP_.get('general',{}).get('whois',"-"),
Expand Down

0 comments on commit 7788d01

Please sign in to comment.