Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

笔趣阁原来的网站搜索找不到了 #46

Closed
yanlunhui opened this issue Jul 6, 2021 · 0 comments
Closed

笔趣阁原来的网站搜索找不到了 #46

yanlunhui opened this issue Jul 6, 2021 · 0 comments

Comments

@yanlunhui
Copy link

// const DOMAIN = 'https://www.biquge.com.cn';
const DOMAIN = 'https://www.xbiquge.la/';
// https://www.xbiquge.la/modules/article/waps.php
class ReaderDriver {
hasChapter() {
return true;
}
search(keyword) {
return __awaiter(this, void 0, void 0, function* () {
const result = [];
try {
// const res = yield got(DOMAIN + '/search.php?q=' + encodeURI(keyword));
const res = yield got(DOMAIN + '/modules/article/waps.php?searchkey=' + encodeURI(keyword))
const $ = cheerio.load(res.body);
$('.grid tr').each(function (i, elem) {
const title = $($(elem).find('td')[0]).text();
const author = $($(elem).find('td')[2]).text();
const path = $($(elem).find('td')[0]).find('a').length > 0 ? $($(elem).find('td')[0]).find('a').attr().href : '';
result.push(new TreeNode_1.TreeNode(Object.assign({}, TreeNode_1.defaultProblem, {
type: '.biquge',
name: ${title} - ${author},
isDirectory: true,
path
})));
});
}
catch (error) {
console.warn(error);
}
return result;
});
}

@aooiuu aooiuu pinned this issue Aug 1, 2021
@aooiuu aooiuu unpinned this issue Aug 1, 2021
@aooiuu aooiuu closed this as completed Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants