mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 08:47:43 +00:00
feat(docs): add mkdocs
This commit is contained in:
@@ -7,7 +7,9 @@ import {usingResponse} from '../util';
|
||||
|
||||
function addNewLinks(store: Store, links: Link[], series: Series) {
|
||||
if (links.length === 0) {
|
||||
logger.debug(Print.message('NO STORE LINKS FOUND', series, store, true));
|
||||
logger.debug(
|
||||
Print.message('NO STORE LINKS FOUND', series, store, true)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -20,7 +22,12 @@ function addNewLinks(store: Store, links: Link[], series: Series) {
|
||||
}
|
||||
|
||||
logger.debug(
|
||||
Print.message(`FOUND ${newLinks.length} STORE LINKS`, series, store, true)
|
||||
Print.message(
|
||||
`FOUND ${newLinks.length} STORE LINKS`,
|
||||
series,
|
||||
store,
|
||||
true
|
||||
)
|
||||
);
|
||||
logger.debug(JSON.stringify(newLinks, null, 2));
|
||||
|
||||
@@ -39,7 +46,9 @@ export async function fetchLinks(store: Store, browser: Browser) {
|
||||
continue;
|
||||
}
|
||||
|
||||
logger.debug(Print.message('DETECTING STORE LINKS', series, store, true));
|
||||
logger.debug(
|
||||
Print.message('DETECTING STORE LINKS', series, store, true)
|
||||
);
|
||||
|
||||
if (!Array.isArray(url)) {
|
||||
url = [url];
|
||||
@@ -51,12 +60,17 @@ export async function fetchLinks(store: Store, browser: Browser) {
|
||||
const text = await response?.text();
|
||||
|
||||
if (!text) {
|
||||
logger.error(Print.message('NO RESPONSE', series, store, true));
|
||||
logger.error(
|
||||
Print.message('NO RESPONSE', series, store, true)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const docElement = cheerio.load(text).root();
|
||||
const links = store.linksBuilder!.builder(docElement, series);
|
||||
const links = store.linksBuilder!.builder(
|
||||
docElement,
|
||||
series
|
||||
);
|
||||
|
||||
addNewLinks(store, links, series);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user