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