Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olizilla/earthquake-emitter
I emit `earthquake` events with data about the location and magnitude.
https://github.com/olizilla/earthquake-emitter
Last synced: 9 days ago
JSON representation
I emit `earthquake` events with data about the location and magnitude.
- Host: GitHub
- URL: https://github.com/olizilla/earthquake-emitter
- Owner: olizilla
- License: agpl-3.0
- Created: 2016-04-24T11:42:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-24T13:01:43.000Z (over 8 years ago)
- Last Synced: 2024-12-20T20:13:33.141Z (14 days ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# earthquake-emitter
I emit `earthquake` events with data about the location and magnitude.
Usage:
```js
var quakes = new EarthquakeEmitter()
quakes.on('earthquake', (q) => console.log(q.properties.title))
// M 2.6 - 8km NW of Gerlach-Empire, Nevada
```Internally, I poll http://earthquake.usgs.gov for geojson data of quakes in
the last 2.5 days. I store the quake ids from the last response, and compare it
with the new response to figure out which quakes are new, and emit those ones.An average `earthquake` payload looks a bit like this: (there are many other properties)
```js
{
type: 'Feature',
properties: {
mag: 4.7,
place: '13km NNW of Kandrian, Papua New Guinea',
time: 1461410344330,
},
geometry: {
type: 'Point',
coordinates: [ 149.5163, -6.101, 61.89 ]
},
id: 'us20005l6g'
}
```---
A [(╯°□°)╯︵TABLEFLIP](https://tableflip.io) side project.