fix(algocasts): 修复无法正常获取到 ID 的问题 & feat: 增加 Soul 路由 (#2818)

This commit is contained in:
Singee
2019-08-11 01:25:21 +08:00
committed by DIYgod
parent b191322438
commit 081a038f4a
5 changed files with 108 additions and 6 deletions

View File

@@ -54,7 +54,11 @@ const makeFull = async (ctx, infos) => {
const badges = [];
$('.badge').each((index, badge) => {
badges.push($(badge).text());
const text = $(badge).text();
if (text !== '讨论') {
badges.push(text);
}
});
info.description = `<h1>${info.title}</h1><div>${badges.join(' | ')}</div><div>${$('#my-content p').html()}</div>`;
@@ -79,11 +83,9 @@ module.exports = async (ctx) => {
$('tr')
.slice(1)
.each((i, e) => {
const id = parseInt(
$(e)
.find('th')
.text()
);
const id = $(e)
.find('th')
.text();
const titleLabel = $(e).find('td a');
const title = `${id}. ${titleLabel.text()}`;
const episode = titleLabel