1
0
mirror of https://github.com/balkian/gists.git synced 2024-12-24 15:18:13 +00:00
This commit is contained in:
J. Fernando Sánchez 2015-03-20 18:12:11 +01:00
commit edba0173d9

16
kemsirve.py Normal file
View File

@ -0,0 +1,16 @@
from __future__ import print_function
import requests
import Tkinter
import tkMessageBox
window = Tkinter.Tk()
window.wm_withdraw()
resp = requests.get("https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2")
for i in resp.json()["answer"]["availability"]:
if i["reference"] in ["150sk10", "150sk20"]:
for j in i["metaZones"]:
if j["availability"] not in ["unavaible", "unknown"]:
print(j["zone"], j["availability"])
tkMessageBox.showinfo(title="Greetings", message="%s - %s!" % (j["zone"], j["availability"]))