Skip to content

Commit

Permalink
fix: some bugs in 色花堂 (DIYgod#3968)
Browse files Browse the repository at this point in the history
  • Loading branch information
junfengP authored Feb 15, 2020
1 parent 0c86287 commit 1f6a22a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/routes/dsndsht23/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1f6a22a

Please sign in to comment.