HN favorites scrape CronJob -> AWS DynamoDB
Find a file
Noah Holtware 35e9c73cf2
All checks were successful
/ checks (push) Successful in 35s
/ deploy (push) Successful in 30s
feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 18:17:57 -06:00
.forgejo/workflows feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
src feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
.dockerignore feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
.gitignore feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
.nvmrc feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
.prettierignore feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
.prettierrc.json feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
commitlint.config.js feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
Dockerfile feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
eslint.config.js feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
package-lock.json feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
package.json feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
README.md feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
tsconfig.json feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00
vitest.config.ts feat: scrape HN favorites as a Kubernetes CronJob and write to DynamoDB 2026-11-05 18:17:57 -06:00

hackernews-favs-cron

Runs the Hacker News favorites scrape from nholtware/hackernews-favs (the AWS Lambda version) as a Kubernetes CronJob on the homelab k3s cluster. It still writes each batch to the AWS DynamoDB table hackernews-favs (same item shape: pk=date#YYYY-MM-DD, sk=batch#<uuid>), so existing readers are unaffected.

  • Code: src/favorites.ts (fetch + parse), src/main.ts (one-shot entrypoint).
  • Deploy: push to main -> Forgejo CI builds the image -> gitops-bump -> ArgoCD syncs manifests/hackernews-favs-cron (CronJob, Sundays 02:00 UTC).
  • Config env: TABLE_NAME, HN_USER (default noaoh), AWS_REGION.
  • Credentials: Secret aws-dynamodb in namespace hackernews-favs-cron, keys AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY. Created by kubectl, never in git. Scope the IAM user to dynamodb:PutItem on the table.
  • Run once now: kubectl create job -n hackernews-favs-cron --from=cronjob/hackernews-favs-cron manual-$(date +%s)
  • Remove the Lambda schedule once happy: cdk destroy in hackernews-favs would also delete the table (RemovalPolicy.DESTROY), so disable the EventBridge rule instead.