mirror of https://github.com/MISP/misp-modules
python3 changes
parent
03044e1e6a
commit
dad73feaa4
|
@ -1,6 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import urllib2
|
||||
import requests
|
||||
import json
|
||||
|
||||
import sys
|
||||
|
@ -71,19 +69,17 @@ def handler(q=False):
|
|||
return r
|
||||
|
||||
def apicall(indicator_type, indicator, key=False):
|
||||
try:
|
||||
#try:
|
||||
myURL = BASEurl + (extensions[str(indicator_type)])%indicator
|
||||
request = urllib2.Request(myURL, None, MyHeader(key))
|
||||
data = urllib2.urlopen(request)
|
||||
jsondata = json.loads(data.read())
|
||||
except:
|
||||
return None
|
||||
return jsondata
|
||||
jsondata = requests.get(myURL, headers=MyHeader(key)).json()
|
||||
#except:
|
||||
#return None
|
||||
return jsondata
|
||||
|
||||
def introspection():
|
||||
return mispattributes
|
||||
return mispattributes
|
||||
|
||||
|
||||
def version():
|
||||
moduleinfo['config'] = moduleconfig
|
||||
return moduleinfo
|
||||
moduleinfo['config'] = moduleconfig
|
||||
return moduleinfo
|
Loading…
Reference in New Issue