Created
February 10, 2017 13:41
-
-
Save Abbe98/0541e5fe99e1f78cbcef746c1b806059 to your computer and use it in GitHub Desktop.
Example of the stream.wikimedia.org API
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 characters
| var url = 'https://stream.wikimedia.org/v2/stream/recentchange'; | |
| var eventSource = new EventSource(url); | |
| eventSource.onmessage = function(event) { | |
| var data = JSON.parse(event.data); | |
| if (data.server_name == 'sv.wikipedia.org') { | |
| console.log(event) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment