Skip to content

Commit f899b00

Browse files
author
Ubuntu
committed
entries inside feed
1 parent f1624e7 commit f899b00

File tree

2 files changed

+280
-281
lines changed

2 files changed

+280
-281
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var stripHtml = function(str) {
1919
Parser.parseString = function(xml, callback) {
2020
XML2JS.parseString(xml, function(err, result) {
2121
if (err) throw err;
22-
var json = {feed: {}};
22+
var json = {feed: {entries: []}};
2323
var channel = result.rss.channel[0];
2424
if (channel['atom:link']) json.feed.feedUrl = channel['atom:link'][0].href;
2525
TOP_FIELDS.forEach(function(f) {
@@ -39,8 +39,7 @@ Parser.parseString = function(xml, callback) {
3939
entry.guid = item.guid[0]._;
4040
}
4141
entry.categories = item.category;
42-
json.entries = json.entries || [];
43-
json.entries.push(entry);
42+
json.feed.entries.push(entry);
4443
})
4544
callback(null, json);
4645
});

0 commit comments

Comments
 (0)