mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
rss: add author field to v2ex (#229)
* rss: add author field to v2ex * rss: add username to v2ex description * rss: v2ex use content_rendered to description
This commit is contained in:
@@ -27,12 +27,13 @@ module.exports = async (ctx) => {
|
||||
description: `V2EX-${title}`,
|
||||
item: data.map((item) => ({
|
||||
title: item.title,
|
||||
description: item.content,
|
||||
description: `${item.member.username}: ${item.content_rendered}`,
|
||||
content: item.content,
|
||||
content_rendered: item.content_rendered,
|
||||
pubDate: new Date(item.created * 1000).toUTCString(),
|
||||
guid: item.id,
|
||||
link: item.url,
|
||||
author: item.member.username,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
{
|
||||
"id": "{{ $value.guid || $value.link }}",
|
||||
"url": "{{ $value.link }}",
|
||||
"author": {
|
||||
"name": "{{ $value.author }}",
|
||||
},
|
||||
"external_url": "",
|
||||
"title": "{{ $value.title }}",
|
||||
"content_html": "{{ $value.content_rendered }}",
|
||||
|
||||
+2
-2
@@ -20,10 +20,10 @@
|
||||
<item>
|
||||
<title><![CDATA[{{@ $value.title }}]]></title>
|
||||
<description><![CDATA[{{@ $value.description || $value.title }}]]></description>
|
||||
{{ if $value.pubDate }}
|
||||
<pubDate>{{ $value.pubDate }}</pubDate>{{ /if }}
|
||||
{{ if $value.pubDate }}<pubDate>{{ $value.pubDate }}</pubDate>{{ /if }}
|
||||
<guid>{{ $value.guid || $value.link }}</guid>
|
||||
<link>{{ $value.link }}</link>
|
||||
{{ if $value.author }}<author><![CDATA[{{ $value.author }}]]></author>{{ /if }}
|
||||
</item>
|
||||
{{ /each }}
|
||||
</channel>
|
||||
|
||||
Reference in New Issue
Block a user