To connect to Earthquake Streams data feed you need to use a pusher library such as https://github.com/pusher/pusher-js
Live Demo Code @ https://codepen.io/mapdev/pen/XaexdY
To connect you need
- Pusher Key: cb8e92ce5edfd617ee0a
- Pusher Cluster: mt1
- Event Name: earthquake
- Channels [all]
Currently there is only the one channel all but other will be available soon
There are 6 channels:
- all
- minor
- light
- strong
- significant
- tsunami
- All data is fired to a earthquake event
- All earthquake alerts are sent to the all channel
- Significant earthquakes are sent to the significant channel
- Earthquakes that may create a tsunami are sent to the tsunami channel
- The other three channels, minor, light, and strong are based on magnitudes <2.5, <4.5, and >4.5 respectivily
Below is a code snippet to connect in JavaScript
Include this in the <head>
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
Setup Pusher
var pusher = new Pusher('cb8e92ce5edfd617ee0a', {
cluster: 'mt1'
});
Connect to a specific channel
var channel = pusher.subscribe('all');
Listen for an earthquake
channel.bind('earthquake', function(data) {
console.log(data);
});
Hi @wowcut - Earthquake Stream has been in hibernation and has only just been restarted. Should be working now