import requests import time import notify2 notify2.init("ICE") current = 0 while True: result = requests.get("https://iceportal.de/api1/rs/status") speed = result.json()["speed"] if speed != 0: if current != speed: n = notify2.Notification("ICE SPEED UPDATE", "new ICE speed: %s km/h" % speed) n.show() current = speed time.sleep(1)