feat(route)!: remove wechat/csm wechat/wjdn (#9472)
This commit is contained in:
parent
79d9192469
commit
521862793e
|
|
@ -3342,10 +3342,6 @@ column 为 third 时可选的 category:
|
|||
|
||||
<Route 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']" anticrawler="1"/>
|
||||
|
||||
### 公众号(传送门来源)
|
||||
|
||||
<Route author="HenryQW" example="/wechat/csm/huxiu_com" path="/wechat/csm/:id" :paramsDesc="['公众号 id, 打开公众号页, 在 URL 中找到 id']"/>
|
||||
|
||||
### 公众号(CareerEngine 来源)
|
||||
|
||||
<Route author="HenryQW" example="/wechat/ce/595a5b14d7164e53908f1606" path="/wechat/ce/:id" :paramsDesc="['公众号 id, 在 [CareerEngine](https://search.careerengine.us/) 搜索公众号,通过 URL 中找到对应的公众号 id']"/>
|
||||
|
|
@ -3382,10 +3378,6 @@ column 为 third 时可选的 category:
|
|||
|
||||
<Route author="sanmmm" example="/wechat/ershicimi/813oxJOl" path="/wechat/ershicimi/:id" :paramsDesc="['公众号id, 打开公众号页, 在 URL 中找到 id']" anticrawler="1"/>
|
||||
|
||||
### 公众号 (外接大脑来源)
|
||||
|
||||
<Route author="BugWriter2" example="/wechat/wjdn/5d5e683c82339df472988f59" path="/wechat/wjdn/:id" :paramsDesc="['公众号 id, 打开公众号页, 在 URL 中找到 id']"/>
|
||||
|
||||
### 公众号 (wxnmh.com 来源)
|
||||
|
||||
<Route author="laampui" example="/wechat/wxnmh/51798" path="/wechat/wxnmh/:id" :paramsDesc="['公众号 id, 打开 wxnmh.com, 在 URL 中找到 id']"/>
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
const got = require('@/utils/got');
|
||||
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 got.get(link);
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const items = await Promise.all(
|
||||
$('.feed_item')
|
||||
.slice(0, 10)
|
||||
.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 got.get(link)).data);
|
||||
|
||||
const article = cheerio.load(response);
|
||||
|
||||
article('[style="display: none;"], [style=" display: none;"], [style="display: none"]').each((i, e) => {
|
||||
article(e).remove();
|
||||
});
|
||||
|
||||
article('#js_content img').each((index, elem) => {
|
||||
const $elem = article(elem);
|
||||
|
||||
const imgSrc = $elem.attr('data-original') || $elem.attr('src');
|
||||
if (imgSrc) {
|
||||
const realSrc = imgSrc.replace(/^https:\/\/img.chuansongme.com\//, 'https://mmbiz.qpic.cn/').replace(/^http.?\/\/img\d+.store.sogou.com.*url=(.*)$/, '$1');
|
||||
$elem.attr('src', realSrc);
|
||||
}
|
||||
});
|
||||
|
||||
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,
|
||||
};
|
||||
};
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { id } = ctx.params;
|
||||
if (!id) {
|
||||
throw Error('Bad category. See <a href="https://docs.rsshub.app/new-media.html#wei-xin-gong-zhong-hao-wai-jie-da-nao-lai-yuan">docs</a>');
|
||||
}
|
||||
|
||||
const currentUrl = `https://www.waijiedanao.com/api/posts?profile=${id}&page=1&limit=20`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
|
||||
const title = response.data.data[0].profile.title;
|
||||
const list = response.data.data.map((item) => ({
|
||||
title: item.title,
|
||||
link: item.link,
|
||||
description: item.digest,
|
||||
pubDate: new Date(item.publishAt).toUTCString(),
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: `微信公众号 - ${title}`,
|
||||
link: `https://www.waijiedanao.com/accountArtical?publicAccountId=${id}`,
|
||||
item: list,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue