Last active
November 3, 2018 21:13
-
-
Save lalabuy948/4199ce298883f391adbb0ad417576ac4 to your computer and use it in GitHub Desktop.
This file contains 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
const http = require('http'); | |
const link = 'http://387338.xyz:8000/status-json.xsl' | |
http.get(link, (resp) => { | |
let data = ''; | |
// A chunk of data has been recieved. | |
resp.on('data', (chunk) => { | |
data += chunk; | |
}); | |
// The whole response has been received. Print out the result. | |
resp.on('end', () => { | |
console.log(JSON.parse(data).icestats.source.title); | |
}); | |
}).on("error", (err) => { | |
console.log("Error: " + err.message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment