Home
/
rss-reader.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
extract the parser api to a base class
[rss-reader.git]
/
src
/
parsers
/
rss.ts
diff --git
a/src/parsers/rss.ts
b/src/parsers/rss.ts
index d23dcc2327b0c348dd0c605d2c58dd55e04a4754..e2db58d7ef130576cd42efd7073fb2f937c9db9a 100644
(file)
--- a/
src/parsers/rss.ts
+++ b/
src/parsers/rss.ts
@@
-1,5
+1,5
@@
import Parser from 'rss-parser';
import Parser from 'rss-parser';
-import {Feed} from './base';
+import {Feed
, BaseParser
} from './base';
function timestamp(str: string): number {
const date = +(new Date(str));
function timestamp(str: string): number {
const date = +(new Date(str));
@@
-13,9
+13,10
@@
function reasonable(dateStr: string): string {
return `${date.getFullYear()}-${month}-${day}`;
}
return `${date.getFullYear()}-${month}-${day}`;
}
-export class RSSParser {
+export class RSSParser
extends BaseParser
{
parser: Parser;
constructor() {
parser: Parser;
constructor() {
+ super();
this.parser = new Parser;
}
this.parser = new Parser;
}