mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 01:58:11 +08:00
* 增加大数据专家委员会和中国人工智能学会新闻 * 修复问题 * fix: add docs for `caai` fix: maintainer does not with match with router * fix: add docs for `ccf/tfbd` fix: use raw output for `art-template` fix: standardise use of `got` not using `got()` in one place and `got.get()` in another place * refactor: migrate to v2 ---------
23 lines
621 B
JavaScript
23 lines
621 B
JavaScript
const utils = require('./utils');
|
|
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
|
|
module.exports = async (ctx) => {
|
|
const base = utils.urlBase(ctx.params.caty, ctx.params.id);
|
|
const res = await got(base);
|
|
const info = utils.fetchAllArticles(res.data);
|
|
const $ = cheerio.load(res.data);
|
|
|
|
const details = await Promise.all(info.map((e) => utils.detailPage(e, ctx.cache)));
|
|
|
|
ctx.state.json = {
|
|
info,
|
|
};
|
|
|
|
ctx.state.data = {
|
|
title: '大数据专家委员会 - ' + $('.position a:last-child').text(),
|
|
link: base,
|
|
item: details,
|
|
};
|
|
};
|