fix: some bugs in 色花堂 (#3968)

This commit is contained in:
junfengP
2020-02-15 19:21:45 +08:00
committed by GitHub
parent 0c862876a5
commit 1f6a22a8d2
+3 -8
View File
@@ -21,18 +21,13 @@ const forumIdMaps = {
module.exports = async (ctx) => {
const subformName = ctx.params.subforumid || 'gqzwzm';
const subformId = subformName in forumIdMaps ? forumIdMaps[subformName] : subformName;
const typefilter = ctx.params.type ? `&filter=type&typeid=${ctx.params.type}` : '';
const typefilter = ctx.params.type ? `&filter=typeid&typeid=${ctx.params.type}` : '';
const link = `${host}forum.php?mod=forumdisplay&fid=${subformId}${typefilter}`;
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('#threadlisttableid tbody')
.slice(1, 21)
.filter(function() {
// 去除置顶帖子和分割线
const threadID = $(this).attr('id');
return typeof threadID !== 'undefined' && threadID !== 'separatorline' && !threadID.startsWith('stickthread');
})
const list = $('#threadlisttableid tbody[id^=normalthread]')
.slice(0, 11)
.map(function() {
const info = {
title: