Skip to content

Commit

Permalink
fix thisweekinreact scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosqsilva committed Sep 19, 2024
1 parent 3401040 commit 7a2e471
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"formatter": {
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
Expand Down
Binary file modified scraper/database.db
Binary file not shown.
3 changes: 1 addition & 2 deletions scraper/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export class Storage extends SQLite {
}

saveContent(source: SourceName, { date, url, content }: Content) {
const stmt = this
.prepare(`INSERT INTO newsletter (status_id, source_id, url, date, content)
const stmt = this.prepare(`INSERT INTO newsletter (status_id, source_id, url, date, content)
VALUES (@status_id, @source_id, @url, @date, @content)`);

const hasContent = Array.isArray(content) && content.length > 0;
Expand Down
2 changes: 1 addition & 1 deletion scraper/newsletter/thisweekinreact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function extractThisWeekInReact(browser: Browser, db: Storage) {
await page.goto(`${baseUrl}/newsletter`);

const issues = page.mainFrame.document.querySelectorAll(
`nav[class^="sidebar"] > ul li`,
`nav[class^="sidebar"] ul[class^="sidebarItemList"] li`,
);

for (const issue of issues) {
Expand Down

0 comments on commit 7a2e471

Please sign in to comment.