-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupDB.py
48 lines (39 loc) · 1.57 KB
/
setupDB.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
40
41
42
43
44
45
46
47
48
import pymongo as pm
mongoClient = pm.MongoClient('mongodb://localhost:27017')
db = mongoClient['rss']
def main():
insert_GtrendsUrls()
insert_RSSUrls()
def insert_GtrendsUrls():
if db['google_trends_rss'].find_one() is None:
print("No coll found with name: google_trends_rss ")
db['google_trends_rss'].insert_one({
"type": "GOOGLE_TRENDS",
"urls": [
"https://trends.google.com/trends/trendingsearches/daily/rss?geo=IN",
"https://trends.google.com/trends/trendingsearches/daily/rss?geo=US"
]
}
)
def insert_RSSUrls():
if db['rss-url'].find_one() is None:
print("No coll found with name: rss-url ")
db['rss-url'].insert_one({
"type": "NEWS",
"urls": [
"https://timesofindia.indiatimes.com/rssfeedstopstories.cms",
"https://indianexpress.com/syndication/",
"https://www.thehindu.com/rss/feeds/",
"https://feeds.feedburner.com/ndtvnews-india-news",
"https://timesofindia.indiatimes.com/rss.cms",
"https://www.indiatoday.in/rss/home",
"https://www.hindustantimes.com/rss",
"https://indianexpress.com/feed/",
"https://zeenews.india.com/rss/india-national-news.xml",
"https://www.news18.com/rss/india.xml",
"https://www.business-standard.com/rss/latest-news",
"https://economictimes.indiatimes.com/rssfeedsdefault.cms"
]
}
)
main()