Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Issue 276 #336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions System-Automation-Scripts/Joke-Teller/joke_teller.py
Original file line number Diff line number Diff line change
@@ -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)

3 changes: 3 additions & 0 deletions System-Automation-Scripts/Joke-Teller/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
notify-py==0.3.0
pyjokes==0.6.0
schedule==0.6.0