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
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

30 строки
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()