Skip to content

Instantly share code, notes, and snippets.

@lalabuy948
Last active November 3, 2018 21:13
Show Gist options
  • Save lalabuy948/4199ce298883f391adbb0ad417576ac4 to your computer and use it in GitHub Desktop.
Save lalabuy948/4199ce298883f391adbb0ad417576ac4 to your computer and use it in GitHub Desktop.
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