A Cloudflare Worker that scrapes Deccan Herald’s “Speak Out” and posts the latest image to r/DHSavagery.
- Fetch latest article date and image URL
- Authenticate with Reddit via OAuth
- Post link to a subreddit on a CRON schedule
- Clone this repo
- Create a
.dev.vars
and fill in your Reddit app credentials:REDDIT_APP_ID
REDDIT_APP_SECRET
REDDIT_USERNAME
REDDIT_PASSWORD
- Install dependencies
npm install
- Run tests
npm test
To simulate the scheduled trigger locally:
npx wrangler dev src/index.ts --test-scheduled
# or via curl:
curl "http://localhost:8787/__scheduled"
# or
curl "http://localhost:8787/cdn-cgi/handler/scheduled"
To hit the HTTP stub:
curl http://localhost:8787
# returns "OK"
Please create a PR with your changes and describe what you intend to change with it and why.