mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
feat: 公众号增加二十次幂输出 (#2654)
This commit is contained in:
27
lib/routes/tencent/wechat/ershcimi.js
Normal file
27
lib/routes/tencent/wechat/ershcimi.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { id } = ctx.params;
|
||||
const url = `https://www.ershicimi.com/a/${id}`;
|
||||
const response = await got(url);
|
||||
const $ = cheerio.load(response.data);
|
||||
const name = $('#wrapper > .yheader > .info-wrap .name').text();
|
||||
const description = $('#wrapper .right > .Card .Profile-sideColumnItemValue').text();
|
||||
const items = $('.weui_media_box')
|
||||
.map((_, ele) => {
|
||||
const $item = cheerio.load(ele);
|
||||
return {
|
||||
title: $item('.weui_media_title a').text(),
|
||||
link: $item('.weui_media_title a').attr('href'),
|
||||
pubDate: new Date($item('.weui_media_extra_info').attr('title')).toUTCString(),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
ctx.state.data = {
|
||||
title: `微信公众号 - ${name}`,
|
||||
link: url,
|
||||
description,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user