Skip to content

Repository files navigation

πŸ” Domain Drop Tracker

A Python CLI tool for monitoring domain availability and sending Slack alerts when domains become available. Perfect for tracking expired or dropping domains that you want to register.

CI Python 3.13+ Automated Domain Checking

✨ Features

  • πŸ”„ Automated Domain Monitoring: Hourly checks via GitHub Actions
  • πŸ“± Slack Notifications: Instant alerts when domains become available
  • ⚑ Fast CLI Interface: Check individual domains or batch process from file
  • πŸ›‘οΈ Robust Error Handling: Graceful failure handling with notification alerts
  • πŸ”§ Easy Configuration: Simple environment variable setup
  • πŸ“Š WhoisXML API Integration: Reliable domain availability checking

πŸš€ Quick Start

1. Installation

# Clone the repository
git clone https://github.com/darylkang/domain-tracker.git
cd domain-tracker

# Install dependencies (using hatch)
make install

# OR install with pip in a virtual environment
pip install -e .

2. Configuration

# Copy environment template
cp .env.example .env

# Edit .env with your actual keys
WHOIS_API_KEY=your_whoisxml_api_key_here
SLACK_WEBHOOK_URL=your_slack_webhook_url_here

3. Add Domains to Monitor

Edit domains.txt and add domains you want to monitor (one per line):

spectre.cx
example-domain.com
another-domain.org

4. Test the Setup

# Check a single domain
vibe check example.com

# Check all domains from domains.txt
vibe check-domains

# Check with debug logging
vibe check-domains --debug

πŸ“‹ CLI Usage

Single Domain Check

# Check availability of a specific domain
vibe check example.com
vibe check spectre.cx

Batch Domain Check

# Check all domains from domains.txt
vibe check-domains

# Check with notifications for all domains (not just available ones)
vibe check-domains --notify-all

# Enable debug logging
vibe check-domains --debug

Other Commands

# Show help
vibe --help
vibe check --help
vibe check-domains --help

# Show version
vibe --version

πŸ”§ Configuration Guide

Required Environment Variables

Create a .env file in the project root with the following variables:

# WhoisXML API Key (Required)
# Get your free API key at: https://whoisxml.whoisapi.com/
WHOIS_API_KEY=at_1234567890abcdef...

# Slack Webhook URL (Required)
# Create a webhook at: https://api.slack.com/messaging/webhooks
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Optional Configuration

# Check interval for automated runs (default: 1 hour)
CHECK_INTERVAL_HOURS=1

# Custom path to domains file (default: domains.txt)
DOMAINS_FILE_PATH=custom-domains.txt

πŸ“± Slack Setup

1. Create a Slack Webhook

  1. Go to Slack API: Incoming Webhooks
  2. Click "Create your Slack app"
  3. Choose "From scratch"
  4. Name your app (e.g., "Domain Tracker") and select your workspace
  5. Go to "Incoming Webhooks" and activate it
  6. Click "Add New Webhook to Workspace"
  7. Choose the channel for notifications
  8. Copy the webhook URL to your .env file

2. Test Slack Integration

# This should send a test message to your Slack channel
vibe check example.com

Expected Slack Messages

  • Available Domain: "βœ… Domain available: example.com"
  • Unavailable Domain: "❌ Domain NOT available: example.com" (only with --notify-all)
  • Error Alert: "🚨 Domain Tracker Error: [error details]" (when automation fails)

πŸ”‘ WhoisXML API Setup

1. Get Your API Key

  1. Visit WhoisXML API
  2. Sign up for a free account
  3. Go to your dashboard and find your API key
  4. Add it to your .env file as WHOIS_API_KEY

2. API Limits

  • Free Tier: 500 requests/month
  • Paid Plans: Higher limits available
  • The tool handles rate limiting and errors gracefully

πŸ€– GitHub Actions Automation

Automated Hourly Checking

The project includes a GitHub Actions workflow that automatically checks your domains every hour.

Setup Steps

  1. Fork/Clone the Repository

  2. Configure GitHub Secrets:

    • Go to your repo β†’ Settings β†’ Secrets and variables β†’ Actions
    • Add these secrets:
      • WHOIS_API_KEY: Your WhoisXML API key
      • SLACK_WEBHOOK_URL: Your Slack webhook URL
  3. Enable GitHub Actions:

    • The workflow file is already included: .github/workflows/check-domains.yml
    • It runs automatically every hour at minute 0
    • You can also trigger it manually from the Actions tab

Manual Workflow Trigger

# Go to your repo β†’ Actions β†’ "Automated Domain Availability Checker" β†’ "Run workflow"

Workflow Features

  • Automated Runs: Every hour using cron schedule
  • Error Handling: Failures are reported to Slack
  • Environment Setup: Python 3.13 with all dependencies
  • Timeout Protection: 10-minute safety timeout

For detailed setup instructions, see GITHUB_ACTIONS_SETUP.md.

πŸ“ Project Structure

domain-tracker/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       β”œβ”€β”€ check-domains.yml     # Automated domain checking
β”‚       └── python-ci.yml         # CI/CD pipeline
β”œβ”€β”€ src/
β”‚   └── domain_tracker/
β”‚       β”œβ”€β”€ __init__.py           # Package initialization
β”‚       β”œβ”€β”€ cli.py                # Command-line interface
β”‚       β”œβ”€β”€ core.py               # Core business logic
β”‚       β”œβ”€β”€ domain_management.py  # Domain file handling
β”‚       β”œβ”€β”€ settings.py           # Configuration management
β”‚       β”œβ”€β”€ slack_notifier.py     # Slack integration
β”‚       └── whois_client.py       # WhoisXML API client
β”œβ”€β”€ tests/                        # Comprehensive test suite
β”œβ”€β”€ domains.txt                   # Domains to monitor
β”œβ”€β”€ .env.example                  # Environment template
β”œβ”€β”€ pyproject.toml               # Project configuration
β”œβ”€β”€ Makefile                     # Development commands
└── README.md                    # This file

πŸ§ͺ Development

Running Tests

# Run all tests
make test

# Run tests with coverage
make test-cov

# Run specific test
pytest tests/test_cli.py -v

# TDD watch mode
pytest --looponfail

Code Quality

# Lint code
make lint

# Format code
make format

# Type checking
make type-check

# Run all quality checks
make lint format type-check test

Development Environment

# Install development dependencies
make install

# Install pre-commit hooks
pre-commit install

# Clean up build artifacts
make clean

πŸ”’ Security Considerations

  • API Keys: Never commit API keys to version control
  • Webhook URLs: Keep Slack webhook URLs secure
  • Rate Limiting: The tool respects API rate limits
  • Error Handling: Sensitive data is not logged in error messages

πŸ“Š Monitoring & Troubleshooting

Common Issues

1. "Invalid API Key" Error

# Check your .env file has the correct API key
cat .env | grep WHOIS_API_KEY

2. Slack Notifications Not Working

# Test your webhook URL
curl -X POST -H 'Content-type: application/json' \
  --data '{"text":"Test message"}' \
  $SLACK_WEBHOOK_URL

3. GitHub Actions Failing

  • Check that GitHub Secrets are configured correctly
  • Review the Actions log for specific error messages
  • Ensure domains.txt is not empty

Debug Mode

# Enable detailed logging
vibe check-domains --debug

Manual Testing

# Test individual components
python -c "from domain_tracker.settings import Settings; print(Settings())"
python -c "from domain_tracker.domain_management import load_domains; print(load_domains())"
python -c "from domain_tracker.whois_client import check_domain_availability; print(check_domain_availability('google.com'))"

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Write tests first (TDD approach)
  4. Implement your changes
  5. Run tests: make test
  6. Submit a pull request

Development Workflow

This project follows Test-Driven Development (TDD):

  • Write failing tests first
  • Implement minimal code to pass
  • Refactor and improve
  • All tests must pass before merging

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸš€ Deployment Options

Personal Use

  • Run locally with cron job
  • Use GitHub Actions (recommended)

Team/Organization Use

  • Deploy to cloud server with scheduled tasks
  • Use container deployment (Docker)
  • Integrate with existing monitoring systems

πŸ“ž Support


Happy Domain Hunting! 🎯

Made with ❀️ for domain enthusiasts and developers who want to automate their domain monitoring workflow. Test.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages