Authored by 毕凯

Merge branch 'feature/docker' of git.yoho.cn:fe/yohobuywap-node into feature/docker

... ... @@ -33,10 +33,9 @@ const index = (req, res, next) => {
});
_.forEach(result, item => {
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url;
feed.addItem({
title: item.title,
link: `${item.url}&ref=rss`,
link: `https://m.yohobuy.com/guang/${item.id}.html?ref=rss`,
description: item.intro,
author: [{
name: (item.author && item.author.name) || ' '
... ... @@ -60,7 +59,7 @@ const rss = (req, res, next, gmt) => {
return next();
}
_.forEach(result, item => {
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url;
item.url = `https://m.yohobuy.com/guang/${item.id}.html?ref=rss`;
let time = new Date(item.publishTimeLong &&
parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm'));
let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800';
... ...
... ... @@ -33,16 +33,16 @@ class RssModel extends global.yoho.BaseModel {
if (value.text) { // 文字
result += htmlProcess.removeHtml(htmlProcess.escapeToHtml(value.text.data.text)) + '<br/>';
} else if (value.singleImage) { // 单张图
result += `<img src="${helpers.image(value.singleImage.data[0].src, 640, 640)}"/><br/>`;
result += `<img src="https:${helpers.image(value.singleImage.data[0].src, 640, 640)}"/><br/>`;
} else if (value.smallPic && value.smallPic.data) { // 多张小图
value.smallPic.data.forEach((small) => {
result += `<img src="${helpers.image(small.src, 315, 420)}"/>`;
result += `<img src="https:${helpers.image(small.src, 315, 420)}"/>`;
});
result += '<br/>';
}
});
result += `<a href="http://guang.m.yohobuy.com/info/index?id=${id}">查看原文</a>`;
result += `<a href="https://m.yohobuy.com/guang/${id}.html?ref=rss">查看原文</a>`;
return result;
}
});
... ...
... ... @@ -17,7 +17,7 @@
{{# items}}
<item>
<title><![CDATA[{{title}}]]></title>
<link><![CDATA[{{{url}}}&ref=rss]]></link>
<link><![CDATA[{{{url}}}]]></link>
<description><![CDATA[{{{intro}}}]]></description>
<pubDate><![CDATA[{{publishTime}}]]></pubDate>
<source><![CDATA[有货逛]]></source>
... ...