smartfeed/ts/index.ts
2020-10-25 22:11:00 +00:00

21 lines
644 B
TypeScript

import { Feed, IFeedOptions } from './smartfeed.classes.feed';
import * as plugins from './smartfeed.plugins';
export class Smartfeed {
public createFeed(optionsArg: IFeedOptions) {
const feedVersion = new Feed(optionsArg);
return feedVersion;
}
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;
}
}