Skip to content

About

notifies me when spacex goes public

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🚀 SpaceX IPO Notification Bot

A Python bot that monitors online sources every 5 minutes for news about SpaceX going public (IPO) and sends you alerts via WhatsApp (CallMeBot), Twilio SMS, or other notification providers.

Features

  • Multi-source monitoring: Google News RSS, SEC EDGAR filings, Reddit
  • Two alert levels:
    • 🚀 CONFIRMED: SEC S-1 filings, official announcements
    • 📰 RUMOR: News articles, analyst predictions, community discussions
  • Rumored date extraction: Automatically detects and includes mentioned IPO timeframes (e.g., "Q3 2026", "early 2027")
  • Deduplication: Tracks seen articles to avoid duplicate notifications
  • Rate limiting: Configurable max rumor SMS per hour to prevent spam
  • Modular notification system: Easy to swap Twilio for another SMS/notification provider
  • Graceful shutdown: Saves state on Ctrl+C

Quick Start

1. Install dependencies

cd spacex_bot
pip install -r requirements.txt

2. Configure notifications

Copy the example config and edit it:

cp config.example.py config.py

Option A: CallMeBot WhatsApp (Free — recommended)

  1. Each recipient sends this WhatsApp message to +34 644 21 77 47:
    I allow callmebot to send me messages
    
  2. You'll receive an API key in the reply
  3. Edit config.py:
NOTIFIER = "callmebot"

CALLMEBOT_RECIPIENTS = [
    {"phone": "+14155551234", "apikey": "123456"},
    # Add more recipients here
]

Option B: Twilio SMS (Paid)

NOTIFIER = "twilio"

PHONE_NUMBERS = ["+14155551234"]
TWILIO_ACCOUNT_SID = "ACxxxxxxxx..."    # From twilio.com/console
TWILIO_AUTH_TOKEN = "your_auth_token"   # From twilio.com/console
TWILIO_FROM_NUMBER = "+15551234567"     # Your Twilio phone number

3. Run the bot

# Production mode (sends real SMS, runs continuously)
python spacex_ipo_bot.py

# Test mode (console output only, runs once, no SMS)
python spacex_ipo_bot.py --test

# Run a single check cycle with SMS then exit
python spacex_ipo_bot.py --once

File Structure

spacex_bot/
├── spacex_ipo_bot.py    # Main bot orchestrator (scheduling, dedup, logic)
├── sources.py           # Source checkers (Google News, SEC EDGAR, Reddit)
├── notifier.py          # Abstract notifier interface + Twilio implementation
├── config.py            # Configuration (credentials, intervals, settings)
├── requirements.txt     # Python dependencies
└── README.md            # This file

How It Works

  1. Every 5 minutes, the bot queries all configured sources
  2. Articles are classified as "confirmed" or "rumor" based on keyword matching
  3. New articles (not previously seen) trigger SMS notifications
  4. Confirmed alerts are always sent immediately
  5. Rumor alerts are rate-limited (default: max 3 per hour)
  6. Any mentioned dates/timeframes are extracted and included in the SMS

Sources Monitored

Source What it checks
Google News RSS Multiple search queries for SpaceX IPO news
SEC EDGAR S-1 and S-1/A filings by Space Exploration Technologies Corp
Reddit r/wallstreetbets, r/stocks, r/investing, r/spacex, r/stockmarket

Switching Notification Providers

The notification system is modular. To add a new provider:

  1. Create a new class in notifier.py that extends BaseNotifier:
class VonageNotifier(BaseNotifier):
    def __init__(self, api_key, api_secret, from_number, to_number):
        # ...

    def send_alert(self, message: str, alert_level: str) -> bool:
        # Your implementation here
        pass
  1. Add it to the create_notifier() factory function:
elif notifier_type == "vonage":
    return VonageNotifier(...)
  1. Update config.py:
NOTIFIER = "vonage"
VONAGE_API_KEY = "..."
VONAGE_API_SECRET = "..."

Running as a Background Service

Using systemd (Linux)

Create /etc/systemd/system/spacex-ipo-bot.service:

[Unit]
Description=SpaceX IPO Notification Bot
After=network.target

[Service]
Type=simple
User=your_username
WorkingDirectory=/path/to/spacex_bot
ExecStart=/usr/bin/python3 spacex_ipo_bot.py
Restart=on-failure
RestartSec=60

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl enable spacex-ipo-bot
sudo systemctl start spacex-ipo-bot

Using screen/tmux

screen -S spacex-bot
python spacex_ipo_bot.py
# Detach with Ctrl+A, D

Configuration Options

Setting Default Description
CHECK_INTERVAL_SECONDS 300 (5 min) How often to check sources
MAX_RUMOR_SMS_PER_HOUR 3 Max rumor alerts per hour
NOTIFIER "twilio" Notification provider to use
LOG_FILE "spacex_ipo_bot.log" Log file path
SEEN_ARTICLES_FILE "seen_articles.json" Deduplication state file

License

Personal use.

About

notifies me when spacex goes public

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages