1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-24 10:22:28 +00:00
gists/repos/1462976b537a1d661e1d/kemsirve.py

24 lines
835 B
Python
Raw Normal View History

2015-03-20 17:12:11 +00:00
from __future__ import print_function
import requests
2015-09-19 12:16:39 +00:00
try:
import Tkinter as tk
import tkMessageBox as tkm
except Exception:
import tkinter as tk
from tkinter import messagebox as tkm
2015-03-20 17:12:11 +00:00
2015-09-19 12:16:39 +00:00
window = tk.Tk()
2015-03-20 17:12:11 +00:00
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"])
2015-09-19 12:17:57 +00:00
tkm.showinfo(title="Greetings",
message="%s: %s - %s!" % (i["reference"],
j["zone"],
j["availability"]))