
A Val Town project that finds email addresses associated with a GitHub user by analyzing their public commit history using multiple methods.
Visit the live demo to try it out!
- Multiple Search Methods: Choose from 4 different discovery strategies
- Smart (Early Stop) - Fast method that tries events first, falls back to commits
- Events Only - Quick search through recent public activity
- Commits Only - Thorough search through repository commits
- Combined - Runs both methods and merges results for maximum coverage
- Interactive UI: HTMX-powered interface with real-time form submission
- Enhanced Results: Shows source method, commit counts, and repository information
- Smart Filtering: Automatically filters out GitHub's noreply email addresses
- Ranked Results: Shows emails ranked by frequency of use in commits
- Rate Limit Friendly: Includes delays and error handling to respect GitHub's API limits
- Clean UI: Modern, responsive interface built with Hono JSX and Tailwind CSS
- Modular Architecture: Well-organized codebase with separated concerns
The tool uses two complementary methods to find email addresses:
- Fetches the user's recent public events (up to 100)
- Filters for
PushEvent
activities - Extracts email addresses from commit authors in those events
- Pros: Fast, single API call
- Cons: Limited to recent public activity, may miss older emails
- Gets the user's 10 most recently updated repositories
- Fetches the last 10 commits from each repository (authored by the user)
- Extracts email addresses from commit metadata
- Pros: More comprehensive, can find emails from older commits
- Cons: Multiple API calls, slower execution
- Runs both methods simultaneously using
Promise.allSettled
- Merges and deduplicates results
- Aggregates commit counts across both methods
- Provides fallback if one method fails
āāā index.ts # Main HTTP entry point (Hono app)
āāā lib/
ā āāā github-events.ts # Events-based email discovery
ā āāā github-commits.ts # Commits-based email discovery
ā āāā github-combined.ts # Combined logic with early stopping
ā āāā github-enhanced.ts # Enhanced functions with metadata tracking
āāā components/
ā āāā Layout.tsx # HTML layout component
ā āāā SearchForm.tsx # Search form with method selector
ā āāā MethodSelector.tsx # Method selection UI
ā āāā ProgressIndicator.tsx # Loading state component
ā āāā DetailedResults.tsx # Enhanced results display
ā āāā ResultsTable.tsx # Basic results component
ā āāā ErrorMessage.tsx # Error display component
āāā types/
ā āāā github.ts # TypeScript interfaces
āāā README.md
- Runtime: Deno on Val Town
- Framework: Hono for HTTP handling and SSR
- UI: Server-side JSX with Tailwind CSS
- Interactivity: HTMX for dynamic form submission
- API: GitHub REST API v4
- Uses Val Town's proxied fetch to help with rate limits
- Supports optional
GITHUB_TOKEN
environment variable for higher rate limits - Includes 100ms delays between repository API calls
- Graceful error handling for failed requests
GITHUB_TOKEN=your_github_personal_access_token
Adding a GitHub token increases your rate limit from 60 to 5,000 requests per hour.
- Clone or fork this Val Town project
- Set up your
GITHUB_TOKEN
if desired - The main entry point is
demo.tsx
(HTTP endpoint)
import {
getGithubUserEmail, // Smart early-stop approach (recommended)
getGithubUserEmailCombined, // Full combined approach
getGithubUserEmailFromEvents, // Events-only method
getGithubUserEmailFromCommits // Commits-only method
} from "./lib/github-combined.ts";
// Enhanced version with metadata
import { getGithubUserEmailWithMetadata } from "./lib/github-enhanced.ts";
// Get emails using smart method (early stopping)
const emails = await getGithubUserEmail("username");
// Get emails with source tracking
const detailedEmails = await getGithubUserEmailWithMetadata("username", "combined");
// Results format
interface DetailedEmailOccurrence {
username: string; // Author name from commits
email: string; // Email address
commitCount: number; // Number of commits using this email
sources: string[]; // Which methods found this email
repositories?: string[]; // Repositories that contributed this email
}
# Web interface with method selection GET / # Search with specific method POST /search Content-Type: application/x-www-form-urlencoded username=octocat&method=smart # Returns HTML results via HTMX
- Only analyzes public repositories and commits
- Respects users who have configured private emails
- Filters out GitHub's
@users.noreply.github.com
addresses - Use responsibly and respect privacy
- GitHub API rate limits (60/hour without token, 5000/hour with token)
- Only finds emails from commits where the user is the author
- May miss emails from private repositories or private commits
- Results depend on user's commit history and email configuration
- Email addresses found may be outdated
- Users can configure different emails for different repositories
- Some commits may use organization or work emails
- Results are ranked by frequency, not recency
The application handles various error scenarios:
- Invalid usernames
- API rate limit exceeded
- Network timeouts
- Private or empty repositories
- Malformed API responses
Errors are logged to console and displayed to users with helpful messages.
This is a Val Town project. To contribute:
- Fork the project in Val Town
- Make your changes
- Test thoroughly
- Share your improvements!
This project is open source and available under standard Val Town terms.
This tool is for educational and legitimate research purposes only. Always respect privacy, follow GitHub's Terms of Service, and use responsibly. The authors are not responsible for misuse of this tool.