From 1180cbca0e27a2375f6e5603009c6d2b406f5f99 Mon Sep 17 00:00:00 2001 From: Priyanshi Patel <55431821+priyanshipatel248@users.noreply.github.com> Date: Sat, 1 May 2021 19:06:59 +0530 Subject: [PATCH] Add files via upload --- covidnotifier.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 covidnotifier.py diff --git a/covidnotifier.py b/covidnotifier.py new file mode 100644 index 0000000..49c6231 --- /dev/null +++ b/covidnotifier.py @@ -0,0 +1,20 @@ +import requests +from bs4 import BeautifulSoup +from plyer import notification +import time + +result = requests.get('https://www.mohfw.gov.in/').text # convert website into html +obj = BeautifulSoup(result, 'html.parser') +obj.encode('utf-8') +total_case = obj.find('li', {'class': 'bg-blue'}).get_text().strip() + + +# print(total_case) + +def tellme(tellme_title, cases): + notification.notify(title=tellme_title, message=cases, timeout=5) + + +while True: + tellme("Total cases of corona in india", total_case) + time.sleep(3)