feat: nhc list_gzbd

This commit is contained in:
DIYgod
2020-01-29 14:47:08 +08:00
parent 6bbfc9014c
commit c2bbf19a9f

View File

@@ -8,7 +8,7 @@ module.exports = async (ctx) => {
const $ = cheerio.load(res.data);
const list = $('.zxxx_list a').get();
const out = await Promise.all(
list.map(async (item) => {
list.splice(0, 10).map(async (item) => {
const $ = cheerio.load(item);
const title = $(item).text();
const address = $(item).attr('href');
@@ -28,7 +28,7 @@ module.exports = async (ctx) => {
})
);
ctx.state.data = {
title: '疫情通报',
title: '疫情通报-国家卫健委',
link: url,
item: out,
};