diff --git a/System-Automation-Scripts/Joke-Teller/joke_teller.py b/System-Automation-Scripts/Joke-Teller/joke_teller.py new file mode 100644 index 00000000..1976e4ca --- /dev/null +++ b/System-Automation-Scripts/Joke-Teller/joke_teller.py @@ -0,0 +1,31 @@ +import sys +import time +import pyjokes +import schedule +from notifypy import Notify + + +def job(): + notification = Notify() + notification.title = "Funny Joke" + notification.message = pyjokes.get_joke() + notification.send() + + +def run_forever(): + while True: + schedule.run_pending() + time.sleep(1) + + +schedule.every(30).minutes.do(job) + + +if __name__ == '__main__': + try: + job() + run_forever() + except KeyboardInterrupt: + print("GoodBye!") + sys.exit(0) + diff --git a/System-Automation-Scripts/Joke-Teller/requirements.txt b/System-Automation-Scripts/Joke-Teller/requirements.txt new file mode 100644 index 00000000..53f829c1 --- /dev/null +++ b/System-Automation-Scripts/Joke-Teller/requirements.txt @@ -0,0 +1,3 @@ +notify-py==0.3.0 +pyjokes==0.6.0 +schedule==0.6.0