Last active
January 31, 2018 15:55
-
-
Save davidpiesse/658f74e41b3317a7c99335743b66e4d0 to your computer and use it in GitHub Desktop.
Revisions
-
davidpiesse revised this gist
Jan 31, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ To connect you need Currently there is only the one channel **all** but other will be available soon There are 6 channels: - all - minor - light -
davidpiesse revised this gist
Jan 31, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,10 +10,12 @@ To connect you need - Pusher Key: **cb8e92ce5edfd617ee0a** - Pusher Cluster: **mt1** - Event Name: **earthquake** - Channels **[all]** ### Channels Currently there is only the one channel **all** but other will be available soon There are 6 channels currently available - all - minor -
davidpiesse revised this gist
Aug 14, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ 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 ### Required Keys To connect you need -
davidpiesse revised this gist
Aug 2, 2017 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,14 @@ To connect to Earthquake Streams data feed you need to use a pusher library such as https://github.com/pusher/pusher-js ### Required Keys To connect you need - Pusher Key: **cb8e92ce5edfd617ee0a** - Pusher Cluster: **mt1** - Event Name: **earthquake** - Channels **[all,minor,light,strong,significant,tsunami]** ### Channels There are 6 channels currently available -
davidpiesse revised this gist
Aug 2, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ # Earthquake.stream To connect to Earthquake Streams data feed you need to use a pusher library such as https://github.com/pusher/pusher-js ### Channels There are 6 channels currently available - all @@ -18,7 +18,7 @@ There are 6 channels currently available > - 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 ### Code Below is a code snippet to connect in JavaScript -
davidpiesse revised this gist
Aug 2, 2017 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ ### Earthquake.stream To connect to Earthquake Streams data feed you need to use a pusher library such as https://github.com/pusher/pusher-js ## Channels There are 6 channels currently available - all @@ -18,6 +18,8 @@ There are 6 channels currently available > - 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 ## Code Below is a code snippet to connect in JavaScript Include this in the ```<head>``` -
davidpiesse revised this gist
Aug 2, 2017 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,17 @@ ###Earthquake.stream To connect to Earthquake Streams data feed you need to use a pusher library such as https://github.com/pusher/pusher-js ##Channels There are 6 channels currently available - 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 -
davidpiesse created this gist
Aug 2, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ To connect to Earthquake Streams data feed you need to use a pusher library such as https://github.com/pusher/pusher-js > **Channels:** > - There are 6 channels currently available - 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>``` ```html <script src="https://js.pusher.com/4.1/pusher.min.js"></script> ``` Setup Pusher ```javascript var pusher = new Pusher('cb8e92ce5edfd617ee0a', { cluster: 'mt1' }); ``` Connect to a specific channel ```javascript var channel = pusher.subscribe('all'); ``` Listen for an earthquake ```javascript channel.bind('earthquake', function(data) { console.log(data); }); ```