21 lines
644 B
TypeScript
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;
|
|
}
|
|
} |