Skip to content

Instantly share code, notes, and snippets.

@jt0in3e
Forked from anonymous/node.js
Last active October 30, 2017 10:02
Show Gist options
  • Save jt0in3e/4f19f48c501f76ba3a0064a01c87b1fa to your computer and use it in GitHub Desktop.
Save jt0in3e/4f19f48c501f76ba3a0064a01c87b1fa to your computer and use it in GitHub Desktop.
GET tv-programme in NODE.js / Our style
"use strict"
const request = require('request')
const fs = require('fs');
const zlib = require('zlib');
const opts = {
url: "https://iptvx.one/epg/epg.xml.gz",
headers: {
"User-Agent": "request"
}
}
request(opts, (err, res, body) => {
if (res.statusCode==206) {console.log("Fuck")}
else if (res.statusCode == 200) {
console.log("Not fuck 200")
}
if (err) {console.log("kill them all")}
}).pipe(zlib.createGunzip()).pipe(fs.createWriteStream("NEW.xml"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment