add searching_stats

pull/208/head
Sebdraven 2018-07-17 18:32:50 +02:00
parent c785cae89b
commit 9d603344c2
1 changed files with 25 additions and 0 deletions

View File

@ -543,6 +543,31 @@ def expand_searching_domain(api, ip):
return r, status_ok
def expand_search_stats(api, ip, misperror):
r = []
status_ok = False
try:
result = api.searching_stats(ipv4=ip)
if result and 'top_organizations' in result:
comment = ''
for reg in result['top_organizations']:
comment += 'Organization %s used %s count: %s' % (reg['key'],
ip,
reg['count'])
r.append({'types': ['comment'],
'categories': ['Other'],
'values': comment,
})
status_ok = True
except APIError as e:
misperrors['error'] = e
return [], False
return r, status_ok
def introspection():
return mispattributes