This Python CLI application allows you to search for job postings on Hacker News based on a given query text. It retrieves job postings using the Hacker News API, indexes them using an SQLite full-text search (FTS) engine, and displays the search results with the help of the Rich library.
- Clone the repository.
git clone https://github.com/amscotti/HNJobSearcher.git
cd HNJobSearcher
- (Optional) Set up a virtual environment.
python -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate
- Install the required dependencies.
pip install -r requirements.txt
Run the following command to search for job postings:
python main.py -j <job_posting_id> -q <query_text> -c <search_count>
job_posting_id
is the ID of the job posting from Hacker News (default is35424807
).query_text
is the text you want to search for in the job postings (default is"python AND remote"
).search_count
is the number of job postings to return (default is100
).
For example, to search for remote Python job postings, you can run:
python main.py -j 35424807 -q "python AND remote" -c 100
Build the Docker image:
docker build -t your-image-name .
Run the Docker container:
docker run -it your-image-name -j your-job-posting-id -q your-query-text -c your-search-count