smartsitemap/ts/smartsitemap.classes.smartsitemap.ts
2020-10-26 12:18:33 +00:00

23 lines
691 B
TypeScript

import { SitemapNews } from './smartsitemap.classes.sitemapnews';
import * as plugins from './smartsitemap.plugins';
export class SmartSitemap {
constructor() {}
/**
* creates a sitemap for news from feedurl
*/
public async createSitemapNewsFromFeedUrl(feedUrlArg: string): Promise<string> {
const sitemapNewsInstance = new SitemapNews({});
await sitemapNewsInstance.readAndAddFromRssFeed(feedUrlArg);
return sitemapNewsInstance.exportSitemapXml();
}
/**
* creates a normal sitemap from a list of urls
*/
public async createSitemapFromYmlString(yamlString: string) {
const yamlObject = await plugins.smartyaml.yamlStringToObject(yamlString);
}
}