mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
|
|
module.exports = async (ctx) => {
|
|
const id = ctx.params.id;
|
|
|
|
const response = await got({
|
|
method: 'get',
|
|
url: `https://wx.qnmlgb.tech/authors/${id}`,
|
|
});
|
|
|
|
const $ = cheerio.load(response.data);
|
|
const list = $('.ae');
|
|
|
|
ctx.state.data = {
|
|
title: `${$('#spider > div:nth-child(1) > div:nth-child(1)')
|
|
.text()
|
|
.trim()}微信公众号`,
|
|
link: `https://w.qnmlgb.tech/authors/${id}/`,
|
|
description: $('#spider > div:nth-child(2)')
|
|
.text()
|
|
.trim(),
|
|
item:
|
|
list &&
|
|
list
|
|
.map((i, ele) => {
|
|
const $ = cheerio.load(ele);
|
|
return {
|
|
title: $('.pretty')
|
|
.text()
|
|
.trim(),
|
|
link: $('a').attr('href'),
|
|
};
|
|
})
|
|
.get(),
|
|
};
|
|
};
|