Skip to content

Commit b6ecc7d

Browse files
committed
Refactor: Added support for multiple source URLs to the NameAndImageRecipe
1 parent 5b7ddfe commit b6ecc7d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/recipes/iq_puzzles/IQPuzzlesRecipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class IQPuzzlesRecipe implements Recipe {
2323

2424
this.recipe = new NameAndImageRecipe<IQPuzzle>(
2525
IQPuzzlesRecipe.NAME,
26-
IQPuzzlesRecipe.#SCRAPE_URL,
26+
[IQPuzzlesRecipe.#SCRAPE_URL],
2727
markdownTableFactory,
2828
markdownTableConverter,
2929
trackablesUpdater,

src/recipes/name_and_image/NameAndImageRecipe.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class NameAndImageRecipe<ParsedElement extends NameAndImage> implements R
1616

1717
constructor(
1818
private name: string,
19-
private scrapeURL: string,
19+
private scrapeURLs: string[],
2020
private markdownTableFactory: MarkdownTableFactory,
2121
private markdownTableConverter: MarkdownTableConverter,
2222
private trackablesUpdater: TrackablesUpdater,
@@ -43,9 +43,9 @@ export class NameAndImageRecipe<ParsedElement extends NameAndImage> implements R
4343
}
4444

4545
async #scrapePuzzles(): Promise<ParsedElement[]> {
46-
const scraper = new WebsiteScraper([{
47-
url: this.scrapeURL
48-
}]);
46+
const scraper = new WebsiteScraper(
47+
this.scrapeURLs.map(url => ({ url }))
48+
);
4949

5050
return await scraper.scrape(
5151
this.parseContent,

0 commit comments

Comments
 (0)