diff --git a/docs/new-media.md b/docs/new-media.md
index 277c4b4ee..828d86813 100644
--- a/docs/new-media.md
+++ b/docs/new-media.md
@@ -3447,14 +3447,6 @@ wechat-feeds 来源[已停止更新](https://github.com/hellodword/wechat-feeds/
-### 公众平台系统公告栏目
-
-
-
-### 小程序插件
-
-
-
## 维基百科
### 中国大陆新闻动态
diff --git a/docs/programming.md b/docs/programming.md
index 36de6faae..02e0bd2b4 100644
--- a/docs/programming.md
+++ b/docs/programming.md
@@ -1036,6 +1036,10 @@ GitHub 官方也提供了一些 RSS:
## 微信小程序
+### 公众平台系统公告栏目
+
+
+
### 基础库更新日志
@@ -1044,6 +1048,10 @@ GitHub 官方也提供了一些 RSS:
+### 小程序插件
+
+
+
### 云开发更新日志
diff --git a/lib/router.js b/lib/router.js
index 94a3e023c..01112c31c 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -421,20 +421,18 @@ router.get('/tucaoqq/post/:project/:key', lazyloadRouteHandler('./routes/tencent
// Bugly SDK
router.get('/bugly/changelog/:platform', lazyloadRouteHandler('./routes/tencent/bugly/changelog'));
-// wechat
-router.get('/wechat/wemp/:id', lazyloadRouteHandler('./routes/tencent/wechat/wemp'));
-router.get('/wechat/csm/:id', lazyloadRouteHandler('./routes/tencent/wechat/csm'));
-router.get('/wechat/ce/:id', lazyloadRouteHandler('./routes/tencent/wechat/ce'));
-router.get('/wechat/announce', lazyloadRouteHandler('./routes/tencent/wechat/announce'));
+// wechat migrated to v2
+// router.get('/wechat/wemp/:id', lazyloadRouteHandler('./routes/tencent/wechat/wemp'));
+// router.get('/wechat/ce/:id', lazyloadRouteHandler('./routes/tencent/wechat/ce'));
+// router.get('/wechat/announce', lazyloadRouteHandler('./routes/tencent/wechat/announce'));
router.get('/wechat/miniprogram/plugins', lazyloadRouteHandler('./routes/tencent/wechat/miniprogram/plugins'));
-router.get('/wechat/tgchannel/:id/:mpName?/:searchQueryType?', lazyloadRouteHandler('./routes/tencent/wechat/tgchannel'));
-router.get('/wechat/uread/:userid', lazyloadRouteHandler('./routes/tencent/wechat/uread'));
-router.get('/wechat/ershicimi/:id', lazyloadRouteHandler('./routes/tencent/wechat/ershcimi'));
-router.get('/wechat/wjdn/:id', lazyloadRouteHandler('./routes/tencent/wechat/wjdn'));
-router.get('/wechat/wxnmh/:id', lazyloadRouteHandler('./routes/tencent/wechat/wxnmh'));
-router.get('/wechat/mp/homepage/:biz/:hid/:cid?', lazyloadRouteHandler('./routes/tencent/wechat/mp'));
-router.get('/wechat/mp/msgalbum/:biz/:aid', lazyloadRouteHandler('./routes/tencent/wechat/msgalbum'));
-router.get('/wechat/feeds/:id', lazyloadRouteHandler('./routes/tencent/wechat/feeds'));
+// router.get('/wechat/tgchannel/:id/:mpName?/:searchQueryType?', lazyloadRouteHandler('./routes/tencent/wechat/tgchannel'));
+// router.get('/wechat/uread/:userid', lazyloadRouteHandler('./routes/tencent/wechat/uread'));
+// router.get('/wechat/ershicimi/:id', lazyloadRouteHandler('./routes/tencent/wechat/ershcimi'));
+// router.get('/wechat/wxnmh/:id', lazyloadRouteHandler('./routes/tencent/wechat/wxnmh'));
+// router.get('/wechat/mp/homepage/:biz/:hid/:cid?', lazyloadRouteHandler('./routes/tencent/wechat/mp'));
+// router.get('/wechat/mp/msgalbum/:biz/:aid', lazyloadRouteHandler('./routes/tencent/wechat/msgalbum'));
+// router.get('/wechat/feeds/:id', lazyloadRouteHandler('./routes/tencent/wechat/feeds'));
// All the Flight Deals
router.get('/atfd/:locations/:nearby?', lazyloadRouteHandler('./routes/atfd/index'));
diff --git a/lib/routes/tencent/wechat/_README b/lib/routes/tencent/wechat/_README
deleted file mode 100644
index 7b066658f..000000000
--- a/lib/routes/tencent/wechat/_README
+++ /dev/null
@@ -1 +0,0 @@
-Make sure you read lib/utils/wechat-mp.js before adding a new route.
diff --git a/lib/routes/tencent/wechat/miniprogram/framework.js b/lib/routes/tencent/wechat/miniprogram/framework.js
index a0d453044..fb104d9df 100644
--- a/lib/routes/tencent/wechat/miniprogram/framework.js
+++ b/lib/routes/tencent/wechat/miniprogram/framework.js
@@ -1,5 +1,7 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const timezone = require('@/utils/timezone');
module.exports = async (ctx) => {
const link = `https://developers.weixin.qq.com/miniprogram/dev/framework/release/`;
@@ -16,14 +18,14 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: name,
link,
- item: $('#docContent .content h3')
+ item: $('#docContent .content h2')
.map((_, item) => {
item = $(item);
const title = item.text().replace(/[\s|#]/g, '');
return {
title,
description: item.next().html(),
- pubDate: new Date(new RegExp(/\d{4}-\d{2}-\d{2}/).exec(title) + ' GMT+8').toUTCString(),
+ pubDate: timezone(parseDate(new RegExp(/\d{4}-\d{2}-\d{2}/).exec(title)), +8),
link: link + item.find('a.header-anchor').attr('href'),
};
})
diff --git a/lib/utils/wechat-mp.js b/lib/utils/wechat-mp.js
index ba948c7aa..e6729a325 100644
--- a/lib/utils/wechat-mp.js
+++ b/lib/utils/wechat-mp.js
@@ -2,7 +2,6 @@
* Author: @Rongronggg9
*
* There are at least three folders which are relevant with WeChat MP (Official Account Platform / Media Platform):
- * lib/route/tencent/wechat
* lib/v2/wechat
* lib/v2/gzh360
* lib/v2/sdu/cs
@@ -181,7 +180,7 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
const response = await got(url);
const $ = cheerio.load(response.data);
- const title = $('meta[property="og:title"]').attr('content').replace(/\\r/g, '').replace(/\\n/g, ' ');
+ const title = ($('meta[property="og:title"]').attr('content') || '').replace(/\\r/g, '').replace(/\\n/g, ' ');
const author = $('meta[name=author]').attr('content');
let summary = $('meta[name=description]').attr('content');
summary = summary !== title ? summary : '';
diff --git a/lib/routes/tencent/wechat/announce.js b/lib/v2/wechat/announce.js
similarity index 88%
rename from lib/routes/tencent/wechat/announce.js
rename to lib/v2/wechat/announce.js
index ce4db72c0..eb9f6dedd 100644
--- a/lib/routes/tencent/wechat/announce.js
+++ b/lib/v2/wechat/announce.js
@@ -1,5 +1,6 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const { data: htmlString } = await got({
@@ -20,13 +21,13 @@ module.exports = async (ctx) => {
title: `${time} ${title}`,
link: `https://mp.weixin.qq.com${$link.attr('href')}`,
description: title,
- pubDate: new Date(time).toUTCString(),
+ pubDate: parseDate(time),
});
});
ctx.state.data = {
title: '微信公众平台-系统公告栏目',
- link: 'https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncementlist&lang=zh_CN&token=',
+ link: 'https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncementlist&lang=zh_CN',
item: announceList,
};
};
diff --git a/lib/routes/tencent/wechat/ce.js b/lib/v2/wechat/ce.js
similarity index 100%
rename from lib/routes/tencent/wechat/ce.js
rename to lib/v2/wechat/ce.js
diff --git a/lib/routes/tencent/wechat/ershcimi.js b/lib/v2/wechat/ershcimi.js
similarity index 100%
rename from lib/routes/tencent/wechat/ershcimi.js
rename to lib/v2/wechat/ershcimi.js
diff --git a/lib/routes/tencent/wechat/feeds.js b/lib/v2/wechat/feeds.js
similarity index 100%
rename from lib/routes/tencent/wechat/feeds.js
rename to lib/v2/wechat/feeds.js
diff --git a/lib/v2/wechat/maintainer.js b/lib/v2/wechat/maintainer.js
index 6924eabb1..0f87b0a5c 100644
--- a/lib/v2/wechat/maintainer.js
+++ b/lib/v2/wechat/maintainer.js
@@ -1,4 +1,14 @@
module.exports = {
- '/feeddd/:id': ['TonyRL', 'Rongronggg9'],
+ '/announce': ['xyqfer'],
+ '/ce/:id': ['HenryQW'],
+ '/ershicimi/:id': ['sanmmm'],
'/data258/:id?': ['Rongronggg9'],
+ '/feeddd/:id': ['TonyRL', 'Rongronggg9'],
+ '/feeds': ['tylinux'],
+ '/mp/homepage/:biz/:hid/:cid?': ['MisteryMonster'],
+ '/mp/msgalbum/:biz/:aid': ['MisteryMonster'],
+ '/tgchannel/:id/:mpName?/:searchQueryType?': ['LogicJake', 'Rongronggg9'],
+ '/uread/:userid': ['kt286'],
+ '/wemp/:id': ['HenryQW'],
+ '/wxnmh/:id': ['laampui'],
};
diff --git a/lib/routes/tencent/wechat/mp.js b/lib/v2/wechat/mp.js
similarity index 100%
rename from lib/routes/tencent/wechat/mp.js
rename to lib/v2/wechat/mp.js
diff --git a/lib/routes/tencent/wechat/msgalbum.js b/lib/v2/wechat/msgalbum.js
similarity index 100%
rename from lib/routes/tencent/wechat/msgalbum.js
rename to lib/v2/wechat/msgalbum.js
diff --git a/lib/v2/wechat/radar.js b/lib/v2/wechat/radar.js
index 03b68ec02..f614be15b 100644
--- a/lib/v2/wechat/radar.js
+++ b/lib/v2/wechat/radar.js
@@ -1,11 +1,23 @@
module.exports = {
- 'feeddd.org': {
+ 'careerengine.us': {
+ _name: '微信',
+ posts: [
+ {
+ title: '公众号(CareerEngine 来源)',
+ docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
+ source: ['/author/*id/posts'],
+ target: (params) => `/wechat/ce/${params.id}`,
+ },
+ ],
+ },
+ 'cimidata.com': {
_name: '微信',
'.': [
{
- title: '公众号 (feeddd 来源)',
+ title: '公众号(二十次幂来源)',
docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
- source: ['/'],
+ source: ['/a/:id'],
+ target: '/wechat/ce/:id',
},
],
},
@@ -13,11 +25,63 @@ module.exports = {
_name: '微信',
mp: [
{
- title: '公众号 (微阅读来源)',
+ title: '公众号(微阅读来源)',
docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
source: ['/', '/article/category/:id'],
target: '/wechat/data258/:id?',
},
],
},
+ 'feeddd.org': {
+ _name: '微信',
+ '.': [
+ {
+ title: '公众号(feeddd 来源)',
+ docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
+ source: ['/'],
+ },
+ ],
+ },
+ 'mp.weixin.qq.com': {
+ _name: '微信',
+ '.': [
+ {
+ title: '公众平台系统公告栏目',
+ docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
+ source: ['/cgi-bin/announce'],
+ target: '/wechat/announce',
+ },
+ ],
+ },
+ 'privacyhide.com': {
+ _name: '微信',
+ wechat: [
+ {
+ title: '公众号(wechat-feeds 来源)',
+ docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
+ },
+ ],
+ },
+ 'wemp.app': {
+ _name: '微信',
+ '.': [
+ {
+ title: '公众号(wemp.app 来源)',
+ docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
+ source: ['/accounts/:id'],
+ target: '/wechat/wemp/:id',
+ },
+ ],
+ },
+ 'wxnmh.com': {
+ _name: '微信',
+ '.': [
+ {
+ title: '公众号(wxnmh.com 来源)',
+ docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
+ source: ['/:id'],
+ target: (params) => `/wechat/wxnmh/${params.id.replace('user-', '').replace('.htm', '')}`,
+ },
+ ],
+ },
};
diff --git a/lib/v2/wechat/router.js b/lib/v2/wechat/router.js
index 7af4ca0b6..808f6e3f2 100644
--- a/lib/v2/wechat/router.js
+++ b/lib/v2/wechat/router.js
@@ -1,4 +1,14 @@
module.exports = function (router) {
- router.get('/feeddd/:id', require('./feeddd'));
+ router.get('/announce', require('./announce'));
+ router.get('/ce/:id', require('./ce'));
router.get('/data258/:id?', require('./data258'));
+ router.get('/ershicimi/:id', require('./ershcimi'));
+ router.get('/feeddd/:id', require('./feeddd'));
+ router.get('/feeds/:id', require('./feeds'));
+ router.get('/mp/homepage/:biz/:hid/:cid?', require('./mp'));
+ 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/routes/tencent/wechat/tgchannel.js b/lib/v2/wechat/tgchannel.js
similarity index 100%
rename from lib/routes/tencent/wechat/tgchannel.js
rename to lib/v2/wechat/tgchannel.js
diff --git a/lib/routes/tencent/wechat/uread.js b/lib/v2/wechat/uread.js
similarity index 100%
rename from lib/routes/tencent/wechat/uread.js
rename to lib/v2/wechat/uread.js
diff --git a/lib/routes/tencent/wechat/wemp.js b/lib/v2/wechat/wemp.js
similarity index 100%
rename from lib/routes/tencent/wechat/wemp.js
rename to lib/v2/wechat/wemp.js
diff --git a/lib/routes/tencent/wechat/wxnmh.js b/lib/v2/wechat/wxnmh.js
similarity index 100%
rename from lib/routes/tencent/wechat/wxnmh.js
rename to lib/v2/wechat/wxnmh.js