python3 changes

pull/96/head
Joerg Stephan 2017-01-31 16:34:41 +01:00
parent 03044e1e6a
commit dad73feaa4
1 changed files with 9 additions and 13 deletions

View File

@ -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