mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-01-28 22:56:17 +00:00
23 lines
811 B
JavaScript
23 lines
811 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
|
||
|
}
|
||
|
, function (error, response, body) {
|
||
|
// body is the decompressed response body
|
||
|
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')
|
||
|
})
|
||
|
});
|