Showing
2 changed files
with
6 additions
and
7 deletions
@@ -33,10 +33,9 @@ const index = (req, res, next) => { | @@ -33,10 +33,9 @@ const index = (req, res, next) => { | ||
33 | }); | 33 | }); |
34 | 34 | ||
35 | _.forEach(result, item => { | 35 | _.forEach(result, item => { |
36 | - item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url; | ||
37 | feed.addItem({ | 36 | feed.addItem({ |
38 | title: item.title, | 37 | title: item.title, |
39 | - link: `${item.url}&ref=rss`, | 38 | + link: `https://m.yohobuy.com/guang/${item.id}.html?ref=rss`, |
40 | description: item.intro, | 39 | description: item.intro, |
41 | author: [{ | 40 | author: [{ |
42 | name: (item.author && item.author.name) || ' ' | 41 | name: (item.author && item.author.name) || ' ' |
@@ -60,7 +59,7 @@ const rss = (req, res, next, gmt) => { | @@ -60,7 +59,7 @@ const rss = (req, res, next, gmt) => { | ||
60 | return next(); | 59 | return next(); |
61 | } | 60 | } |
62 | _.forEach(result, item => { | 61 | _.forEach(result, item => { |
63 | - item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url; | 62 | + item.url = `https://m.yohobuy.com/guang/${item.id}.html?ref=rss`; |
64 | let time = new Date(item.publishTimeLong && | 63 | let time = new Date(item.publishTimeLong && |
65 | parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm')); | 64 | parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm')); |
66 | let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800'; | 65 | let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800'; |
1 | <?xml version='1.0' encoding='utf-8'?> | 1 | <?xml version='1.0' encoding='utf-8'?> |
2 | <rss version='2.0'> | 2 | <rss version='2.0'> |
3 | <channel> | 3 | <channel> |
4 | - <language>zh-cn</language> | 4 | + <language>zh-cn</language> |
5 | <title><![CDATA[有货逛]]></title> | 5 | <title><![CDATA[有货逛]]></title> |
6 | <link><![CDATA[http://yohobuy.com]]></link> | 6 | <link><![CDATA[http://yohobuy.com]]></link> |
7 | <description><![CDATA[Yoho!Buy有货 | 年轻人潮流购物中心]]></description> | 7 | <description><![CDATA[Yoho!Buy有货 | 年轻人潮流购物中心]]></description> |
@@ -17,13 +17,13 @@ | @@ -17,13 +17,13 @@ | ||
17 | {{# items}} | 17 | {{# items}} |
18 | <item> | 18 | <item> |
19 | <title><![CDATA[{{title}}]]></title> | 19 | <title><![CDATA[{{title}}]]></title> |
20 | - <link><![CDATA[{{{url}}}&ref=rss]]></link> | 20 | + <link><![CDATA[{{{url}}}]]></link> |
21 | <description><![CDATA[{{{intro}}}]]></description> | 21 | <description><![CDATA[{{{intro}}}]]></description> |
22 | <pubDate><![CDATA[{{publishTime}}]]></pubDate> | 22 | <pubDate><![CDATA[{{publishTime}}]]></pubDate> |
23 | <source><![CDATA[有货逛]]></source> | 23 | <source><![CDATA[有货逛]]></source> |
24 | <author>有货</author> | 24 | <author>有货</author> |
25 | </item> | 25 | </item> |
26 | {{/items}} | 26 | {{/items}} |
27 | - | 27 | + |
28 | </channel> | 28 | </channel> |
29 | -</rss> | ||
29 | +</rss> |
-
Please register or login to post a comment