feat(route): add Bangumi 成员关注动画榜 (#13818)

* feat(route): add Bangumi 成员关注动画榜

* fix

* Update lib/v2/bangumi/tv/other/followrank.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update website/docs/routes/anime.mdx

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update router.js

* Update router.js

* Update followrank.js

* Update followrank.js

* fix

---------
This commit is contained in:
Summer⛱
2023-11-17 22:16:28 +08:00
committed by GitHub
co-authored by Tony
parent 05d53e0148
commit d97836ea12
5 changed files with 54 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ module.exports = {
'/online': ['devinmugen'],
// bangumi.tv
'/tv/calendar/today': ['magic-akari'],
'/tv/followrank': ['honue'],
'/tv/group/:id': ['SettingDust'],
'/tv/person/:id': ['ylc395'],
'/tv/subject/:id': ['SettingDust'],
+6
View File
@@ -55,6 +55,12 @@ const bangumiTV = {
source: '/calendar',
target: '/bangumi/tv/calendar/today',
},
{
title: '成员关注动画榜',
docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
source: '/anime',
target: '/bangumi/tv/followrank',
},
],
};
+1
View File
@@ -5,6 +5,7 @@ module.exports = function (router) {
router.get('/online', require('./online/online'));
// bangumi.tv
router.get('/tv/calendar/today', require('./tv/calendar/today'));
router.get('/tv/followrank', require('./tv/other/followrank'));
router.get('/tv/group/:id', require('./tv/group/topic'));
router.get('/tv/person/:id', require('./tv/person'));
router.get('/tv/subject/:id/:type?/:showOriginalName?', require('./tv/subject'));
+42
View File
@@ -0,0 +1,42 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const config = require('@/config').value;
module.exports = async (ctx) => {
const url = 'https://bgm.tv/anime';
const response = await got({
url,
method: 'get',
headers: {
'User-Agent': config.trueUA,
},
});
const $ = cheerio.load(response.body);
const items = $('#columnB > div:nth-child(4) > table > tbody')
.find('tr')
.toArray()
.map((item) => {
const aTag = $(item).children('td').next().find('a');
return {
title: aTag.html(),
link: 'https://bgm.tv' + aTag.attr('href'),
};
})
.concat(
$('#chl_subitem > ul')
.find('li')
.toArray()
.map((item) => ({
title: $(item).children('a').attr('title'),
link: 'https://bgm.tv' + $(item).children('a').attr('href'),
}))
);
ctx.state.data = {
title: 'Bangumi 成员关注动画榜',
link: url,
item: items,
description: `Bangumi 首页-成员关注动画榜`,
};
};
+4
View File
@@ -203,6 +203,10 @@ For more tags, please go to [Search torrent](https://bangumi.moe/search/index)
<Route author="nczitzk" example="/bangumi/tv/user/blog/sai" path="/bangumi/tv/user/blog/:id" paramsDesc={['用户 id, 在用户页面地址栏查看']} radar="1"/>
### 成员关注动画榜 {#bangumi-cheng-yuan-guan-zhu-dong-hua-bang}
<Route author="honue" example="/bangumi/tv/followrank" path="/bangumi/tv/followrank" radar="1"/>
## CCC 創作集 {#ccc-chuang-zuo-ji}
### 漫畫 {#ccc-chuang-zuo-ji-man-hua}