1
0
mirror of https://github.com/balkian/gists.git synced 2024-10-31 23:51:44 +00:00
gists/kemsirve.py
J. Fernando Sánchez f7c346463b
2015-09-19 14:16:39 +02:00

23 lines
844 B
Python

from __future__ import print_function
import requests
try:
import Tkinter as tk
import tkMessageBox as tkm
except Exception:
import tkinter as tk
from tkinter import messagebox as tkm
window = tk.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"])
tkm.showinfo(title="Greetings", message="%s: %s - %s!" % (i["reference"],
j["zone"],
j["availability"]))