Commit
•
4842df9
1
Parent(s):
b25cad8
Update news_extractor/news_extractor.py
Browse files
news_extractor/news_extractor.py
CHANGED
@@ -44,9 +44,9 @@ def rss_parser(i):
|
|
44 |
desc = "" if b1.find("description") is None else b1.find("description").get_text()
|
45 |
desc = text_clean(desc)
|
46 |
desc = f'{desc[:300]}...' if len(desc) >= 300 else desc
|
47 |
-
date = "Sat, 12 Aug 2000 13:39:15 +
|
48 |
if url.find("businesstoday.in") >= 0:
|
49 |
-
date = date.replace("GMT", "+
|
50 |
date1 = parser.parse(date)
|
51 |
return pd.DataFrame({"title": title,
|
52 |
"url": url,
|
@@ -108,7 +108,7 @@ def news_agg(rss):
|
|
108 |
# List of RSS feeds
|
109 |
rss = ['https://www.economictimes.indiatimes.com/rssfeedstopstories.cms',
|
110 |
'https://www.thehindu.com/news/feeder/default.rss',
|
111 |
-
'https://feeds.bbci.co.uk/news/world/rss.xml',
|
112 |
'https://www.businesstoday.in/rssfeeds/?id=225346',
|
113 |
'https://feeds.feedburner.com/ndtvnews-latest',
|
114 |
'https://www.hindustantimes.com/feeds/rss/world-news/rssfeed.xml',
|
|
|
44 |
desc = "" if b1.find("description") is None else b1.find("description").get_text()
|
45 |
desc = text_clean(desc)
|
46 |
desc = f'{desc[:300]}...' if len(desc) >= 300 else desc
|
47 |
+
date = "Sat, 12 Aug 2000 13:39:15 +05:30" if ((b1.find("pubDate") == "") or (b1.find("pubDate") is None)) else b1.find("pubDate").get_text()
|
48 |
if url.find("businesstoday.in") >= 0:
|
49 |
+
date = date.replace("GMT", "+05:30")
|
50 |
date1 = parser.parse(date)
|
51 |
return pd.DataFrame({"title": title,
|
52 |
"url": url,
|
|
|
108 |
# List of RSS feeds
|
109 |
rss = ['https://www.economictimes.indiatimes.com/rssfeedstopstories.cms',
|
110 |
'https://www.thehindu.com/news/feeder/default.rss',
|
111 |
+
# 'https://feeds.bbci.co.uk/news/world/rss.xml',
|
112 |
'https://www.businesstoday.in/rssfeeds/?id=225346',
|
113 |
'https://feeds.feedburner.com/ndtvnews-latest',
|
114 |
'https://www.hindustantimes.com/feeds/rss/world-news/rssfeed.xml',
|