add: ebb.io (#1464)

This commit is contained in:
Tsuki 2019-01-31 14:47:21 +08:00 committed by DIYgod
parent cc7d8ed4a1
commit d202869bfa
5 changed files with 34 additions and 0 deletions

View File

@ -1153,6 +1153,10 @@ GitHub 官方也提供了一些 RSS:
</route>
### ebb.io
<route name="ebb" author="Tsuki" example="/ebb" path="/ebb"/>
## 程序更新
### RSSHub

View File

@ -1034,4 +1034,7 @@ router.get('/animen/news/:type', require('./routes/animen/news'));
// D2 资源库
router.get('/d2/daily', require('./routes/d2/daily'));
// ebb
router.get('/ebb', require('./routes/ebb'));
module.exports = router;

21
lib/routes/ebb/index.js Normal file
View File

@ -0,0 +1,21 @@
const axios = require('../../utils/axios');
const lzstring = require('lz-string');
module.exports = async (ctx) => {
const url = 'https://ebb.io/_/anime_list';
const response = await axios({
method: 'get',
url: url,
headers: {
Referer: url,
},
return: 'string',
});
const responseData = JSON.parse(lzstring.decompressFromUTF16(response.data));
const result = responseData.map((item) => ({
title: item.name_chi,
link: `https://ebb.io/anime/${item.anime_id}x${item.season_id}`,
description: `${item.season_title} - ${item.episode_title}`,
guid: `${item.anime_id}-${item.season_id}-${item.episode_title}`,
}));
ctx.state.data = { title: 'ebb.io', link: 'https://ebb.io', description: '最新連載', item: result };
};

View File

@ -66,6 +66,7 @@
"koa-router": "7.4.0",
"lru-cache": "5.1.1",
"luxon": "^1.7.1",
"lz-string": "^1.4.4",
"markdown-it": "^8.4.2",
"node-fetch": "^2.3.0",
"path-to-regexp": "3.0.0",

View File

@ -6318,6 +6318,11 @@ luxon@^1.7.1:
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.10.0.tgz#335b55e2fed50e09f869aee828897a3f67c7044e"
integrity sha512-ry3GKh//v3isD6oJN5pFWmdh+3GiScwv9q8VgG6fZ2j1guGOol2vVVdo4GBAWCrcq5RHOqSeipqHBnOu/u024Q==
lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=
make-dir@^1.0.0, make-dir@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"