...
|
...
|
@@ -50,7 +50,7 @@ const index = (req, res, next) => { |
|
|
return res.send(feed.render('rss-2.0'))
|
|
|
});
|
|
|
};
|
|
|
const rss = (req, res, next) => {
|
|
|
const rss = (req, res, next, gmt = '') => {
|
|
|
let gender = req.query.gender || '1,2,3',
|
|
|
items = [];
|
|
|
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
|
...
|
...
|
@@ -60,8 +60,10 @@ const rss = (req, res, next) => { |
|
|
}
|
|
|
_.forEach(result, item => {
|
|
|
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://'+item.url;
|
|
|
|
|
|
item.publishTime = moment(new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, "MM月DD日 HH:mm"))).format('YYYY-MM-DD hh:mm:ss +0800')
|
|
|
let time = new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, "MM月DD日 HH:mm"));
|
|
|
console.log(gmt)
|
|
|
let format = gmt ? time : moment(time).format('YYYY-MM-DD hh:mm:ss +0800');
|
|
|
item.publishTime = format;
|
|
|
});
|
|
|
return res.render('rss/index', {
|
|
|
layout: false,
|
...
|
...
|
|