An intelligent agent that automatically curates hackathons from your email newsletters, evaluates them using AI, and posts the best ones to Twitter.


- Email Processing: Monitors Gmail for Hackathons with a specific label.
- AI Analysis and Curation: Uses Google Gemini along with Grouding with Google Search to analyze hackathon URLs in real-time. Automatically extracts hackathon details (dates, prizes, themes, legitimacy) and curates them based on your criteria.
- Storage: Stores approved hackathons in Google Sheets with duplicate detection.
- Social Sharing: Automatically posts curated hackathons to Twitter.
- Reporting: Sends a summary email to the configured recipients.
- Automated: Runs via GitHub Actions.
git clone https://github.com/yourusername/hackathon-curation-agent.git
cd hackathon-curation-agent
pip install -r requirements.txt
Follow the instructions in OAUTH_SETUP_GUIDE.md
Gmail Label Setup:
- Create a label in Gmail called "Hackathons"
- Set up filters to automatically label incoming Hackathons
- Or use a different label name and set
HACKATHON_EMAIL_LABEL
variable
- Go to Google AI Studio and create an API key.
- Add the API key to GitHub Secrets as GEMINI_API_KEY.
- In the same Cloud project, go to APIs & Services β Library. Enable Google Sheets API.
- Create a Service Account (if you donβt already have one).
- Create a JSON key (Keys β Add key β JSON). Download it.
- Store the entire JSON in GitHub Secrets as SHEETS_CREDENTIALS.
- Create a Google Sheet (drive.google.com β New β Google Sheets). Open it.
- From the URL, copy the Sheet ID (long string between /d/ and /edit).
- Share the sheet with the service accountβs client_email (found in the JSON key) with Editor access.
- Add the Sheet ID to GitHub Secrets as GOOGLE_SHEETS_ID.
- Apply for Twitter Developer Account
- Create a new app with Read/Write permissions
- Generate API keys and tokens
- Add the API keys to GitHub Secrets as TWITTER_API_KEY, TWITTER_API_SECRET, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET
GMAIL_CREDENTIALS={"type":"service_account",...} # Gmail API service account JSON
GEMINI_API_KEY=your_gemini_api_key # Google Gemini API key
SHEETS_CREDENTIALS={"type":"service_account",...} # Google Sheets API service account JSON
GOOGLE_SHEETS_ID=your_sheet_id_from_url # Google Sheets spreadsheet ID
TWITTER_API_KEY=your_api_key # Twitter API key
TWITTER_API_SECRET=your_api_secret # Twitter API secret
TWITTER_ACCESS_TOKEN=your_access_token # Twitter access token
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
HACKATHON_EMAIL_LABEL=Hackathons # Gmail label to monitor
HACKATHON_INDICATORS=hackathon,hack,devpost # Keywords to identify hackathon links
DRY_RUN=false # Set to "true" for testing
MAX_EMAILS_PER_RUN=10 # Limit emails processed per run
MAX_TWITTER_POSTS=3 # Limit Twitter posts per run
LOG_LEVEL=INFO # Logging level
SEND_SUMMARY_EMAIL=false # Enable summary emails
SUMMARY_EMAIL_RECIPIENTS=email1,email2 # Comma-separated email addresses
HACKATHON_BATCH_SIZE=4 # URLs to analyze in each AI batch
HACKATHON_BATCH_DELAY=1.0 # Delay between AI analysis batches
Local Development:
# Set DEV_MODE flag
export DEV_MODE=true
# Add environment variables to a .env at the root of the project
# Run the agent
cd src
python3 main.py
Production/CI (GitHub Actions):
- Set all environment variables as repository secrets or vars as mentioned in the github actions yml
- No
.env
file needed - uses system environment variables directly
Customize what makes a "good" hackathon:
hackathon_criteria:
minimum_prize: 5000 # Minimum prize in USD
preferred_themes:
- "AI"
- "Web3"
- "Healthcare"
duration:
min_hours: 12
max_hours: 72
organizer_reputation:
trusted_organizations:
- "MLH"
- "DevPost"
# Test with dry run
DEV_MODE=true DRY_RUN=true python3 src/main.py
# Test single email
DEV_MODE=true MAX_EMAILS_PER_RUN=1 python3 src/main.py
# Debug mode
DEV_MODE=true LOG_LEVEL=DEBUG python3 src/main.py
Pull requests welcome! Please:
- Test your changes locally
- Update documentation
- Add appropriate logging
- Follow existing code style
Happy Hacking! π