Spaces:
Running
Running
Update news.js
Browse files
news.js
CHANGED
@@ -10,49 +10,49 @@ var config = parse(process.env.DATABASE_URL);
|
|
10 |
const pool = new Pool(config);
|
11 |
|
12 |
|
|
|
13 |
const rssList = [
|
14 |
{
|
15 |
-
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100003114": ["top", "
|
16 |
-
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100727362": ["world", "
|
17 |
-
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10001147": ["business", "
|
18 |
-
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10001054": ["science", "
|
19 |
-
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=19854910": ["technology", "
|
20 |
-
|
21 |
-
"http://timesofindia.indiatimes.com/rssfeeds/1081479906.cms": ["entertainment", "
|
22 |
-
"https://timesofindia.indiatimes.com/rssfeedstopstories.cms": ["top", "
|
23 |
-
"https://timesofindia.indiatimes.com/rssfeeds/296589292.cms": ["world", "
|
24 |
-
"https://timesofindia.indiatimes.com/rssfeeds/1898055.cms": ["business", "
|
25 |
-
"https://timesofindia.indiatimes.com/rssfeeds/-2128672765.cms": ["science", "
|
26 |
-
"https://timesofindia.indiatimes.com/rssfeeds/4719148.cms": ["sports", "
|
27 |
-
"https://timesofindia.indiatimes.com/rssfeeds/66949542.cms": ["technology", "
|
28 |
-
"http://timesofindia.indiatimes.com/rssfeeds/1081479906.cms": ["entertainment", "
|
29 |
-
"http://timesofindia.indiatimes.com/rssfeeds/-2128936835.cms": ["india", "
|
30 |
|
31 |
},
|
32 |
|
33 |
{
|
34 |
-
"https://feeds.abcnews.com/abcnews/topstories": ["top", "
|
35 |
-
"https://feeds.abcnews.com/abcnews/internationalheadlines": ["world", "
|
36 |
-
"https://feeds.abcnews.com/abcnews/moneyheadlines": ["business", "
|
37 |
-
"https://feeds.abcnews.com/abcnews/technologyheadlines": ["technology", "
|
38 |
-
"https://feeds.abcnews.com/abcnews/entertainmentheadlines": ["entertainment", "
|
39 |
-
"https://feeds.abcnews.com/abcnews/sportsheadlines": ["sports", "
|
40 |
-
|
41 |
-
"https://moxie.foxnews.com/google-publisher/latest.xml": ["top", "
|
42 |
-
"https://moxie.foxnews.com/google-publisher/science.xml": ["science", "
|
43 |
-
"https://moxie.foxnews.com/google-publisher/sports.xml": ["sports", "
|
44 |
-
"https://moxie.foxnews.com/google-publisher/tech.xml": ["technology", "
|
45 |
-
"https://moxie.foxnews.com/google-publisher/world.xml": ["world", "
|
46 |
-
|
47 |
-
"http://www.moneycontrol.com/rss/MCtopnews.xml": ["india business", "
|
48 |
-
"https://www.livemint.com/rss/sports": ["india sports", "
|
49 |
|
50 |
}
|
51 |
|
52 |
];
|
53 |
|
54 |
|
55 |
-
|
56 |
const getNews = async (req, res) => {
|
57 |
|
58 |
|
@@ -73,7 +73,7 @@ const getNews = async (req, res) => {
|
|
73 |
}
|
74 |
|
75 |
//console.log(data, rssList[id][url][0], rssList[id][url][1], rssList[id][url][2]);
|
76 |
-
await uploadNewsOnDatabase(data, rssList[id][url][0], rssList[id][url][1], rssList[id][url][
|
77 |
}
|
78 |
|
79 |
res.send({ STATUS: "SUCCESS" });
|
|
|
10 |
const pool = new Pool(config);
|
11 |
|
12 |
|
13 |
+
|
14 |
const rssList = [
|
15 |
{
|
16 |
+
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100003114": ["top", "www.cnbc.com"],
|
17 |
+
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100727362": ["world", "www.cnbc.com"],
|
18 |
+
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10001147": ["business", "www.cnbc.com"],
|
19 |
+
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10001054": ["science", "www.cnbc.com"],
|
20 |
+
"https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=19854910": ["technology", "www.cnbc.com"],
|
21 |
+
|
22 |
+
"http://timesofindia.indiatimes.com/rssfeeds/1081479906.cms": ["entertainment", "www.timesofindia.indiatimes.com"],
|
23 |
+
"https://timesofindia.indiatimes.com/rssfeedstopstories.cms": ["top", "www.timesofindia.indiatimes.com"],
|
24 |
+
"https://timesofindia.indiatimes.com/rssfeeds/296589292.cms": ["world", "www.timesofindia.indiatimes.com"],
|
25 |
+
"https://timesofindia.indiatimes.com/rssfeeds/1898055.cms": ["business", "www.timesofindia.indiatimes.com"],
|
26 |
+
"https://timesofindia.indiatimes.com/rssfeeds/-2128672765.cms": ["science", "www.timesofindia.indiatimes.com"],
|
27 |
+
"https://timesofindia.indiatimes.com/rssfeeds/4719148.cms": ["sports", "www.timesofindia.indiatimes.com"],
|
28 |
+
"https://timesofindia.indiatimes.com/rssfeeds/66949542.cms": ["technology", "www.timesofindia.indiatimes.com"],
|
29 |
+
"http://timesofindia.indiatimes.com/rssfeeds/1081479906.cms": ["entertainment", "www.timesofindia.indiatimes.com"],
|
30 |
+
"http://timesofindia.indiatimes.com/rssfeeds/-2128936835.cms": ["india", "www.timesofindia.indiatimes.com"],
|
31 |
|
32 |
},
|
33 |
|
34 |
{
|
35 |
+
"https://feeds.abcnews.com/abcnews/topstories": ["top", "www.abcnews.go.com"],
|
36 |
+
"https://feeds.abcnews.com/abcnews/internationalheadlines": ["world", "www.abcnews.go.com"],
|
37 |
+
"https://feeds.abcnews.com/abcnews/moneyheadlines": ["business", "www.abcnews.go.com"],
|
38 |
+
"https://feeds.abcnews.com/abcnews/technologyheadlines": ["technology", "www.abcnews.go.com"],
|
39 |
+
"https://feeds.abcnews.com/abcnews/entertainmentheadlines": ["entertainment", "www.abcnews.go.com"],
|
40 |
+
"https://feeds.abcnews.com/abcnews/sportsheadlines": ["sports", "www.abcnews.go.com"],
|
41 |
+
|
42 |
+
"https://moxie.foxnews.com/google-publisher/latest.xml": ["top", "www.foxnews.com"],
|
43 |
+
"https://moxie.foxnews.com/google-publisher/science.xml": ["science", "www.foxnews.com"],
|
44 |
+
"https://moxie.foxnews.com/google-publisher/sports.xml": ["sports", "www.foxnews.com"],
|
45 |
+
"https://moxie.foxnews.com/google-publisher/tech.xml": ["technology", "www.foxnews.com"],
|
46 |
+
"https://moxie.foxnews.com/google-publisher/world.xml": ["world", "www.foxnews.com"],
|
47 |
+
|
48 |
+
"http://www.moneycontrol.com/rss/MCtopnews.xml": ["india business", "www.moneycontrol.com"],
|
49 |
+
"https://www.livemint.com/rss/sports": ["india sports", "www.livemint.com"],
|
50 |
|
51 |
}
|
52 |
|
53 |
];
|
54 |
|
55 |
|
|
|
56 |
const getNews = async (req, res) => {
|
57 |
|
58 |
|
|
|
73 |
}
|
74 |
|
75 |
//console.log(data, rssList[id][url][0], rssList[id][url][1], rssList[id][url][2]);
|
76 |
+
await uploadNewsOnDatabase(data, rssList[id][url][0], rssList[id][url][1], rssList[id][url][1]);
|
77 |
}
|
78 |
|
79 |
res.send({ STATUS: "SUCCESS" });
|