mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-01-26 20:36:17 +00:00
28 lines
949 B
JavaScript
28 lines
949 B
JavaScript
var request = require('request');
|
|
request(
|
|
{ method: 'GET'
|
|
, uri: "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=47820652"
|
|
, gzip: true,
|
|
timeout: 1500
|
|
}
|
|
, function (error, response, body) {
|
|
// body is the decompressed response body
|
|
if (error !== undefined) {
|
|
console.error(error);
|
|
}
|
|
console.log(request);
|
|
console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))
|
|
console.log('the decoded data is: ' + body)
|
|
}
|
|
)
|
|
.on('data', function(data) {
|
|
// decompressed data as it is received
|
|
console.log('decoded chunk: ' + data)
|
|
})
|
|
.on('response', function(response) {
|
|
// unmodified http.IncomingMessage object
|
|
response.on('data', function(data) {
|
|
// compressed data as it is received
|
|
console.log('received ' + data.length + ' bytes of compressed data')
|
|
})
|
|
}); |