mirror of https://github.com/MISP/misp-modules
API changes reflected
parent
f62ca53e90
commit
8285ff324f
|
@ -24,10 +24,15 @@ start_time = 0
|
||||||
conversion_rates = {}
|
conversion_rates = {}
|
||||||
|
|
||||||
def get_consumption(output=False):
|
def get_consumption(output=False):
|
||||||
|
try:
|
||||||
req = requests.get(converter_rls)
|
req = requests.get(converter_rls)
|
||||||
jreq = req.json()
|
jreq = req.json()
|
||||||
minute = str(jreq['Minute']['CallsLeft']['Histo'])
|
minute = str(jreq['Data']['calls_left']['minute'])
|
||||||
hour = str(jreq['Hour']['CallsLeft']['Histo'])
|
hour = str(jreq['Data']['calls_left']['hour'])
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
minute = str(-1)
|
||||||
|
hour = str(-1)
|
||||||
# Debug out for the console
|
# Debug out for the console
|
||||||
print("Calls left this minute / hour: " + minute + " / " + hour)
|
print("Calls left this minute / hour: " + minute + " / " + hour)
|
||||||
return minute, hour
|
return minute, hour
|
||||||
|
|
Loading…
Reference in New Issue