Skip to content
Open
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
19 changes: 19 additions & 0 deletions News Notifier/news.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests
import os
import sys
import urllib
from bs4 import BeautifulSoup
import notify2
import time

notify2.init("News")
url = "https://khabar.ndtv.com/topic/news/news"
r = requests.get(url)
soup = BeautifulSoup(r.content,"lxml")
news_data = soup.find_all("p",{"class":"intro"})

for item in news_data:
news = item.get_text().strip()
display = notify2.Notification(news)
display.show()
time.sleep(12)