Created
September 9, 2017 21:09
-
-
Save anonymous/51f0a8fc6ce54b790e4fc69fe06282c6 to your computer and use it in GitHub Desktop.
GET tv-programme in NODE.js / Our style
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
"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