View Single Post
Old 06-08-2017, 04:03 PM  
tomash999
Confirmed User
 
Industry Role:
Join Date: Sep 2015
Posts: 88
You probably have Python installed

Code:
import urllib

url = ''
with open('data.json', 'w') as f:
    f.write(urllib.urlopen(url).read())
Or with NodeJS
Quote:
let fs = require('fs')
// let http = require('http')
let https = require('https')

let request = https.request({
host: '',
path: ''
}, function(res){
let data = ''
res.on('data', function(chunk){
data += chunk
})
res.on('end', function(){
// write data
console.log(data)
fs.writeFile('data.json', data, function(e){
if (e){
console.log(e.message)
}
})
})
})
request.on('error', function(e){
console.log(e.message)
})
request.end()
Keep in mind that the code might break if there is no response
tomash999 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote