Integrations and workflows for Open165.
npm iFor local development, create a .dev.vars file in the project root (don't commit this file):
# Copy the sample file
cp .dev.vars.sample .dev.vars
# Edit with your actual values
# URLSCAN_API_KEY="your-api-key-here"For local development with scheduled tasks enabled:
npm run devThis will start a local server with:
- Local D1 database simulation
- Local workflow simulation
- Scheduled task testing endpoint at
http://localhost:8787/__scheduled
You can trigger the scheduled workflows with:
# Trigger a scheduled event using curl
curl -X POST http://localhost:8787/__scheduled -H "Content-Type: application/json" -d '{"cron":"* * * * *"}'Deploy to Cloudflare workers using:
npm run deployThis project uses ESLint for linting and Prettier for code formatting.
To check for linting issues and automatically fix them (including formatting), run:
npm run lint -- --fixTo perform a TypeScript type check, run:
npm run typecheckAfter adding new bindings to wrangler.jsonc, run the following command to update the bindings:
npm run cf-typegenThis project includes Cloudflare Workflows for syncing scam site data from 165 open data:
SyncSiteRecordWorkflow- Syncs scam site records from 165 open dataSyncSiteAnnouncementWorkflow- Syncs announcements from 165 API
The workflows are scheduled to run every weekday at 20:00 UTC+8 (12:00 UTC) via the cron trigger in wrangler.jsonc.
You can manually trigger workflows using the Wrangler CLI:
# Trigger site record sync (remote only)
npx wrangler workflows trigger sync-site-record '{"submitToUrlscan": true}'
# Trigger site announcement sync (remote only)
npx wrangler workflows trigger sync-site-announcement '{}'
# Get workflow status (replace INSTANCE_ID with the ID returned from trigger)
npx wrangler workflows instances describe sync-site-record INSTANCE_ID
npx wrangler workflows instances describe sync-site-announcement INSTANCE_IDNote: The workflows trigger command only works with remote deployments, not for local development. For local testing, use the /__scheduled endpoint as described above.