mirror of https://github.com/MISP/misp-modules
fix: Making pep8 happy
parent
fc54785d6b
commit
c9c6f69bd4
|
@ -7,19 +7,16 @@ except ImportError:
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['url'], 'output': ['text']}
|
mispattributes = {'input': ['url'], 'output': ['text']}
|
||||||
moduleinfo = {'author': 'Oun & Gindt', 'description': 'An expansion hover module to expand google search information about an URL', 'module-type': ['hover']}
|
moduleinfo = {'author': 'Oun & Gindt', 'module-type': ['hover'],
|
||||||
|
'description': 'An expansion hover module to expand google search information about an URL'}
|
||||||
|
|
||||||
|
|
||||||
def handler(q=False):
|
def handler(q=False):
|
||||||
if q is False:
|
if q is False:
|
||||||
return False
|
return False
|
||||||
request = json.loads(q)
|
request = json.loads(q)
|
||||||
if request.get('url'):
|
if not request.get('url'):
|
||||||
toquery = request['url']
|
return {'error': "Unsupported attributes type"}
|
||||||
else:
|
|
||||||
misperrors['error'] = "Unsupported attributes type"
|
|
||||||
return misperrors
|
|
||||||
|
|
||||||
num_page = 1
|
num_page = 1
|
||||||
res = ""
|
res = ""
|
||||||
search_results = google.search(request['url'], num_page)
|
search_results = google.search(request['url'], num_page)
|
||||||
|
@ -29,6 +26,7 @@ def handler(q=False):
|
||||||
res += '\n\n'
|
res += '\n\n'
|
||||||
return {'results': [{'types': mispattributes['output'], 'values':res}]}
|
return {'results': [{'types': mispattributes['output'], 'values':res}]}
|
||||||
|
|
||||||
|
|
||||||
def introspection():
|
def introspection():
|
||||||
return mispattributes
|
return mispattributes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue