smartfeed/ts/index.ts

21 lines
644 B
TypeScript
Raw Normal View History

2020-10-25 14:02:03 +00:00
import { Feed, IFeedOptions } from './smartfeed.classes.feed';
2020-10-25 00:09:33 +00:00
import * as plugins from './smartfeed.plugins';
2020-10-25 14:02:03 +00:00
export class Smartfeed {
public createFeed(optionsArg: IFeedOptions) {
const feedVersion = new Feed(optionsArg);
return feedVersion;
}
2020-10-25 22:11:00 +00:00
public async parseFeedFromString(rssFeedString: string) {
const parser = new plugins.rssParser();
const resultingFeed = await parser.parseString(rssFeedString);
return resultingFeed;
}
public async parseFeedFromUrl(urlArg: string) {
const parser = new plugins.rssParser();
const resultingFeed = await parser.parseURL(urlArg);
return resultingFeed;
}
2020-10-25 14:02:03 +00:00
}