Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
7 years ago
Commit
111a6b321a4ad9e832720c4427978c20a2473433
1 parent
9dd61dd0
rss-link-err-fixed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
apps/guang/controllers/rss.js
apps/guang/views/action/rss/index.hbs
apps/guang/controllers/rss.js
View file @
111a6b3
...
...
@@ -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'
;
...
...
apps/guang/views/action/rss/index.hbs
View file @
111a6b3
<?xml version='1.0' encoding='utf-8'?>
<rss
version=
'2.0'
>
<channel>
<language>
zh-cn
</language>
<language>
zh-cn
</language>
<title>
<![CDATA[有货逛]]>
</title>
<link>
<![CDATA[http://yohobuy.com]]>
</link>
<description>
<![CDATA[Yoho!Buy有货 | 年轻人潮流购物中心]]>
</description>
...
...
@@ -17,13 +17,13 @@
{{#
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>
<author>
有货
</author>
</item>
{{/
items
}}
</channel>
</rss>
\ No newline at end of file
</rss>
...
...
Please
register
or
login
to post a comment