The job listing fetcher has been fully integrated with the system's job listings index. When a job listing is fetched and saved, it is automatically added to data/job_listings/index.json.
- Fetch HTML - Retrieve job listing from URL or local file
- Parse Content - Extract title, company, location, description
- Generate Markdown - Create formatted markdown file
- Save File - Write to
data/job_listings/directory - Update Index - Automatically add entry to
index.json✨ NEW
Each job listing in the index contains:
{
"id": "644870ea-db70-49b3-9b1f-a1f4887c3b70",
"title": "Senior Software Engineer",
"company": "TechCorp Inc.",
"location": "San Francisco, CA",
"file": "test_senior_software_engineer.md",
"created_at": "2025-10-26T15:24:10.294414Z",
"description": "Senior Software Engineer at TechCorp Inc. in San Francisco, CA"
}- id: Unique UUID for the job listing
- title: Job title
- company: Company name
- location: Job location
- file: Markdown filename (relative to data/job_listings/)
- created_at: ISO 8601 timestamp with UTC timezone
- description: Human-readable description
fetch_job_listing.py
- Added
update_job_listings_index()function - Integrated index update into
fetch_job_listing() - Integrated index update into
fetch_job_listing_selenium() - Automatic UUID generation for each listing
- ISO 8601 timestamp generation
Updates the job listings index with a new entry.
Parameters:
title(str): Job titlecompany(str): Company namelocation(str): Job locationfilepath(str): Path to saved markdown fileoutput_dir(str): Output directory (default: "job_listings")
Returns:
dict: The created job entry
Example:
from fetch_job_listing import update_job_listings_index
job_entry = update_job_listings_index(
title="Senior Software Engineer",
company="TechCorp Inc.",
location="San Francisco, CA",
filepath="data/job_listings/senior_software_engineer.md"
)
print(f"Added job with ID: {job_entry['id']}")from fetch_job_listing import fetch_job_listing
url = "https://example.com/job-listing"
filepath = fetch_job_listing(url)
# Job is automatically added to data/job_listings/index.jsonimport json
with open("data/job_listings/index.json", "r") as f:
index = json.load(f)
print(f"Total job listings: {len(index['job_listings'])}")
for job in index['job_listings'][-5:]:
print(f" - {job['title']} at {job['company']}")import json
with open("data/job_listings/index.json", "r") as f:
index = json.load(f)
# Find all jobs at a specific company
company_name = "TechCorp Inc."
jobs = [j for j in index['job_listings'] if j['company'] == company_name]
print(f"Found {len(jobs)} jobs at {company_name}")✅ Status: PASSED
Results:
- Index file:
data/job_listings/index.json - Entries before: 19
- Entries after: 20
- New entry added successfully
- All fields populated correctly
Latest Entry:
Title: Senior Software Engineer
Company: TechCorp Inc.
Location: San Francisco, CA
File: test_senior_software_engineer.md
ID: 644870ea-db70-49b3-9b1f-a1f4887c3b70
Created: 2025-10-26T15:24:10.294414Z
Run the verification script to check the index:
python verify_index.pyThis will display:
- Total number of job listings
- Latest 5 entries with all details
The AI agent can now:
- Query the index to find job listings by company or title
- Access job files using the filename from the index
- Track job listings with unique IDs and timestamps
- Automate workflows that depend on job listing metadata
✅ Automatic Tracking - No manual index updates needed ✅ Unique IDs - Each job has a UUID for reliable reference ✅ Timestamps - Know when each job was added ✅ Metadata - Store title, company, location for quick lookup ✅ File References - Link to markdown files for content ✅ Agent Integration - AI agent can query and use the index
- ✅ Use
fetch_job_listing()to fetch and auto-index jobs - ✅ Query the index with
verify_index.py - ✅ Integrate with agent for automated workflows
- ✅ Build dashboards using index data
- fetch_job_listing.py - Main script with index integration
- test_fetch_with_index.py - Test script demonstrating integration
- verify_index.py - Verification script to check index
- data/job_listings/index.json - The job listings index
✅ COMPLETE AND TESTED
The job listing fetcher is fully integrated with the system's index!