Skip to content

Commit 3ec78f0

Browse files
committed
feat: Add SimplyRecipes scraper
1 parent d826b1c commit 3ec78f0

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { scrapers } from './scrapers'
1+
import { scrapers } from './scrapers/_index'
22

33
export * from '@/types/recipe.interface'
44
export * from '@/types/scraper.interface'

src/scrapers/__tests__/scrapers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'bun:test'
22
import path from 'node:path'
33
import { AbstractScraper } from '@/abstract-scraper'
44
import { LogLevel } from '@/logger'
5-
import { scrapers } from '@/scrapers'
5+
import { scrapers } from '@/scrapers/_index'
66
import type { RecipeObject } from '@/types/recipe.interface'
77

88
const DATA_DIR = './test-data'

src/scrapers/index.ts renamed to src/scrapers/_index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AllRecipes } from './allrecipes'
33
import { Epicurious } from './epicurious'
44
import { NYTimes } from './nytimes'
55
import { SeriousEats } from './seriouseats'
6+
import { SimplyRecipes } from './simplyrecipes'
67

78
/**
89
* A map of all scrapers.
@@ -11,5 +12,6 @@ export const scrapers = {
1112
[AllRecipes.host()]: AllRecipes,
1213
[Epicurious.host()]: Epicurious,
1314
[SeriousEats.host()]: SeriousEats,
15+
[SimplyRecipes.host()]: SimplyRecipes,
1416
[NYTimes.host()]: NYTimes,
1517
} as const satisfies Record<string, typeof AbstractScraper>

src/scrapers/simplyrecipes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { AbstractScraper } from '@/abstract-scraper'
2+
3+
export class SimplyRecipes extends AbstractScraper {
4+
static host() {
5+
return 'simplyrecipes.com'
6+
}
7+
8+
extractors = {}
9+
}

0 commit comments

Comments
 (0)