corexxx 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/rss.d.ts +0 -12
- package/dist/rss.js +44 -46
- package/dist/rss.js.map +1 -1
- package/package.json +4 -3
- package/src/index.ts +1 -1
- package/src/rss.ts +8 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,6 +23,6 @@ __exportStar(require("./dtime"), exports);
|
|
|
23
23
|
__exportStar(require("./dtypes"), exports);
|
|
24
24
|
__exportStar(require("./dutils"), exports);
|
|
25
25
|
__exportStar(require("./dvalidation"), exports);
|
|
26
|
-
|
|
26
|
+
// export * from "./rss";
|
|
27
27
|
__exportStar(require("./yahoofin"), exports);
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA8C;AAC9C,4CAA0B;AAC1B,4CAA0B;AAC1B,+CAA6B;AAC7B,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA8C;AAC9C,4CAA0B;AAC1B,4CAA0B;AAC1B,+CAA6B;AAC7B,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,yBAAyB;AACzB,6CAA2B"}
|
package/dist/rss.d.ts
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TObject } from ".";
|
|
2
|
-
export declare namespace drss {
|
|
3
|
-
type TRssItem = {
|
|
4
|
-
title: string;
|
|
5
|
-
url: string;
|
|
6
|
-
contentSnippet?: string;
|
|
7
|
-
date: Date;
|
|
8
|
-
image?: string;
|
|
9
|
-
source?: string;
|
|
10
|
-
};
|
|
11
|
-
function getRSSFeed(url: string, mapper?: TObject): Promise<TRssItem[]>;
|
|
12
|
-
}
|
package/dist/rss.js
CHANGED
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
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
|
-
image: u[mapper1.image],
|
|
36
|
-
source: u[mapper1.source],
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
});
|
|
2
|
+
/*import { dlog, dnetwork, TObject } from ".";
|
|
3
|
+
/// ISSUE with nodejs http and https
|
|
4
|
+
const xml2js = require("xml2js");
|
|
5
|
+
export namespace drss {
|
|
6
|
+
export type TRssItem = {
|
|
7
|
+
title: string;
|
|
8
|
+
url: string;
|
|
9
|
+
contentSnippet?: string;
|
|
10
|
+
date: Date;
|
|
11
|
+
image?: string;
|
|
12
|
+
source?: string;
|
|
13
|
+
};
|
|
14
|
+
export async function getRSSFeed(url: string, mapper?: TObject): Promise<TRssItem[]> {
|
|
15
|
+
let feed = await dnetwork.get(url);
|
|
16
|
+
let data = await xml2js.parseStringPromise(feed, { mergeAttrs: true });
|
|
17
|
+
let mapper1: TObject = {
|
|
18
|
+
date: "isoDate",
|
|
19
|
+
title: "title",
|
|
20
|
+
contentSnippet: "contentSnippet",
|
|
21
|
+
url: "link",
|
|
22
|
+
image: "image",
|
|
23
|
+
source: "creator",
|
|
24
|
+
};
|
|
25
|
+
let result: TRssItem[] = [];
|
|
26
|
+
for (let u of feed.items) {
|
|
27
|
+
result.push({
|
|
28
|
+
title: u[mapper1.title] as string,
|
|
29
|
+
url: u[mapper1.url] as string,
|
|
30
|
+
contentSnippet: u[mapper1.contentSnippet] as string,
|
|
31
|
+
date: new Date(u[mapper1.date]),
|
|
32
|
+
image: u[mapper1.image] as string,
|
|
33
|
+
source: u[mapper1.source] as string,
|
|
34
|
+
});
|
|
41
35
|
}
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
(async () => {
|
|
41
|
+
dlog.obj(await drss.getRSSFeed("https://www.zeebiz.com/world-economy.xml"));
|
|
42
|
+
//dlog.obj(await drss.getRSSFeed("http://feeds.marketwatch.com/marketwatch/topstories/"));
|
|
43
|
+
//dlog.obj(await drss.getRSSFeed("https://www.moneycontrol.com/rss/MCtopnews.xml"));
|
|
44
|
+
})();
|
|
45
|
+
// issue with NODEJS
|
|
46
|
+
*/
|
|
49
47
|
//# sourceMappingURL=rss.js.map
|
package/dist/rss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rss.js","sourceRoot":"","sources":["../src/rss.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rss.js","sourceRoot":"","sources":["../src/rss.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corexxx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.39",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
"@types/node-fetch": "^3.0.3",
|
|
16
16
|
"@types/underscore": "^1.11.3",
|
|
17
17
|
"axios": "^0.21.1",
|
|
18
|
+
"libxmljs": "^0.19.7",
|
|
18
19
|
"moment": "^2.29.1",
|
|
19
20
|
"nse-indices": "^0.0.3",
|
|
20
|
-
"rss-parser": "^3.12.0",
|
|
21
21
|
"underscore": "^1.13.1",
|
|
22
|
-
"universal-cookie": "^4.0.4"
|
|
22
|
+
"universal-cookie": "^4.0.4",
|
|
23
|
+
"xml2js": "^0.4.23"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/axios": "^0.14.0",
|
package/src/index.ts
CHANGED
package/src/rss.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TObject } from ".";
|
|
2
|
-
|
|
1
|
+
/*import { dlog, dnetwork, TObject } from ".";
|
|
2
|
+
/// ISSUE with nodejs http and https
|
|
3
|
+
const xml2js = require("xml2js");
|
|
3
4
|
export namespace drss {
|
|
4
5
|
export type TRssItem = {
|
|
5
6
|
title: string;
|
|
@@ -10,9 +11,8 @@ export namespace drss {
|
|
|
10
11
|
source?: string;
|
|
11
12
|
};
|
|
12
13
|
export async function getRSSFeed(url: string, mapper?: TObject): Promise<TRssItem[]> {
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let feed = await parser.parseURL(url);
|
|
14
|
+
let feed = await dnetwork.get(url);
|
|
15
|
+
let data = await xml2js.parseStringPromise(feed, { mergeAttrs: true });
|
|
16
16
|
let mapper1: TObject = {
|
|
17
17
|
date: "isoDate",
|
|
18
18
|
title: "title",
|
|
@@ -37,7 +37,9 @@ export namespace drss {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
(async () => {
|
|
40
|
-
|
|
40
|
+
dlog.obj(await drss.getRSSFeed("https://www.zeebiz.com/world-economy.xml"));
|
|
41
41
|
//dlog.obj(await drss.getRSSFeed("http://feeds.marketwatch.com/marketwatch/topstories/"));
|
|
42
42
|
//dlog.obj(await drss.getRSSFeed("https://www.moneycontrol.com/rss/MCtopnews.xml"));
|
|
43
43
|
})();
|
|
44
|
+
// issue with NODEJS
|
|
45
|
+
*/
|