Récupérer la météo et l'envoyer par Gotify Le but de ce projet est avant-tout de tester Gotify et voir s'il peut potentiellement remplacer Telegram dans la plupart de mes projets qui nécessitent des notifications
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

30 Zeilen
706 B

  1. from gotify import send_notification_for_tomorrow, send_notification_for_today, send_notif
  2. import datetime
  3. import time
  4. def main():
  5. while True :
  6. now = datetime.datetime.now()
  7. print(type(now.hour))
  8. while now.hour % 9 != 0 :
  9. print(f"Il est {now.hour}H")
  10. now = datetime.datetime.now()
  11. time.sleep(600)
  12. if now.hour == 9 :
  13. send_notification_for_today()
  14. elif now.hour == 18 :
  15. send_notification_for_tomorrow()
  16. time.sleep(3600)
  17. if __name__ == '__main__':
  18. try :
  19. main()
  20. except :
  21. send_notif("Erreur", "Une erreur s'est produite durant l'execution du script")
  22. main()