π Real-time earthquake monitoring for China, Taiwan, and Japan. CENC/CWA/JMA data with proactive alerting. v1.1.1 - Multi-language (zh/en/ja), pinyin locati...
---
name: earthquake-monitor
description: "π Real-time earthquake monitoring for China, Taiwan, and Japan. CENC/CWA/JMA data with proactive alerting. v1.1.1 - Multi-language (zh/en/ja), pinyin location matching, optimized cache"
homepage: https://github.com/fungjcode/earthquake-monitor
metadata:
openclaw:
emoji: "π"
requires:
bins: ["curl"]
node: ">=18"
---
# π Earthquake Monitor v1.1.1
Real-time earthquake monitoring for China (CENC), Taiwan (CWA), and Japan (JMA) with proactive alerting.
## v1.1.1 Changelog
### v1.1.1 (Security Fix)
- π **Security Update** - Removed encryption for ClawHub compatibility
- π Added SECURITY.md documentation
### v1.1.0 Features
- π **Multi-language Support** - Alert messages in Chinese, English, and Japanese
- π **Location Fuzzy Matching** - Supports pinyin (dali), abbreviations (DL), partial match (da)
- β‘ **Performance Optimization** - Shared cache module with auto-cleanup
- β
**Fixed** Taiwan (CWA) data source integration
- β
**Improved** notification deduplication logic
---
## Quick Start
```javascript
// Initialize monitoring
await init({ location: "ε€§η" })
// Get latest earthquakes
await getAll()
// Start proactive monitoring
await start()
```
---
## Data Sources
| Source | Region | Language (Alert) | Description |
|--------|--------|------------------|-------------|
| CENC | π¨π³ China | δΈζ | China Earthquake Networks Center |
| CWA | πΉπΌ Taiwan | δΈζ | Central Weather Administration |
| JMA | π―π΅ Japan | ζ₯ζ¬θͺ | Japan Meteorological Agency |
---
## API Reference
### init(options)
Initialize configuration.
```javascript
await init({
location: "dali", // City name (supports pinyin, abbreviations)
distanceThreshold: 300, // Alert distance in km
minMagnitude: 3.0, // Minimum magnitude
language: 'zh', // Language: zh/en/ja
sources: { // Toggle data sources
CENC: true,
JMA: true,
CWA: true
}
})
```
### getAll(options)
Get earthquakes from all sources.
```javascript
const result = await getAll({ limit: 5 })
// Returns: { earthquakes, totalCount, nearbyEarthquakes, hasAlert, alertMessage }
```
### getCENC(limit)
Get China earthquake data.
```javascript
const { earthquakes } = await getCENC(10)
```
### getJMA(limit)
Get Japan earthquake data.
```javascript
const { earthquakes } = await getJMA(10)
```
### getCWA()
Get Taiwan earthquake early warning data.
```javascript
const { earthquakes, isWarning } = await getCWA()
```
### start(options)
Start proactive monitoring with auto-alerts.
```javascript
await start({ interval: 60000 }) // Check every 60 seconds
```
### stop()
Stop monitoring.
```javascript
await stop()
```
### config(newConfig)
View or update configuration.
```javascript
// View
const cfg = await config()
// Update
await config({ language: 'en', minMagnitude: 4.0 })
```
### cities()
List all supported cities with coordinates.
```javascript
const { cities } = await cities()
```
---
## Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| location | string/object | ε€§η | City name or {name, latitude, longitude} |
| distanceThreshold | number | 300 | Alert distance in km |
| minMagnitude | number | 3.0 | Minimum earthquake magnitude |
| language | string | zh | Alert language: zh/en/ja |
| sources.CENC | boolean | true | Enable China data |
| sources.JMA | boolean | true | Enable Japan data |
| sources.CWA | boolean | true | Enable Taiwan data |
| webhook | string | null | Encrypted webhook URL |
---
## Supported Cities (20+)
| City | Pinyin | Abbr | Coordinates |
|------|--------|------|-------------|
| ε€§η | dali, dal, dl | DL | 25.61Β°N, 100.27Β°E |
| εδΊ¬ | beijing, bj, b | BJ | 39.90Β°N, 116.40Β°E |
| δΈζ΅· | shanghai, sh, s | SH | 31.23Β°N, 121.47Β°E |
| ζζ | kunming, km, k | KM | 25.04Β°N, 102.71Β°E |
| ζι½ | chengdu, cd, c | CD | 30.57Β°N, 104.07Β°E |
| δΈδΊ¬ | tokyo, dj, d | DJ | 35.68Β°N, 139.69Β°E |
| ... | ... | ... | ... |
### Location Matching Examples
All these return Beijing:
```javascript
await init({ location: 'εδΊ¬' }) // Chinese
await init({ location: 'beijing' }) // Full pinyin
await init({ location: 'bj' }) // Abbreviation
await init({ location: 'bei' }) // Partial match
```
---
## Multi-Language Alerts
Alert language is automatically selected based on earthquake source:
| Source | Language | Example |
|--------|----------|---------|
| CENC (China) | δΈζ | β οΈ ε°ιι’θ¦ζιοΌ |
| CWA (Taiwan) | δΈζ | β οΈ ε°ιι’θ¦ζιοΌ |
| JMA (Japan) | ζ₯ζ¬θͺ | β οΈ ε°ιγ’γ©γΌγοΌ |
### Manual Language Override
```javascript
// Set preferred language (applies to alert format)
await init({ language: 'en' })
// All alerts will be in English regardless of source
```
### Alert Message Format
```
β οΈ Earthquake Alert!
π Epicenter near Dali:
1. π΄ M7.6ηΊ§ [δΈε½ε°ιε°η½]
π ζ±€ε ηΎ€ε²
π Distance: 5000km
β° 2026-03-24 12:37:50
π Depth: 250km
Please stay safe!
```
---
## Security
Webhook URLs are encrypted using AES-256-CBC before storing in config file:
```javascript
// Set webhook (automatically encrypted)
await config({ webhook: 'https://oapi.dingtalk.com/robot/send?access_token=xxx' })
// Stored encrypted, decrypted only in memory
```
---
## Performance
### Shared Cache
- Reduces redundant API calls
- TTL-based expiration (1 minute default)
- Auto-cleanup every 5 minutes
### Parallel Fetching
- All three data sources fetched simultaneously
- Fast response time
---
## Return Format
```javascript
{
timestamp: "2026-03-24T14:30:00.000Z",
sources: [
{ source: "CENC", sourceName: "δΈε½ε°ιε°η½", count: 10, earthquakes: [...] },
{ source: "JMA", sourceName: "ζ₯ζ¬ζ°θ±‘ε
", count: 5, earthquakes: [...] }
],
earthquakes: [...], // Merged, sorted by time
totalCount: 15,
nearbyEarthquakes: [...], // Within distanceThreshold
hasAlert: true/false,
alertMessage: "..." // Formatted alert string
}
```
---
## Notes
- π Data from official government agencies (CENC/CWA/JMA)
- π No API key required
- π‘ WebSocket + HTTP fallback
- π Auto-retry on failure
---
## Support
- Author: fungjcode
- GitHub: https://github.com/fungjcode/earthquake-monitor
- Report issues at: https://github.com/fungjcode/earthquake-monitor/issues
don't have the plugin yet? install it then click "run inline in claude" again.