Watch https://youtu.be/8rZ1e1J4hTU?si=3ssRQzyuqkGMj1v3 to learn more about Cloudflare Workflows
I am planning to build a tool that reminds of new job postings on a list of small scale early startups. I am a software engineer, I am interested in engineering jobs either backend or fullstack or team lead etc. It is difficult to find good quality matches on linkedin or other sites. These niche startups usually hire through other mediums but they always list the job openings on their websites under careers section.
The tool will be built on top of Cloudflare. I want to use their browser rendering APIs and products. These APIs allow to take screenshot of a web page, render as pdf, scrape html elements, capture structured data as json using AI, retrieve links from a page, extract markdown etc. I'll maintain an internal database of job openings and send out an email of curated jobs every week to myself. The list of web pages to crawl periodically for new openings will be static in the beginning. Do you think this tool would help me find my next job? How do you think abou this idea in terms of both feasability and usefulness?
- We have a list of career pages to crawl
- Each career page has a list of jobs
- Based on the title of the job link, the crawler should decide whether we should take it or leave it
- If the link was already processed, no need to process again
- Crawler runs once a week
POST https://api.cloudflare.com/client/v4/accounts/a6003e408a448be5fcc801b316519998/browser-rendering/json
{
"url": "https://duckduckgo.com/hiring",
"prompt": "Give me a list of job postings on this page, include the title and url of each job. I only care about senior roles in engineering positions.",
"gotoOptions": {
"waitUntil": "networkidle0"
},
"response_format": {
"type": "json_schema",
"schema": {
"properties": {
"jobs": {
"items": {
"properties": {
"url": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"url",
"title"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
}
}- Cron job triggers worker
- Worker starts workflow
- Workflow has steps for each company
- Cloudflare D1 (sqlite)
- No support for transactions
- You can query local db with
npx wrangler d1 execute job_hunter --command "select * from job;" --local
Create initial migration
npx wrangler d1 migrations create job_hunter init_tables
npx prisma migrate diff \
--from-empty \
--to-schema ./prisma/schema.prisma \
--script \
--output migrations/0001_init_tables.sqlApply the migration to local db
npx wrangler d1 migrations apply job_hunter --localIf you need to drop the local db and start fresh
rm -rf .wrangler/state
npx wrangler d1 migrations apply job_hunter --local