fix(core): update

This commit is contained in:
2021-01-03 02:08:00 +00:00
parent 87cdc5bb5f
commit 17d8cd6585
5 changed files with 31 additions and 9 deletions

View File

@ -59,4 +59,23 @@ export class SmartSitemap {
}
return sitemapWebsite.exportSitemapXml();
}
/**
* parses a sitemap url
*/
public async parseSitemapUrl(urlArg: string) {
const sitemapXml = await (await (new plugins.webrequest.WebRequest()).request(urlArg, {
method: 'GET'
})).text();
const parsedSitemap = await this.parseSitemap(sitemapXml);
return parsedSitemap;
}
/**
* parses a sitemap
*/
public async parseSitemap(sitemapXmlArg: string) {
return (new plugins.smartxml.SmartXml()).parseXmlToObject(sitemapXmlArg);
}
}

View File

@ -3,12 +3,14 @@ import * as smartcache from '@pushrocks/smartcache';
import * as smartfeed from '@pushrocks/smartfeed';
import * as smartxml from '@pushrocks/smartxml';
import * as smartyaml from '@pushrocks/smartyaml';
import * as webrequest from '@pushrocks/webrequest';
export {
smartcache,
smartfeed,
smartxml,
smartyaml
smartyaml,
webrequest
};
// tsclass