An automated system for continuously monitoring Upwork job listings, generating cover letters, and preparing interview scripts. The system efficiently tracks seen jobs, processes new listings, and sends webhook notifications for high-value opportunities.
- Continuous polling of Upwork job listings
- Webhook notifications for high-value job matches
- Health check endpoint for container monitoring
- Efficient job tracking to avoid duplicate processing
- Automatic cover letter generation
- Interview script preparation
- Docker containerization for easy deployment
- Persistent storage of job data and generated content
- Rate limiting and error handling
- Configurable polling intervals and job retention
- Docker and Docker Compose
- Python 3.11+ (if running locally)
- A freelancer profile markdown file
- Webhook endpoint for receiving notifications (optional)
- Upwork account credentials
The system can be configured using environment variables:
# Required Settings
GOOGLE_API_KEY="your-api-key" # Google API key for content generation
# Optional Settings
POLLING_INTERVAL=480 # Polling interval (8 minutes)
MAX_JOBS_PER_POLL=10 # Maximum jobs to process per poll
JOB_RETENTION_DAYS=30 # Days to keep job data
HIGH_VALUE_THRESHOLD=7.0 # Minimum score for high-value jobs
WEBHOOK_URL="https://your-webhook-url" # Webhook for high-value job notifications- Install dependencies:
pip install -r requirements.txt
playwright install firefox
playwright install-deps- Authentication
The system requires authentication to access Upwork job listings and apply pages. Authentication is handled through browser cookies that are saved from your logged-in Upwork session.
- Run the cookie saver script:
./scripts/save_upwork_cookies.py-
A browser window will open. Log in to your Upwork account if not already logged in.
-
Once logged in, press Enter in the terminal. The script will save your authentication cookies to
files/auth/cookies.json. -
The system will automatically use these cookies for all Upwork requests. If you get authentication errors, simply run the script again to update the cookies with a fresh session.
Note: Keep your cookies file secure as it contains sensitive authentication information.
- Import the UPWORK_JOBS_n8n_IMPORTME.json into a new n8n workflow,
- Generate a new webhook
- Update the .env with the new webhook address
- Run the continuous poller:
python src/continuous_poller.py-
Place your freelancer profile in
files/profile.md -
Create a
.envfile with your configuration -
Build and start the container:
docker-compose up -d- Monitor the logs:
docker-compose logs -fThe system maintains two types of data:
- Seen Jobs: All jobs that have been discovered through polling
- Processed Jobs: Jobs that have been analyzed and have generated content
This separation allows for:
- Efficient tracking of new jobs
- Recovery from processing failures
- Historical record keeping
The system sends webhook notifications for high-value job matches (score ≥ 7.0). The notification payload includes:
{
"timestamp": "ISO-8601 timestamp",
"job_details": {
"id": "job identifier",
"title": "job title",
"description": "job description",
"job_type": "job type",
"experience_level": "required experience",
"duration": "project duration",
"rate": "payment rate",
"client_information": "client details",
"score": "match score",
"url": "job posting URL"
},
"generated_content": {
"cover_letter": "generated cover letter",
"interview_script": "generated interview script"
},
"metadata": {
"processed_at": "processing timestamp",
"search_query": "search query used",
"match_score": "job match score"
}
}The system provides a health check endpoint at http://localhost:8000/health that returns:
- 200 OK when the system is healthy
- 404 for invalid endpoints
This endpoint can be used for container orchestration and monitoring.
Data is stored in three locations:
/app/files/job_tracking: JSON files tracking job status/app/files/cache: Cached web content to reduce API calls/app/logs: Application logs
These directories are persisted using Docker volumes.
The system implements several rate limiting strategies:
- Configurable polling intervals (default: 8 minutes)
- Exponential backoff on errors
- Caching of web content
- Batch processing of jobs
Logs are written to both the console and upwork_poller.log. They include:
- Job discovery events
- Processing status
- Webhook notification status
- Error messages
- Rate limiting events
Monitor container health:
curl http://localhost:8000/healthMonitor container resource usage:
docker stats upwork-job-pollerThe system automatically cleans up old job data based on JOB_RETENTION_DAYS. Manual cleanup:
# Remove old volumes
docker-compose down
docker volume rm upwork-job-tracking upwork-cache upwork-logs
# Restart with clean state
docker-compose up -d- Pull latest changes:
git pull- Rebuild and restart:
docker-compose down
docker-compose build
docker-compose up -d-
Rate Limiting: If you see frequent rate limiting messages, try:
- Increasing
POLLING_INTERVAL - Decreasing
MAX_JOBS_PER_POLL
- Increasing
-
Memory Usage: If the container uses too much memory:
- Adjust the memory limits in
docker-compose.yml - Decrease
JOB_RETENTION_DAYS
- Adjust the memory limits in
-
Processing Errors: Check logs for specific error messages:
docker-compose logs -f | grep ERROR-
Webhook Issues: If webhook notifications fail:
- Verify the
WEBHOOK_URLis correct and accessible - Check network connectivity from the container
- Review webhook endpoint logs
- Verify the
-
Health Check Failures: If health checks fail:
- Verify port 8000 is not in use
- Check container logs for startup errors
- Ensure container has network access
- Fork the repository
- Create a feature branch
- Submit a pull request
MIT License