diff --git a/docs/new-media.md b/docs/new-media.md index 10c3d93da..c0d4eafe3 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -3894,14 +3894,14 @@ column 为 third 时可选的 category: ::: -### 公众号(wemp.app 来源) - - - ### 公众号(CareerEngine 来源) +### 公众号(二十次幂来源) + + + ### 公众号(Telegram 频道来源) @@ -3926,49 +3926,10 @@ column 为 third 时可选的 category: -### 公众号(优读来源) - - - -### 公众号(二十次幂来源) - - - -### 公众号(微阅读来源) - - - -::: warning 注意 - -由于使用了一些针对反爬的缓解措施,本路由响应较慢。默认只抓取前 5 条,可通过 `?limit=` 改变(不推荐,容易被反爬)。\ -该网站使用 IP 甄别访客,且应用严格的每日阅读量限额(约 15 次),请自建并确保正确配置缓存;如使用内存缓存而非 Redis 缓存,请增大缓存容量。该限额足够订阅至少 3 个公众号 (假设公众号每日仅更新一次);首页 / 分类页更新相当频繁,不推荐订阅。 - -::: - - - -### 公众号(wxnmh.com 来源) - - - -### 公众号(wechat-feeds 来源) - -::: warning 注意 - -wechat-feeds 来源[已停止更新](https://github.com/hellodword/wechat-feeds/issues/3882),历史文章可以正常订阅阅读 - -::: - - - -### 公众号(feeddd 来源)) +### 公众号(feeddd 来源) -### 公众号(公众号 360 来源) - -见 [#公众号 360](#gong-zhong-hao-360) - ### 公众号(自由微信来源) 见 [#自由微信](#zi-you-wei-xin) @@ -3991,6 +3952,41 @@ wechat-feeds 来源[已停止更新](https://github.com/hellodword/wechat-feeds/ +### 公众号(优读来源) + + + +### 公众号(wxnmh.com 来源) + + + +### 公众号(wechat-feeds 来源) + +::: warning 注意 + +wechat-feeds 来源[已停止更新](https://github.com/hellodword/wechat-feeds/issues/3882),历史文章可以正常订阅阅读 + +::: + + + +### 公众号(公众号 360 来源) + +见 [#公众号 360](#gong-zhong-hao-360) + +### 公众号(微阅读来源) + + + +::: warning 注意 + +由于使用了一些针对反爬的缓解措施,本路由响应较慢。默认只抓取前 5 条,可通过 `?limit=` 改变(不推荐,容易被反爬)。\ +该网站使用 IP 甄别访客,且应用严格的每日阅读量限额(约 15 次),请自建并确保正确配置缓存;如使用内存缓存而非 Redis 缓存,请增大缓存容量。该限额足够订阅至少 3 个公众号 (假设公众号每日仅更新一次);首页 / 分类页更新相当频繁,不推荐订阅。 + +::: + + + ## 维基百科 ### 中国大陆新闻动态 diff --git a/lib/v2/wechat/maintainer.js b/lib/v2/wechat/maintainer.js index 0f87b0a5c..771c9b2da 100644 --- a/lib/v2/wechat/maintainer.js +++ b/lib/v2/wechat/maintainer.js @@ -9,6 +9,5 @@ module.exports = { '/mp/msgalbum/:biz/:aid': ['MisteryMonster'], '/tgchannel/:id/:mpName?/:searchQueryType?': ['LogicJake', 'Rongronggg9'], '/uread/:userid': ['kt286'], - '/wemp/:id': ['HenryQW'], '/wxnmh/:id': ['laampui'], }; diff --git a/lib/v2/wechat/router.js b/lib/v2/wechat/router.js index 808f6e3f2..19953e0d4 100644 --- a/lib/v2/wechat/router.js +++ b/lib/v2/wechat/router.js @@ -9,6 +9,5 @@ module.exports = function (router) { router.get('/mp/msgalbum/:biz/:aid', require('./msgalbum')); router.get('/tgchannel/:id/:mpName?/:searchQueryType?', require('./tgchannel')); router.get('/uread/:userid', require('./uread')); - router.get('/wemp/:id', require('./wemp')); router.get('/wxnmh/:id', require('./wxnmh')); }; diff --git a/lib/v2/wechat/wemp.js b/lib/v2/wechat/wemp.js deleted file mode 100644 index 4e4d04602..000000000 --- a/lib/v2/wechat/wemp.js +++ /dev/null @@ -1,58 +0,0 @@ -const got = require('@/utils/got'); -const entities = require('entities'); -const cheerio = require('cheerio'); -const date = require('@/utils/date'); - -module.exports = async (ctx) => { - const { id } = ctx.params; - - const response = await got.get(`https://wemp.app/accounts/${id}`); - - const $ = cheerio.load(response.data); - const meta = $('.mp-info__list .mp-info__value'); - - const author = $(meta[0]).text().trim(); - - const year = new Date().getFullYear(); - const items = await Promise.all( - $('.post-item__main') - .get() - .slice(0, 3) - .map(async (e) => { - let pubDate = date(`${year} ${$(e).find('.post-item__date').text().trim()}`, 8); - - if (new Date(pubDate) > new Date()) { - pubDate = new Date(pubDate).setFullYear(year - 1); - pubDate = new Date(pubDate).toUTCString(); - } - - const link = `https://wemp.app${$(e).find('.post-item__title').attr('href')}`; - - const response = await ctx.cache.tryGet(link, async () => (await got.get(link)).data); - const article = cheerio.load(response); - - const matchs = /"(url|temp_url)":"([^"]+mp\.weixin\.qq\.com[^"]+)"/.exec(response); - let weixinLink = ''; - if (matchs && matchs[2]) { - weixinLink = entities.decodeXML(unescape(matchs[2].replace(/\\u/g, '%u'))); - } - - const single = { - title: $(e).find('.post-item__title').text().trim(), - link: weixinLink || link, - description: article('#content').html(), - pubDate, - author, - }; - - return Promise.resolve(single); - }) - ); - - ctx.state.data = { - title: `微信公众号 - ${author}`, - link: `https://wemp.app/accounts/${id}/`, - description: $(meta[1]).text().trim(), - item: items, - }; -};