Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update FeedParser and OpmlParser. Bump version: v0.3.0

  • Loading branch information...
commit 0b32cb1d8c2326b109ab817cca57eeed97108549 1 parent 6b7368f
@danmactough authored
View
0  README.markdown → README.md
File renamed without changes
View
6 package.json
@@ -2,7 +2,7 @@
"name": "parserproxy",
"author": "Dan MacTough <danmactough@gmail.com>",
"description": "A JSON-over-HTTP proxy for node-feedparser and node-opmlparser",
- "version": "0.2.0",
+ "version": "0.3.0",
"repository": {
"type": "git",
"url": "git://github.com/danmactough/node-parserproxy.git"
@@ -13,8 +13,8 @@
"node": ">= 0.4.0"
},
"dependencies": {
- "feedparser": "0.9.x",
- "opmlparser": "0.3.x",
+ "feedparser": "0.10.x",
+ "opmlparser": "0.4.x",
"request": "2.9.x"
},
"devDependencies": {}
View
11 server.js
@@ -24,7 +24,6 @@ function parserproxy (options){
var server = http.createServer(function (req, res) {
var data = ''
- , parser
, respond
;
req.body = {};
@@ -102,7 +101,6 @@ function parserproxy (options){
switch (req.urlObj.pathname) {
case '/parseFeed':
- parser = new FeedParser();
respond = function (err, meta, articles){
if (err) {
if (+err >= 400) {
@@ -117,8 +115,8 @@ function parserproxy (options){
}
};
- if (typeof req.body == 'string') _parse(parser, req.body, respond);
- else if ('url' in req.body || 'uri' in req.body) _request(parser, req.body, respond);
+ if (typeof req.body == 'string') _parse(FeedParser, req.body, respond);
+ else if ('url' in req.body || 'uri' in req.body) _request(FeedParser, req.body, respond);
else {
res.statusCode = 400;
res.end();
@@ -126,7 +124,6 @@ function parserproxy (options){
break;
case '/parseOpml':
- parser = new OpmlParser();
respond = function (err, meta, feeds, outline){
if (err) {
if (+err >= 400) {
@@ -141,8 +138,8 @@ function parserproxy (options){
}
};
- if (typeof req.body == 'string') _parse(parser, req.body, respond);
- else if ('url' in req.body || 'uri' in req.body) _request(parser, req.body, respond);
+ if (typeof req.body == 'string') _parse(new OpmlParser(), req.body, respond);
+ else if ('url' in req.body || 'uri' in req.body) _request(new OpmlParser(), req.body, respond);
else {
res.statusCode = 400;
res.end();
Please sign in to comment.
Something went wrong with that request. Please try again.