mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Remove accept-header from feed parser request...
This commit is contained in:
parent
d782a5afb6
commit
7de54b9af2
@ -31,14 +31,14 @@ module.exports = function(RED) {
|
|||||||
var req = request(node.url, {timeout: 10000, pool: false});
|
var req = request(node.url, {timeout: 10000, pool: false});
|
||||||
//req.setMaxListeners(50);
|
//req.setMaxListeners(50);
|
||||||
//req.setHeader('user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36');
|
//req.setHeader('user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36');
|
||||||
req.setHeader('accept', 'text/html,application/xhtml+xml');
|
//req.setHeader('accept', 'text/html,application/xhtml+xml');
|
||||||
|
|
||||||
var feedparser = new FeedParser();
|
var feedparser = new FeedParser();
|
||||||
|
|
||||||
req.on('error', function(err) { node.error(err); });
|
req.on('error', function(err) { node.error(err); });
|
||||||
|
|
||||||
req.on('response', function(res) {
|
req.on('response', function(res) {
|
||||||
if (res.statusCode != 200) { node.warn(RED._("feedparse.errors.badstatuscode")); }
|
if (res.statusCode != 200) { node.warn(RED._("feedparse.errors.badstatuscode")+" "+res.statusCode); }
|
||||||
else { res.pipe(feedparser); }
|
else { res.pipe(feedparser); }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,25 +1,23 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-feedparser",
|
"name": "node-red-node-feedparser",
|
||||||
"version" : "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "A Node-RED node to get RSS Atom feeds.",
|
"description": "A Node-RED node to get RSS Atom feeds.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"feedparser" : "0.19.2",
|
"feedparser": "1.1.3",
|
||||||
"request" : "2.57.0"
|
"request": "2.61.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/node-red/node-red-nodes/tree/master/social/feedparser"
|
"url": "https://github.com/node-red/node-red-nodes/tree/master/social/feedparser"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"keywords": [ "node-red", "atom", "rss" ],
|
"keywords": [
|
||||||
|
"node-red",
|
||||||
|
"atom",
|
||||||
|
"rss"
|
||||||
|
],
|
||||||
"node-red": {
|
"node-red": {
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"feedparse": "32-feedparse.js"
|
"feedparse": "32-feedparse.js"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"author": {
|
|
||||||
"name": "Nick O'Leary",
|
|
||||||
"email": "knolleary@uk.ibm.com",
|
|
||||||
"url": "http://nodered.org"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user