From 612e30747a5dc2b5ec8e2b112de8be925bd1ebbb Mon Sep 17 00:00:00 2001
From: junfengP <840282629@qq.com>
Date: Thu, 6 Jun 2019 11:55:40 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0005.tv=E7=9A=84?=
=?UTF-8?q?=E4=BA=8C=E6=AC=A1=E5=85=83=E8=B5=84=E8=AE=AF=20(#2335)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/anime.md | 5 +++++
lib/router.js | 3 +++
lib/routes/005tv/zx.js | 49 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+)
create mode 100644 lib/routes/005tv/zx.js
diff --git a/docs/anime.md b/docs/anime.md
index addf38fed..0767aba9d 100644
--- a/docs/anime.md
+++ b/docs/anime.md
@@ -4,6 +4,11 @@ pageClass: routes
# 二次元
+## 005.tv
+
+### 二次元资讯
+
+
## Anime1
### 動畫
diff --git a/lib/router.js b/lib/router.js
index 69d49ba66..fcbd1b813 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -1386,4 +1386,7 @@ router.get('/yxdzqb/:type', require('./routes/yxdzqb'));
// 怪物猎人
router.get('/monsterhunter/update', require('./routes/monsterhunter/update'));
+// 005.tv
+router.get('/005tv/zx/latest', require('./routes/005tv/zx'));
+
module.exports = router;
diff --git a/lib/routes/005tv/zx.js b/lib/routes/005tv/zx.js
new file mode 100644
index 000000000..eb77800de
--- /dev/null
+++ b/lib/routes/005tv/zx.js
@@ -0,0 +1,49 @@
+const got = require('@/utils/got');
+const host = 'http://www.005.tv/zx';
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const response = await got(host);
+ const data = response.body;
+ const $ = cheerio.load(data);
+ const list = $('div.article-list li');
+ ctx.state.data = {
+ title: $('head > title').text(),
+ link: host,
+ description: '二次元资讯',
+ item: list
+ .map((index, item) => ({
+ title: $(item)
+ .find('h3 > a')
+ .text()
+ .trim(),
+ description: `
+ ${$(item)
+ .find('div.p-row')
+ .text()}`,
+ link: $(item)
+ .find('h3 > a')
+ .attr('href'),
+ pubDate: new Date(
+ $(item)
+ .find('span.fr.time')
+ .text()
+ .trim()
+ .substr(0, 4),
+ $(item)
+ .find('span.fr.time')
+ .text()
+ .trim()
+ .substr(5, 2),
+ $(item)
+ .find('span.fr.time')
+ .text()
+ .trim()
+ .substr(8, 4)
+ ).toUTCString(),
+ }))
+ .get(),
+ };
+};