Public
Real-time Dubai/UAE disaster alerts via Telegram DM
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

🚨 Dubai Disaster Alerts

Real-time disaster monitoring for Dubai & UAE — sends you a Telegram DM the moment something happens that affects health, security, or war.

How it works

  1. monitor.ts (interval, every 15 min) — fetches disaster news from Google News RSS filtered for UAE/Dubai + disaster keywords
  2. lib/news.ts — parses RSS, filters by relevance (UAE location + disaster keywords, excludes sports/entertainment), scores severity
  3. lib/db.ts — SQLite tracks sent alerts (deduplication) and stores your Telegram chat ID
  4. lib/telegram.ts — sends messages via the Telegram Bot API
  5. webhook.ts (HTTP endpoint) — receives Telegram messages so you can register your chat ID with /start

Setup (3 steps)

Step 1: Create a Telegram bot

  1. Open Telegram and message @BotFather
  2. Send /newbot
  3. Give it a name (e.g. "Dubai Disaster Alerts") and a username
  4. Copy the bot token it gives you

Step 2: Add the bot token as an env var

šŸ‘‰ Add TELEGRAM_TOKEN here: https://www.val.town/x/aunova/dubai-disaster-alerts/environment-variables?key=TELEGRAM_TOKEN

Step 3: Register your webhook & chat ID

  1. Run main.ts (click Run) — this registers the webhook with Telegram
  2. Open Telegram, find your bot, and send /start
  3. The bot will confirm registration āœ…

You're done! You'll receive disaster alerts every 15 minutes.

Bot commands

CommandDescription
/startRegister your chat ID to receive alerts
/testSend a test alert to verify everything works
/statusCheck system status

What it monitors

  • 🚨 Disasters & emergencies — earthquakes, floods, fires, explosions, storms, building collapses
  • šŸ„ Health crises — disease outbreaks, epidemics, contamination, chemical spills, biohazards
  • šŸ”’ Security threats — attacks, terrorism, bombings, kidnappings, evacuations, state of emergency
  • āš”ļø War & conflict — missiles, airstrikes, shelling, military operations, casualties

Architecture

Google News RSS (UAE-focused)
        │
        ā–¼
  monitor.ts (every 15 min)
        │
        ā”œā”€ā”€ lib/news.ts ──► Parse + filter (disaster keywords + UAE location)
        ā”œā”€ā”€ lib/db.ts ─────► Deduplicate via SQLite
        └── lib/telegram.ts ā–ŗ Send DM via Telegram Bot API
                                  │
                                  ā–¼
                          Your Telegram inbox šŸ“±

Notes

  • Free tier: checks every 15 minutes (minimum interval on free plan). Upgrade to Pro for 1-minute checks.
  • Deduplication: each article URL is stored in SQLite — you'll never get the same alert twice.
  • Auto-cleanup: sent alert records older than 30 days are automatically removed.
  • Source: Google News RSS aggregating from Khaleej Times, The National, Gulf News, Reuters, AP, and many more.

Environment Variables

KeyDescription
TELEGRAM_TOKENBot token from @BotFather