mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
@@ -420,6 +420,8 @@ RSSHub 提供下列 API 接口:
|
||||
|
||||
<route name="公众号( wemp.app 来源)" author="HenryQW" example="/wechat/wemp/36836fbe-bdec-4758-8967-7cc82722952d" path="/wechat/wemp/:id" :paramsDesc="['wemp 公众号 id, 可在搜索引擎使用 `site:wemp.app` 搜索公众号(例如: 人民日报 site:wemp.app), 打开公众号页, 在 URL 中找到 id']"/>
|
||||
|
||||
<route name="公众号(传送门来源)" author="HenryQW" example="/wechat/csm/huxiu_com" path="/wechat/csm/:id" :paramsDesc="['公众号 id, 打开公众号页, 在 URL 中找到 id']"/>
|
||||
|
||||
<route name="公众平台系统公告栏目" author="xyqfer" example="/wechat/announce" path="/wechat/announce" />
|
||||
|
||||
<route name="小程序插件" author="xyqfer" example="/wechat/miniprogram/plugins" path="/wechat/miniprogram/plugins" />
|
||||
@@ -2563,7 +2565,7 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
|
||||
|
||||
<route name="栏目" author="HenryQW" example="/aisixiang/column/722" path="/aisixiang/column/:id" :paramsDesc="['栏目 ID, 可在对应栏目 URL 中找到']"/>
|
||||
|
||||
<route name="排行榜" author="HenryQW" example="/aisixiang/column/1/7" path="/aisixiang/ranking/:type?/:range?" :paramsDesc="['排行榜类型', '排行榜范围, 仅适用于点击排行榜, 可选日(1),周(7),月(30)']">
|
||||
<route name="排行榜" author="HenryQW" example="/aisixiang/ranking/1/7" path="/aisixiang/ranking/:type?/:range?" :paramsDesc="['排行榜类型', '排行榜范围, 仅适用于点击排行榜, 可选日(1),周(7),月(30)']">
|
||||
|
||||
| 文章点击排行 | 文章推荐排行 | 最近更新文章 |
|
||||
| ------------ | ------------ | ------------ |
|
||||
|
||||
@@ -497,6 +497,7 @@ router.get('/bugly/changelog/:platform', require('./routes/tencent/bugly/changel
|
||||
// wechat
|
||||
router.get('/wechat/wasi/:id', require('./routes/tencent/wechat/wasi'));
|
||||
router.get('/wechat/wemp/:id', require('./routes/tencent/wechat/wemp'));
|
||||
router.get('/wechat/csm/:id', require('./routes/tencent/wechat/csm'));
|
||||
router.get('/wechat/announce', require('./routes/tencent/wechat/announce'));
|
||||
router.get('/wechat/miniprogram/plugins', require('./routes/tencent/wechat/miniprogram/plugins'));
|
||||
|
||||
|
||||
63
lib/routes/tencent/wechat/csm.js
Normal file
63
lib/routes/tencent/wechat/csm.js
Normal file
@@ -0,0 +1,63 @@
|
||||
const axios = require('../../../utils/axios');
|
||||
const date = require('../../../utils/date');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { id } = ctx.params;
|
||||
|
||||
const link = `https://chuansongme.com/account/${id}`;
|
||||
|
||||
const response = await axios.get(link);
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const items = await Promise.all(
|
||||
$('.feed_item')
|
||||
.slice(0, 5)
|
||||
.get()
|
||||
.map(async (e) => {
|
||||
const pubDate = date(
|
||||
`${$(e)
|
||||
.find('.timestamp')
|
||||
.text()
|
||||
.trim()}`,
|
||||
8
|
||||
);
|
||||
|
||||
const link = `https://chuansongme.com${$(e)
|
||||
.find('.question_link')
|
||||
.attr('href')}`;
|
||||
|
||||
const response = await ctx.cache.tryGet(link, async () => (await axios.get(link)).data);
|
||||
|
||||
const article = cheerio.load(response);
|
||||
|
||||
article('[style="display: none;"], [style=" display: none;"], [style="display: none"]').each((i, e) => {
|
||||
$(e).remove();
|
||||
});
|
||||
|
||||
const single = {
|
||||
title: article('#activity-name').text(),
|
||||
link,
|
||||
description: article('#js_content').html(),
|
||||
pubDate,
|
||||
author: article('#meta_content > span:nth-child(2)').text(),
|
||||
};
|
||||
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `微信公众号 - ${$('.inline_editor_content')
|
||||
.first()
|
||||
.text()
|
||||
.trim()}`,
|
||||
link,
|
||||
description: $('.inline_editor_content')
|
||||
.last()
|
||||
.text()
|
||||
.trim(),
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user