Fetches job postings from "Who is hiring?" threads on Hacker News, parses them with OpenAI, and stores them in Postgres for Metabase dashboards. Also exports to CSV.
- A hn_jobs.csv file with all parsed jobs
- Data in Postgres for Metabase visualization
- Docker and Docker Compose installed and running
- Python 3.9+
- OpenAI API key
-
Clone:
git clone <your-repo-url> cd hn-jobs-to-metabase -
Create .env:
POSTGRES_URL=postgresql://hnuser:hnpass@localhost:5432/hnjobs OPENAI_API_KEY=your_openai_api_key -
Set thread ID: Edit MANUAL_THREAD_ID at the top of fetch_hn_jobs.py:
MANUAL_THREAD_ID = 43858554 # Set your thread ID -
Run:
chmod +x run_local.sh ./run_local.sh -
Metabase:
- Go to http://localhost:3000
- Connect to Postgres with these settings:
- Host: db
- Database: hnjobs
- Username: hnuser
- Password: hnpass
- Schema: hn
- Explore the jobs table
-
Stop and Cleanup:
This will stop all containers and remove them, cleaning up your environment.
- Search Hacker News for: Ask HN: Who is hiring? (Month Year)
- The thread ID is at the end of the URL (e.g. item?id=43858554).
- Paste it into MANUAL_THREAD_ID in fetch_hn_jobs.py.
CREATE SCHEMA IF NOT EXISTS hn;
CREATE TABLE hn.jobs (
hn_comment_id bigint primary key,
company text,
role text,
location text,
salary text,
contact text,
description text,
posted_at timestamp with time zone,
created_at timestamp with time zone default now(),
updated_at timestamp with time zone default now()
);
MIT License