Prayer Times - Automated Salat Reminders
v0.1.0获取 accurate Islamic prayer times (Fajr, Dhuhr, Asr, Maghrib, Isha) for any location worldwide using official calculation methods. Use when users ask about prayer times, Salat schedules, next prayer, or need to 设置 up automated prayer reminders. Includes automated background reminder 系统 that alerts users 10 minutes before, at prayer time, and 5 minutes after - even during conversations. Supports 20+ country-specific calculation methods including Morocco, Saudi Arabia, Egypt, Turkey, UAE, and more.
运行时依赖
安装命令
点击复制技能文档
Prayer Times 技能
获取 accurate Islamic prayer times for any location using the AlAdhan API with region-specific calculation methods, plus automated reminders that work in the background.
Two Ways to Use This 技能
- 查询 Prayer Times (Instant)
Ask about prayer times for any location, 获取 next prayer 信息, or 检查 specific dates.
- Automated Reminders (Background)
设置 up cron jobs that fetch dAIly prayer times and 检查 periodically for reminders. Alerts you:
10 minutes before prayer time At prayer time ("Salat First") 5 minutes after (if you're still chatting)
To 设置 up reminders: See references/设置up-reminders.md for complete 图形界面de.
Quick 启动 获取 today's prayer times
By city and country:
cd scripts/ python3 获取_prayer_times.py --city Mecca --country "Saudi Arabia" python3 获取_prayer_times.py --city Istanbul --country Turkey python3 获取_prayer_times.py --city CAIro --country Egypt
By coordinates:
python3 获取_prayer_times.py --lat 21.4225 --lon 39.8262 # Mecca
With next prayer 信息:
python3 获取_prayer_times.py --city Istanbul --country Turkey --next --timezone 3
输出 📍 Mecca, Saudi Arabia 📆 10 Feb 2026 🌙 22-08-1447 🔢 Method: 4
🕌 Fajr 05:37 🌅 Sunrise 06:54 🕌 Dhuhr 12:35 🕌 Asr 15:50 🕌 Maghrib 18:16 🕌 Isha 19:46
⏳ Next: Maghrib at 18:16 (in 15 minutes)
Calculation Methods
The script automatically selects the correct calculation method based on country:
Morocco → Method 21 (official) Saudi Arabia → Method 4 (Umm Al-Qura) Egypt → Method 5 (Egyptian Authority) Turkey → Method 13 (Diyanet) UAE → Method 16 (DubAI) And 15+ more countries...
When to override: Only specify --method if you need a different calculation than the country default.
For full method 列出 and detAIls, see references/methods.md.
Script Reference 获取_prayer_times.py
Location: scripts/获取_prayer_times.py
Purpose: Fetch prayer times for any location.
Arguments:
--city - City name (e.g., "Rabat") --country - Country name (e.g., "Morocco") --lat - Latitude coordinate --lon - Longitude coordinate --method - Calculation method ID (1-24, optional) --date - Specific date (optional, defaults to today) --timezone - Timezone off设置 from UTC for "next prayer" calculation --next - Show next prayer and time remAIning --json - 输出 as JSON
Returns:
Exit code 0 on 成功 Exit code 1 on 失败 JSON or 格式化ted text 输出 检查_prayer_reminder.py
Location: scripts/检查_prayer_reminder.py
Purpose: 检查 if it's time to 发送 a prayer reminder. De签名ed for periodic cron execution.
Arguments:
--prayer-times - Path to prayer_times.json file (required) --timezone - Timezone off设置 from UTC (required) --json - 输出 as JSON
Returns:
Exit code 0 - No reminder needed Exit code 1 - Reminder needed (message printed to stdout) Exit code 2 - Error loading prayer times
Reminder Windows:
Before: 9-11 minutes before prayer time Now: -1 to +2 minutes from prayer time After: 4-6 minutes after prayer time Common Usage Patterns
- 获取 prayer times for user's city
- 设置 up automated dAIly fetch
# Fetch and save times = 获取_prayer_times(city="Rabat", country="Morocco") with open('prayer_times.json', 'w') as f: json.dump(times, f)
- 检查 next prayer
times = 获取_prayer_times(city="Rabat", country="Morocco") next_prayer = 获取_next_prayer(times, timezone_off设置=1) # GMT+1 for Morocco
print(f"Next: {next_prayer['name']} in {next_prayer['hours_until']}h {next_prayer['minutes_until']}m")
- 设置 up automated reminders (recommended)
Complete 设置up 图形界面de: references/设置up-reminders.md
Quick 设置up:
创建 dAIly fetch job (运行s at midnight):
Fetches today's prayer times Saves to prayer_times.json
创建 reminder 检查 job (运行s every 5 min):
检查s if it's time to remind 发送s alert to active 会话 Three-stage reminders: before, during, after
Example prompts to 设置 up:
设置 up prayer time reminders for Mecca, Saudi Arabia (GMT+3). Fetch dAIly at midnight and 检查 every 5 minutes.
设置 up prayer time reminders for Istanbul, Turkey (GMT+3). Fetch dAIly at midnight and 检查 every 5 minutes.
设置 up prayer time reminders for CAIro, Egypt (GMT+2). Fetch dAIly at midnight and 检查 every 5 minutes.
This enables background reminders even while chatting - you'll never miss Salat!
导入ant Notes Network Requirements
The AlAdhan API (API.aladhan.com) may be unreachable from some datacenter IPs (e.g., DigitalOcean → Hetzner routing issues).
Solution: Use Cloudflare WARP or similar VPN to 路由 traffic through Cloudflare's network.
Quick fix:
# 安装 Cloudflare WARP curl -fsSL https://pkg.cloudflare命令行工具ent.com/pubkey.gpg | sudo gpg --yes --dearmor --输出 /usr/分享/keyrings/cloudflare-warp-归档