Problem
Agency outreach requires:
- Finding businesses in a target area
- Auditing their websites for improvement opportunities
- Writing personalized letters that reference specific issues
- Generating professional PDF documents
This is tedious when done manually for hundreds of businesses.
Solution
Built an automated pipeline:
# 1. Fetch businesses near an address
python scripts/get_places.py "123 Main St, Sydney" 500
# 2. Classify and filter businesses
python scripts/classify_businesses.py
# 3. Audit websites and generate letters
node index.js --input data/good_businesses.csv
# 4. Generate PDFs
python scripts/auto_pdf_generator.py
How It Works
Business Discovery
Uses Google Places API to find businesses within a radius. Extracts:
- Business name and address
- Website URL
- Phone number
- Business type
AI Classification
OpenAI filters out:
- Large corporations (not target market)
- Competitors
- Businesses without websites
- Invalid/irrelevant entries
Website Auditing
For each valid business:
- Lighthouse-style performance check
- Mobile responsiveness test
- SEO basics analysis
- Security (HTTPS) verification
Letter Generation
GPT generates personalized letters that reference:
- Specific issues found in the audit
- Business name and industry
- Actionable recommendations
Technical Details
Why Hybrid Node.js + Python?
- Node.js: Fast async HTTP for website auditing
- Python: Better PDF libraries (FPDF, PyPDF2) and data processing
Output
Final deliverable is a merged PDF with:
- Individual letters per business
- Consistent branding
- Professional formatting