RSS feed url bug fix

This commit is contained in:
Delgermurun 2014-11-18 09:45:33 +08:00
parent d89687b25e
commit e61f5bcd47
2 changed files with 7 additions and 7 deletions

View file

@ -8,7 +8,7 @@ Meteor.startup(function () {
where: 'server',
path: '/feed.xml',
action: function() {
this.response.write(servePostRSS('new'));
this.response.write(servePostRSS('new', 'feed.xml'));
this.response.end();
}
});
@ -17,9 +17,9 @@ Meteor.startup(function () {
this.route('feed', {
where: 'server',
path: 'rss/posts/top.xml',
path: '/rss/posts/top.xml',
action: function() {
this.response.write(servePostRSS('top'));
this.response.write(servePostRSS('top', 'rss/posts/top.xml'));
this.response.end();
}
});
@ -28,9 +28,9 @@ Meteor.startup(function () {
this.route('feed', {
where: 'server',
path: 'rss/posts/best.xml',
path: '/rss/posts/best.xml',
action: function() {
this.response.write(servePostRSS('best'));
this.response.write(servePostRSS('best', 'rss/posts/best.xml'));
this.response.end();
}
});

View file

@ -10,8 +10,8 @@ var getMeta = function(url) {
};
};
servePostRSS = function(view) {
var feed = new RSS(getMeta('feed.xml'));
servePostRSS = function(view, url) {
var feed = new RSS(getMeta(url));
var params = getPostsParameters({view: view, limit: 20});
delete params['options']['sort']['sticky'];