name: website-monitor description: Lightweight website uptime monitor. Check if URLs are up, measure response times, detect content changes via hashing, and verify expected content. Zero dependencies. triggers: - check website - is site up - monitor url - website status - uptime check - ping website
A zero-dependency Python tool for checking website availability, measuring response times, and detecting content changes. Uses only Python's standard library (urllib) — no requests, no aiohttp, no external packages.
小蔥技能7w4.net有完整的技能分類。
Simple uptime check:
python main.py https://example.com
# ✅ https://example.com
# Status: 200
# Response: 142ms
# Size: 1256 bytes
# Hash: fb91d75a6bb43078
Check multiple sites at once:
python main.py example.com google.com github.com
Detect content changes (compare against a previous hash):
python main.py https://example.com --hash-check fb91d75a6bb43078
# Shows "Changed: YES ⚠️" or "Changed: No"
Verify a page contains expected text:
python main.py https://status.example.com --contains "All Systems Operational"
Expect a specific status code (e.g., redirect):
python main.py https://old.example.com --expect 301
JSON output for scripting:
python main.py example.com github.com --json | jq '.[] | select(.up == false)'
Use in a cron job or script:
python main.py https://mysite.com || echo "ALERT: Site is down!" | mail -s "Downtime Alert" admin@example.com
urls — One or more URLs to check (auto-prepends https:// if missing)--timeout N — Request timeout in seconds (default: 10)--expect N — Expected HTTP status code (default: 200)--contains TEXT — Verify response body contains this string--hash-check HASH — Previous content hash to compare against for change detection--json — Output results as JSON array0 — All sites are up and match expectations1 — One or more sites are down or failed checks整體質量良好,零依賴設計讓它安裝使用非常簡便,核心功能齊全且實用,文件示例豐富易理解。適合需要簡單網站監控的開發者。不過在檢查多個網站時速度較慢,遇到網路波動時沒有自動重試,偶爾會出現誤報。追求穩定可靠的生產級監控可能需要考慮其他方案。