Skip to content

Commit 9138ddf

Browse files
committed
feat: add ability to track bookmarks
1 parent 5e4f014 commit 9138ddf

9 files changed

Lines changed: 421 additions & 6 deletions

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
"@prisma/client": "^6.5.0",
1818
"@types/node-cron": "^3.0.11",
1919
"axios": "^1.8.4",
20+
"axios-cookiejar-support": "^7.0.0",
2021
"cheerio": "^1.0.0",
2122
"discord.js": "^14.18.0",
2223
"express": "^5.1.0",
2324
"node-cron": "^3.0.3",
24-
"rss-parser": "^3.13.0"
25+
"rss-parser": "^3.13.0",
26+
"tough-cookie": "^6.0.1"
2527
},
2628
"devDependencies": {
2729
"@eslint/js": "^9.26.0",

pnpm-lock.yaml

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prisma/schema.prisma

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ model Ao3WorkSnapshot {
3333
ao3FeedsId String? @db.ObjectId
3434
}
3535

36+
model Ao3BookmarkSnapshot {
37+
id String @id @default(auto()) @map("_id") @db.ObjectId
38+
workId String
39+
chapters Int
40+
lastUpdated String
41+
}
42+
3643
model Course {
3744
id String @id @default(auto()) @map("_id") @db.ObjectId
3845
crn Int @unique

src/config.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
const { TOKEN, CLIENT_ID, AO3_USERNAME, AO3_PASSWORD, COURT_WEBHOOK_KEY } =
2-
process.env;
1+
const {
2+
TOKEN,
3+
CLIENT_ID,
4+
AO3_USERNAME,
5+
AO3_PASSWORD,
6+
COURT_WEBHOOK_KEY,
7+
AO3_BOOKMARKS_CHANNEL,
8+
AO3_BOOKMARKS_URL,
9+
} = process.env;
310

411
if (!TOKEN || !CLIENT_ID) {
512
throw new Error('Missing environment variables');
613
}
714

815
export const config = {
916
bot: { token: TOKEN, clientId: CLIENT_ID },
10-
ao3: { username: AO3_USERNAME, password: AO3_PASSWORD },
17+
ao3: {
18+
username: AO3_USERNAME,
19+
password: AO3_PASSWORD,
20+
bookmarksChannel: AO3_BOOKMARKS_CHANNEL,
21+
bookmarksURL: AO3_BOOKMARKS_URL,
22+
},
1123
api: {
1224
port: process.env.PORT ? Number(process.env.PORT) : 3000,
1325
court_key: COURT_WEBHOOK_KEY || '',

0 commit comments

Comments
 (0)