-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjoeks.py
39 lines (30 loc) · 1002 Bytes
/
joeks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#joeks
import requests
from bs4 import BeautifulSoup
import modules
import time
from plyer import notification
#functions
def get_joke():
data1=requests.get("https://sv443.net/jokeapi/v2/joke/any")
data=data1.json()
if data["category"]!="Dark":
if data["type"]== "twopart":
notification.notify(
title="A.N.T.O.N",
message=data["setup"],
timeout=3)
modules.speak(data["setup"])
notification.notify(
title="A.N.T.O.N",
message=data["delivery"],
timeout=4)
modules.speak(data["delivery"])
else:
notification.notify(
title="A.N.T.O.N",
message=data["delivery"],
timeout=4)
modules.speak(data["joke"])
else:
get_joke()