- Scrapes job listings from Greenhouse, Lever, and Ashby platforms - Tracks 14 companies (1Password, DuckDuckGo, GitLab, etc.) - SQLite database for change detection - Filters by engineering job titles and location preferences - Generates static HTML dashboard with search/filter - Docker support for deployment to Debian server
50 lines
1.6 KiB
Python
50 lines
1.6 KiB
Python
from .base import BaseScraper, Job
|
|
|
|
|
|
class LeverScraper(BaseScraper):
|
|
"""
|
|
Scraper for companies using Lever.
|
|
Lever provides a JSON API at /v0/postings/{company} endpoint.
|
|
|
|
Example: https://api.lever.co/v0/postings/{company}
|
|
"""
|
|
|
|
def __init__(self, company_name: str, lever_company: str, **kwargs):
|
|
# Lever API endpoint
|
|
jobs_url = f"https://api.lever.co/v0/postings/{lever_company}"
|
|
super().__init__(company_name, jobs_url, **kwargs)
|
|
self.lever_company = lever_company
|
|
|
|
def scrape(self) -> list[Job]:
|
|
"""Scrape jobs from Lever API."""
|
|
data = self.fetch_json()
|
|
jobs = []
|
|
|
|
for job_data in data:
|
|
job_id = job_data.get("id", "")
|
|
title = job_data.get("text", "")
|
|
hosted_url = job_data.get("hostedUrl", "")
|
|
|
|
# Location info
|
|
categories = job_data.get("categories", {})
|
|
location = categories.get("location", "")
|
|
department = categories.get("department", "")
|
|
commitment = categories.get("commitment", "") # Full-time, Part-time, etc.
|
|
|
|
# Check for remote in work type
|
|
work_type = categories.get("workplaceType", "")
|
|
if work_type:
|
|
remote_type = self.classify_remote(work_type)
|
|
else:
|
|
remote_type = self.classify_remote(location)
|
|
|
|
jobs.append(Job(
|
|
external_id=job_id,
|
|
title=title,
|
|
url=hosted_url,
|
|
location=location,
|
|
department=department,
|
|
remote_type=remote_type
|
|
))
|
|
|
|
return jobs
|