2020-10-25 22:12:38 +00:00
|
|
|
import { SitemapNews } from './smartsitemap.classes.sitemapnews';
|
|
|
|
import * as plugins from './smartsitemap.plugins';
|
|
|
|
|
|
|
|
export class SmartSitemap {
|
|
|
|
constructor() {}
|
|
|
|
|
|
|
|
/**
|
2020-10-26 12:18:33 +00:00
|
|
|
* creates a sitemap for news from feedurl
|
2020-10-25 22:12:38 +00:00
|
|
|
*/
|
2020-10-26 12:18:33 +00:00
|
|
|
public async createSitemapNewsFromFeedUrl(feedUrlArg: string): Promise<string> {
|
2020-10-26 00:52:04 +00:00
|
|
|
const sitemapNewsInstance = new SitemapNews({});
|
2020-10-26 12:18:33 +00:00
|
|
|
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);
|
2020-10-25 22:12:38 +00:00
|
|
|
}
|
2020-10-26 00:52:04 +00:00
|
|
|
}
|