rsshub 1.0.0-master.c15aee0 → 1.0.0-master.c1cbcc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.js +5 -0
- package/lib/protected_router.js +1 -1
- package/lib/radar-rules.js +0 -17
- package/lib/router.js +9 -10
- package/lib/routes/gov/suzhou/doc.js +2 -2
- package/lib/routes/gov/suzhou/news.js +28 -23
- package/lib/routes/gov/suzhou/utils.js +1 -1
- package/lib/routes/instagram/index.js +3 -2
- package/lib/routes/instagram/utils.js +4 -3
- package/lib/routes/universities/bwu/news.js +1 -1
- package/lib/routes/universities/bwu/utils.js +14 -17
- package/lib/routes/weibo/utils.js +2 -2
- package/lib/v2/50forum/maintainer.js +3 -0
- package/lib/v2/50forum/radar.js +13 -0
- package/lib/v2/50forum/router.js +3 -0
- package/lib/v2/50forum/zhuanjia.js +51 -0
- package/lib/v2/audiobar/latest.js +53 -0
- package/lib/v2/audiobar/maintainer.js +3 -0
- package/lib/v2/audiobar/radar.js +13 -0
- package/lib/v2/audiobar/router.js +3 -0
- package/lib/v2/ciidbnu/index.js +58 -0
- package/lib/v2/ciidbnu/maintainer.js +3 -0
- package/lib/v2/ciidbnu/radar.js +13 -0
- package/lib/v2/ciidbnu/router.js +3 -0
- package/lib/v2/disinfo/maintainer.js +3 -0
- package/lib/v2/disinfo/publications.js +56 -0
- package/lib/v2/disinfo/radar.js +13 -0
- package/lib/v2/disinfo/router.js +3 -0
- package/lib/v2/disinformationindex/blog.js +49 -0
- package/lib/v2/disinformationindex/maintainer.js +4 -0
- package/lib/v2/disinformationindex/radar.js +19 -0
- package/lib/v2/disinformationindex/research.js +45 -0
- package/lib/v2/disinformationindex/router.js +4 -0
- package/lib/v2/disinformationindex/templates/description.art +7 -0
- package/lib/v2/dockerhub/utils.js +1 -1
- package/lib/{routes → v2}/ff14/ff14_global.js +9 -3
- package/lib/{routes → v2}/ff14/ff14_zh.js +11 -4
- package/lib/v2/ff14/maintainer.js +4 -0
- package/lib/v2/ff14/router.js +7 -0
- package/lib/v2/ff14/templates/description.art +4 -0
- package/lib/v2/gocn/maintainer.js +3 -0
- package/lib/v2/gocn/radar.js +13 -0
- package/lib/v2/gocn/router.js +3 -0
- package/lib/v2/gocn/topics.js +28 -0
- package/lib/v2/gov/beijing/kw/index.js +1 -1
- package/lib/v2/nogizaka46/maintainer.js +3 -0
- package/lib/v2/nogizaka46/news.js +33 -0
- package/lib/v2/nogizaka46/radar.js +13 -0
- package/lib/v2/nogizaka46/router.js +3 -0
- package/lib/v2/odaily/utils.js +1 -1
- package/lib/v2/panewslab/column.js +60 -0
- package/lib/v2/panewslab/index.js +56 -0
- package/lib/v2/panewslab/maintainer.js +6 -0
- package/lib/v2/panewslab/newsflash.js +35 -0
- package/lib/v2/panewslab/radar.js +31 -0
- package/lib/v2/panewslab/router.js +6 -0
- package/lib/v2/panewslab/topic.js +55 -0
- package/lib/v2/rsshub/maintainer.js +4 -0
- package/lib/v2/rsshub/radar.js +19 -0
- package/lib/v2/rsshub/router.js +6 -0
- package/lib/{routes → v2}/rsshub/routes.js +5 -4
- package/lib/{routes → v2}/rsshub/sponsors.js +0 -0
- package/lib/v2/sicau/dky.js +53 -0
- package/lib/v2/sicau/maintainer.js +2 -0
- package/lib/v2/sicau/radar.js +14 -0
- package/lib/v2/sicau/router.js +2 -0
- package/lib/v2/sicau/yan.js +53 -0
- package/lib/v2/swpu/dean.js +2 -1
- package/lib/v2/tisi/index.js +38 -0
- package/lib/v2/tisi/maintainer.js +3 -0
- package/lib/v2/tisi/radar.js +17 -0
- package/lib/v2/tisi/router.js +3 -0
- package/lib/v2/whitehouse/briefing-room.js +50 -0
- package/lib/v2/whitehouse/maintainer.js +3 -0
- package/lib/v2/whitehouse/radar.js +13 -0
- package/lib/v2/whitehouse/router.js +3 -0
- package/package.json +9 -7
- package/lib/routes/nogizaka46/news.js +0 -35
package/lib/config.js
CHANGED
|
@@ -219,6 +219,11 @@ const calculateValue = () => {
|
|
|
219
219
|
google: {
|
|
220
220
|
fontsApiKey: envs.GOOGLE_FONTS_API_KEY,
|
|
221
221
|
},
|
|
222
|
+
instagram: {
|
|
223
|
+
username: envs.IG_USERNAME,
|
|
224
|
+
password: envs.IG_PASSWORD,
|
|
225
|
+
proxy: envs.IG_PROXY,
|
|
226
|
+
},
|
|
222
227
|
};
|
|
223
228
|
};
|
|
224
229
|
calculateValue();
|
package/lib/protected_router.js
CHANGED
|
@@ -6,6 +6,6 @@ const config = require('./config').value;
|
|
|
6
6
|
router.use('/(.*)', auth(config.authentication));
|
|
7
7
|
|
|
8
8
|
// RSSHub
|
|
9
|
-
router.get('/rsshub/routes', require('./
|
|
9
|
+
router.get('/rsshub/routes/:lang?', require('./v2/rsshub/routes'));
|
|
10
10
|
|
|
11
11
|
module.exports = router;
|
package/lib/radar-rules.js
CHANGED
|
@@ -366,23 +366,6 @@ module.exports = {
|
|
|
366
366
|
},
|
|
367
367
|
],
|
|
368
368
|
},
|
|
369
|
-
'rsshub.app': {
|
|
370
|
-
_name: 'RSSHub',
|
|
371
|
-
docs: [
|
|
372
|
-
{
|
|
373
|
-
title: '有新路由啦',
|
|
374
|
-
docs: 'https://docs.rsshub.app/program-update.html#rsshub',
|
|
375
|
-
source: ['', '/*tpath'],
|
|
376
|
-
target: '/rsshub/routes',
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
title: '有新赞助商啦',
|
|
380
|
-
docs: 'https://docs.rsshub.app/program-update.html#rsshub',
|
|
381
|
-
source: ['', '/*tpath'],
|
|
382
|
-
target: '/rsshub/sponsors',
|
|
383
|
-
},
|
|
384
|
-
],
|
|
385
|
-
},
|
|
386
369
|
'ximalaya.com': {
|
|
387
370
|
_name: '喜马拉雅',
|
|
388
371
|
'.': [
|
package/lib/router.js
CHANGED
|
@@ -16,10 +16,10 @@ const lazyloadRouteHandler = (routeHandlerPath) => (ctx) => {
|
|
|
16
16
|
|
|
17
17
|
// Deprecated: DO NOT ADD ROUTE HERE
|
|
18
18
|
|
|
19
|
-
// RSSHub
|
|
20
|
-
router.get('/rsshub/rss', lazyloadRouteHandler('./routes/rsshub/routes')); // 弃用
|
|
21
|
-
router.get('/rsshub/routes', lazyloadRouteHandler('./routes/rsshub/routes'));
|
|
22
|
-
router.get('/rsshub/sponsors', lazyloadRouteHandler('./routes/rsshub/sponsors'));
|
|
19
|
+
// RSSHub migrated to v2
|
|
20
|
+
// router.get('/rsshub/rss', lazyloadRouteHandler('./routes/rsshub/routes')); // 弃用
|
|
21
|
+
// router.get('/rsshub/routes', lazyloadRouteHandler('./routes/rsshub/routes'));
|
|
22
|
+
// router.get('/rsshub/sponsors', lazyloadRouteHandler('./routes/rsshub/sponsors'));
|
|
23
23
|
|
|
24
24
|
// 1draw
|
|
25
25
|
router.get('/1draw', lazyloadRouteHandler('./routes/1draw/index'));
|
|
@@ -1915,9 +1915,9 @@ router.get('/arknights/japan', lazyloadRouteHandler('./routes/arknights/japan'))
|
|
|
1915
1915
|
// 塞壬唱片
|
|
1916
1916
|
router.get('/siren/news', lazyloadRouteHandler('./routes/siren/index'));
|
|
1917
1917
|
|
|
1918
|
-
// ff14
|
|
1919
|
-
router.get('/ff14/ff14_zh/:type', lazyloadRouteHandler('./routes/ff14/ff14_zh'));
|
|
1920
|
-
router.get('/ff14/ff14_global/:lang/:type', lazyloadRouteHandler('./routes/ff14/ff14_global'));
|
|
1918
|
+
// ff14 migrated to v2
|
|
1919
|
+
// router.get('/ff14/ff14_zh/:type', lazyloadRouteHandler('./routes/ff14/ff14_zh'));
|
|
1920
|
+
// router.get('/ff14/ff14_global/:lang/:type', lazyloadRouteHandler('./routes/ff14/ff14_global'));
|
|
1921
1921
|
|
|
1922
1922
|
// 学堂在线
|
|
1923
1923
|
router.get('/xuetangx/course/:cid/:type', lazyloadRouteHandler('./routes/xuetangx/course_info'));
|
|
@@ -1960,7 +1960,6 @@ router.get('/kaiyan/index', lazyloadRouteHandler('./routes/kaiyan/index'));
|
|
|
1960
1960
|
|
|
1961
1961
|
// 坂道系列资讯
|
|
1962
1962
|
// 坂道系列官网新闻
|
|
1963
|
-
router.get('/nogizaka46/news', lazyloadRouteHandler('./routes/nogizaka46/news'));
|
|
1964
1963
|
router.get('/keyakizaka46/news', lazyloadRouteHandler('./routes/keyakizaka46/news'));
|
|
1965
1964
|
router.get('/hinatazaka46/news', lazyloadRouteHandler('./routes/hinatazaka46/news'));
|
|
1966
1965
|
router.get('/keyakizaka46/blog', lazyloadRouteHandler('./routes/keyakizaka46/blog'));
|
|
@@ -4173,9 +4172,9 @@ router.get('/fashionnetwork/headline/:country?', lazyloadRouteHandler('./routes/
|
|
|
4173
4172
|
// mirror.xyz
|
|
4174
4173
|
router.get('/mirror/:id', lazyloadRouteHandler('./routes/mirror/entries'));
|
|
4175
4174
|
|
|
4176
|
-
// Deprecated: DO NOT ADD ROUTE HERE
|
|
4177
|
-
|
|
4178
4175
|
// KBS
|
|
4179
4176
|
router.get('/kbs/today/:language?', lazyloadRouteHandler('./routes/kbs/today'));
|
|
4180
4177
|
|
|
4178
|
+
// Deprecated: DO NOT ADD ROUTE HERE
|
|
4179
|
+
|
|
4181
4180
|
module.exports = router;
|
|
@@ -2,7 +2,7 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
3
|
const util = require('./utils');
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const link = '
|
|
5
|
+
const link = 'https://www.suzhou.gov.cn/szxxgk/front/xxgk_right.jsp';
|
|
6
6
|
const response = await got.get(link);
|
|
7
7
|
const data = response.data;
|
|
8
8
|
const $ = cheerio.load(data);
|
|
@@ -17,7 +17,7 @@ module.exports = async (ctx) => {
|
|
|
17
17
|
.map(async (index, item) => {
|
|
18
18
|
item = $(item);
|
|
19
19
|
// 获取全文
|
|
20
|
-
const contentUrl = '
|
|
20
|
+
const contentUrl = 'https://www.suzhou.gov.cn' + item.find('a').attr('href');
|
|
21
21
|
const arr = await ctx.cache.tryGet(contentUrl, async () => {
|
|
22
22
|
const fullText = await got.get(contentUrl);
|
|
23
23
|
const fullTextData = cheerio.load(fullText.data);
|
|
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
|
|
|
3
3
|
const logger = require('@/utils/logger');
|
|
4
4
|
const liburl = require('url');
|
|
5
5
|
const util = require('./utils');
|
|
6
|
-
const root_url = '
|
|
6
|
+
const root_url = 'https://www.suzhou.gov.cn/';
|
|
7
7
|
|
|
8
8
|
module.exports = async (ctx) => {
|
|
9
9
|
const uid = ctx.params.uid;
|
|
@@ -11,57 +11,62 @@ module.exports = async (ctx) => {
|
|
|
11
11
|
let title = '';
|
|
12
12
|
let urljs = '';
|
|
13
13
|
switch (uid) {
|
|
14
|
+
case 'szyw':
|
|
15
|
+
case 'news':
|
|
16
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=5057aeffb1a84a7e8aeded87728da48c';
|
|
17
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/szyw/nav_list.shtml';
|
|
18
|
+
title = '苏州市政府 - 苏州要闻';
|
|
19
|
+
break;
|
|
14
20
|
case 'qxkx':
|
|
15
21
|
case 'district':
|
|
16
|
-
urljs = '
|
|
17
|
-
url = '
|
|
22
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=75c636ea0efb487ea7e479e3cc0ff3e5';
|
|
23
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/qxkx/nav_list.shtml';
|
|
18
24
|
title = '苏州市政府 - 区县快讯';
|
|
19
25
|
break;
|
|
20
|
-
case 'szyw':
|
|
21
|
-
case 'news':
|
|
22
|
-
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=5057aeffb1a84a7e8aeded87728da48c';
|
|
23
|
-
url = 'http://www.suzhou.gov.cn/szsrmzf/szyw/nav_list_js.shtml';
|
|
24
|
-
title = '苏州市政府 - 政务要闻';
|
|
25
|
-
break;
|
|
26
26
|
case 'bmdt':
|
|
27
|
-
urljs = '
|
|
28
|
-
url = '
|
|
27
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=b3d097e3eb79421f88439ea381ce33c3';
|
|
28
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/bmdt/nav_list.shtml';
|
|
29
29
|
title = '苏州市政府 - 部门动态';
|
|
30
30
|
break;
|
|
31
31
|
case 'xwsp':
|
|
32
|
-
urljs = '
|
|
33
|
-
url = '
|
|
32
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=507980d214c943ebb0a70853ec94b12e';
|
|
33
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/xwsp/nav_list.shtml';
|
|
34
34
|
title = '苏州市政府 - 新闻视频';
|
|
35
35
|
break;
|
|
36
36
|
case 'rdzt':
|
|
37
|
-
url = '
|
|
37
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/rdzt/nav_list.shtml';
|
|
38
38
|
title = '苏州市政府 - 热点专题';
|
|
39
39
|
break;
|
|
40
40
|
case 'sbjzt':
|
|
41
|
-
url = '
|
|
41
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/sbjzt/nav_list.shtml';
|
|
42
42
|
title = '苏州市政府 - 市本级专题';
|
|
43
43
|
break;
|
|
44
44
|
case 'zxrdzt':
|
|
45
|
-
url = '
|
|
45
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/zxrdzt/nav_list.shtml';
|
|
46
46
|
title = '苏州市政府 - 最新热点专题';
|
|
47
47
|
break;
|
|
48
48
|
case 'wqzt':
|
|
49
|
-
url = '
|
|
49
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/wqzt/nav_list.shtml';
|
|
50
50
|
title = '苏州市政府 - 往期专题';
|
|
51
51
|
break;
|
|
52
52
|
case 'qxzt':
|
|
53
|
-
url = '
|
|
53
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/qxzt/nav_list.shtml';
|
|
54
54
|
title = '苏州市政府 - 区县专题';
|
|
55
55
|
break;
|
|
56
56
|
case 'zwgg':
|
|
57
|
-
urljs = '
|
|
58
|
-
url = '
|
|
57
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=260915178a1f4c4fac44c4bf6378c9b0';
|
|
58
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/zwgg/nav_list.shtml';
|
|
59
59
|
title = '苏州市政府 - 政务公告';
|
|
60
60
|
break;
|
|
61
|
+
case 'mszx':
|
|
62
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=dc60acecb0be46b89d42272dcb8bd32b';
|
|
63
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/mszx/nav_list.shtml';
|
|
64
|
+
title = '苏州市政府 - 便民公告';
|
|
65
|
+
break;
|
|
61
66
|
case 'bmzx':
|
|
62
|
-
urljs = '
|
|
63
|
-
url = '
|
|
64
|
-
title = '苏州市政府 -
|
|
67
|
+
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=b015bfa5e5514cc9a26cd9f956ef8e69';
|
|
68
|
+
url = 'https://www.suzhou.gov.cn/szsrmzf/bmzx/bmzx_list.shtml';
|
|
69
|
+
title = '苏州市政府 - 民生资讯';
|
|
65
70
|
break;
|
|
66
71
|
default:
|
|
67
72
|
logger.error('pattern not matched');
|
|
@@ -11,7 +11,7 @@ const content = (response) => {
|
|
|
11
11
|
.html()
|
|
12
12
|
.replace(/<.?ucaptitle>/g, '')
|
|
13
13
|
.replace(/<.?ucapcontent>/g, '')
|
|
14
|
-
.replace(/"\/szsrmzf/g, '"
|
|
14
|
+
.replace(/"\/szsrmzf/g, '"https://www.suzhou.gov.cn/szsrmzf')
|
|
15
15
|
.replace('publishtime', 'span');
|
|
16
16
|
return content;
|
|
17
17
|
};
|
|
@@ -2,6 +2,7 @@ const cheerio = require('cheerio');
|
|
|
2
2
|
const { IgLoginRequiredError } = require('instagram-private-api');
|
|
3
3
|
const { ig, login } = require('./utils');
|
|
4
4
|
const logger = require('@/utils/logger');
|
|
5
|
+
const config = require('@/config').value;
|
|
5
6
|
|
|
6
7
|
// loadContent pulls the desired user/tag/etc
|
|
7
8
|
async function loadContent(category, nameOrId) {
|
|
@@ -66,8 +67,8 @@ module.exports = async (ctx) => {
|
|
|
66
67
|
throw Error('Such feed is not supported.');
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
if (
|
|
70
|
-
ig.state.proxyUrl =
|
|
70
|
+
if (config.instagram && config.instagram.proxy) {
|
|
71
|
+
ig.state.proxyUrl = config.instagram.proxy;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
// Unique key for a feed category
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
const { IgApiClient } = require('instagram-private-api');
|
|
2
2
|
const logger = require('@/utils/logger');
|
|
3
|
+
const config = require('@/config').value;
|
|
3
4
|
|
|
4
5
|
const ig = new IgApiClient();
|
|
5
6
|
() => login(ig); // deepscan-disable-line UNUSED_EXPR
|
|
6
7
|
|
|
7
8
|
async function login(ig) {
|
|
8
|
-
if (
|
|
9
|
+
if (config.instagram && config.instagram.username && config.instagram.password) {
|
|
9
10
|
try {
|
|
10
|
-
ig.state.generateDevice(
|
|
11
|
+
ig.state.generateDevice(config.instagram.username);
|
|
11
12
|
try {
|
|
12
13
|
await ig.simulate.preLoginFlow();
|
|
13
14
|
} catch (error) {
|
|
14
15
|
logger.info('Instagram preLoginFlow fail: ' + error);
|
|
15
16
|
}
|
|
16
|
-
await ig.account.login(
|
|
17
|
+
await ig.account.login(config.instagram.username, config.instagram.password);
|
|
17
18
|
process.nextTick(() => ig.simulate.postLoginFlow());
|
|
18
19
|
logger.info('Instagram login success.');
|
|
19
20
|
} catch (error) {
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
-
const
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
4
5
|
|
|
5
6
|
// Processing full text
|
|
6
7
|
async function load(link) {
|
|
7
|
-
const
|
|
8
|
-
const $ = cheerio.load(
|
|
9
|
-
const author = $('div[class=articleAuthor] p span').eq(1).text()
|
|
8
|
+
const response = await got.get(link);
|
|
9
|
+
const $ = cheerio.load(response.data);
|
|
10
|
+
const author = $('div[class=articleAuthor] p span').eq(1).text() || 'null';
|
|
11
|
+
const authorName = author.indexOf(':') !== -1 ? author.split(':')[1].trim() : author;
|
|
12
|
+
const validAuthor = 'xcb@bwu.edu.cn (' + authorName + ')';
|
|
10
13
|
// Extracting text
|
|
11
14
|
const description = $('div[id^=vsb_content]').html();
|
|
12
15
|
|
|
13
16
|
return {
|
|
14
17
|
description,
|
|
15
|
-
author,
|
|
18
|
+
author: validAuthor,
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
const ProcessFeed = (list, cache) => {
|
|
20
|
-
const host = '
|
|
23
|
+
const host = 'https://news.bwu.edu.cn/';
|
|
21
24
|
|
|
22
25
|
return Promise.all(
|
|
23
26
|
list.map(async (item) => {
|
|
24
27
|
const $ = cheerio.load(item);
|
|
25
|
-
const
|
|
26
|
-
const
|
|
28
|
+
const aTag = $('a');
|
|
29
|
+
const title = aTag.text();
|
|
30
|
+
const link = new URL(aTag.attr('href'), host);
|
|
27
31
|
// Parsing the date
|
|
28
|
-
const
|
|
29
|
-
$('span[class=rightDate]')
|
|
30
|
-
.text()
|
|
31
|
-
.match(/\d{4}-\d{2}-\d{2}/)
|
|
32
|
-
);
|
|
33
|
-
const timeZone = 8;
|
|
34
|
-
const serverOffset = date.getTimezoneOffset() / 60;
|
|
35
|
-
const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString();
|
|
32
|
+
const pubDate = timezone(parseDate($('span[class=rightDate]').text(), 'YYYY-MM-DD'), +8);
|
|
36
33
|
|
|
37
34
|
const single = {
|
|
38
35
|
title,
|
|
@@ -43,7 +40,7 @@ const ProcessFeed = (list, cache) => {
|
|
|
43
40
|
// Try caching
|
|
44
41
|
const other = await cache.tryGet(link, () => load(link));
|
|
45
42
|
// Return article information
|
|
46
|
-
return
|
|
43
|
+
return { ...single, ...other };
|
|
47
44
|
})
|
|
48
45
|
);
|
|
49
46
|
};
|
|
@@ -52,8 +52,8 @@ const weiboUtils = {
|
|
|
52
52
|
if (!showEmojiInDescription) {
|
|
53
53
|
htmlNewLineUnreplaced = htmlNewLineUnreplaced.replace(/<span class="url-icon"><img.*?alt="?(.*?)"? [\s\S]*?\/><\/span>/g, '$1');
|
|
54
54
|
}
|
|
55
|
-
//
|
|
56
|
-
htmlNewLineUnreplaced = htmlNewLineUnreplaced.replace(/<span class=["|']url-icon["|']
|
|
55
|
+
// 去掉外部链接的图标,保留 a 标签链接
|
|
56
|
+
htmlNewLineUnreplaced = htmlNewLineUnreplaced.replace(/<span class=["|']url-icon["|']>.*?(<a.*?>).*?<\/span><span class="surl-text">(.*?)<\/span>/g, '$1$2</a>');
|
|
57
57
|
// 去掉乱七八糟的图标
|
|
58
58
|
// htmlNewLineUnreplaced = htmlNewLineUnreplaced.replace(/<span class=["|']url-icon["|']>(.*?)<\/span>/g, '');
|
|
59
59
|
// 去掉全文
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'50forum.org.cn': {
|
|
3
|
+
_name: '经济 50 人论坛',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '专家文章',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#jing-ji-50-ren-lun-tan',
|
|
8
|
+
source: ['/home/article/index/category/zhuanjia.html', '/'],
|
|
9
|
+
target: '/50forum',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const rootUrl = 'http://www.50forum.org.cn';
|
|
8
|
+
const response = await got({
|
|
9
|
+
method: 'get',
|
|
10
|
+
url: `${rootUrl}/home/article/index/category/zhuanjia.html`,
|
|
11
|
+
});
|
|
12
|
+
const data = response.data;
|
|
13
|
+
if (!data) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const $ = cheerio.load(data);
|
|
17
|
+
let out = $('div.container div.list_list.mtop10 ul li')
|
|
18
|
+
.find('a')
|
|
19
|
+
.toArray()
|
|
20
|
+
.map((item) => {
|
|
21
|
+
item = $(item);
|
|
22
|
+
const link = rootUrl + item.attr('href');
|
|
23
|
+
const reg = /^(.+)\[(.+)\](.+)$/;
|
|
24
|
+
const keyword = reg.exec(item.text().trim());
|
|
25
|
+
return {
|
|
26
|
+
title: keyword[1],
|
|
27
|
+
author: keyword[2],
|
|
28
|
+
link,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
out = await Promise.all(
|
|
33
|
+
out.map((item) =>
|
|
34
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
35
|
+
const result = await got(item.link);
|
|
36
|
+
|
|
37
|
+
const $ = cheerio.load(result.data);
|
|
38
|
+
|
|
39
|
+
item.description = $('div.list_content').html();
|
|
40
|
+
item.pubDate = timezone(parseDate($('span#publish_time').text(), 'YYYY-MM-DD HH:mm'), +8);
|
|
41
|
+
return item;
|
|
42
|
+
})
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
ctx.state.data = {
|
|
46
|
+
title: `中国经济50人论坛专家文章`,
|
|
47
|
+
link: 'http://www.50forum.org.cn/home/article/index/category/zhuanjia.html',
|
|
48
|
+
description: '中国经济50人论坛专家文章',
|
|
49
|
+
item: out,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const iconv = require('iconv-lite');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
const timezone = require('@/utils/timezone');
|
|
6
|
+
|
|
7
|
+
const rootUrl = 'http://www.audiobar.cn/';
|
|
8
|
+
|
|
9
|
+
module.exports = async (ctx) => {
|
|
10
|
+
const currentUrl = `${rootUrl}/all.php`;
|
|
11
|
+
|
|
12
|
+
const response = await got({
|
|
13
|
+
method: 'get',
|
|
14
|
+
url: currentUrl,
|
|
15
|
+
responseType: 'buffer',
|
|
16
|
+
});
|
|
17
|
+
const data = iconv.decode(response.data, 'gb2312');
|
|
18
|
+
const $ = cheerio.load(data);
|
|
19
|
+
|
|
20
|
+
const list = $('.thread_every_container_div')
|
|
21
|
+
.map((_, item) => {
|
|
22
|
+
item = $(item);
|
|
23
|
+
|
|
24
|
+
const link = item.find('.thread_subject').attr('href');
|
|
25
|
+
const dateStr = item.find('.atrd_span').text().slice(-26).replace(' ', '');
|
|
26
|
+
return {
|
|
27
|
+
title: item.find('.thread_subject').text().replace('\n', '').replace(' ', ''),
|
|
28
|
+
link: link.indexOf('http') > -1 ? link : `${rootUrl}${link}`,
|
|
29
|
+
pubDate: timezone(parseDate(dateStr, 'YY-M-D HH:mm'), +8),
|
|
30
|
+
};
|
|
31
|
+
})
|
|
32
|
+
.get();
|
|
33
|
+
const items = await Promise.all(
|
|
34
|
+
list.map((item) =>
|
|
35
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
36
|
+
const detailResponse = await got({
|
|
37
|
+
method: 'get',
|
|
38
|
+
url: item.link,
|
|
39
|
+
responseType: 'buffer',
|
|
40
|
+
});
|
|
41
|
+
const detailResponsedata = iconv.decode(detailResponse.data, 'gb2312');
|
|
42
|
+
const content = cheerio.load(detailResponsedata);
|
|
43
|
+
item.description = content('.zhengwen_div').text().replace('Your browser does not support HTML5, please change another browser.', '');
|
|
44
|
+
return item;
|
|
45
|
+
})
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
ctx.state.data = {
|
|
49
|
+
title: '音频应用-最新主题',
|
|
50
|
+
link: currentUrl,
|
|
51
|
+
item: items,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const iconv = require('iconv-lite');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
const timezone = require('@/utils/timezone');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const id = ctx.params.id ?? '1';
|
|
9
|
+
|
|
10
|
+
const rootUrl = 'http://www.ciidbnu.org';
|
|
11
|
+
const currentUrl = `${rootUrl}/new1.asp?pagetype=${id}`;
|
|
12
|
+
const response = await got({
|
|
13
|
+
method: 'get',
|
|
14
|
+
url: currentUrl,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const $ = cheerio.load(response.data);
|
|
18
|
+
|
|
19
|
+
const list = $('#newsrightlist a')
|
|
20
|
+
.slice(0, 10)
|
|
21
|
+
.map((_, item) => {
|
|
22
|
+
item = $(item);
|
|
23
|
+
return {
|
|
24
|
+
title: item.text(),
|
|
25
|
+
link: `${rootUrl}${item.attr('href').replace('..', '')}`,
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
.get();
|
|
29
|
+
|
|
30
|
+
const items = await Promise.all(
|
|
31
|
+
list.map(
|
|
32
|
+
async (item) =>
|
|
33
|
+
await ctx.cache.tryGet(item.link, async () => {
|
|
34
|
+
const detailResponse = await got({
|
|
35
|
+
method: 'get',
|
|
36
|
+
url: item.link,
|
|
37
|
+
responseType: 'buffer',
|
|
38
|
+
});
|
|
39
|
+
const content = cheerio.load(iconv.decode(detailResponse.data, 'gbk'));
|
|
40
|
+
|
|
41
|
+
item.description = content('#text').html();
|
|
42
|
+
item.pubDate = timezone(parseDate(content('.t8').eq(0).text(), 'YYYY/M/D H:mm:ss'), +8);
|
|
43
|
+
|
|
44
|
+
content('.t14').remove();
|
|
45
|
+
|
|
46
|
+
item.author = content('#author').text();
|
|
47
|
+
|
|
48
|
+
return item;
|
|
49
|
+
})
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
ctx.state.data = {
|
|
54
|
+
title: `${$('h3').text()} - 中国收入分配研究院`,
|
|
55
|
+
link: currentUrl,
|
|
56
|
+
item: items,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'ciidbnu.org': {
|
|
3
|
+
_name: '中国收入分配研究院',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '分类',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#',
|
|
8
|
+
source: ['/new1.asp', '/'],
|
|
9
|
+
target: (_params, url) => `/ciidbnu/${new URL(url).searchParams.get('pagetype')}`,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const rootUrl = 'https://www.disinfo.eu';
|
|
7
|
+
const currentUrl = `${rootUrl}/publications`;
|
|
8
|
+
const response = await got({
|
|
9
|
+
method: 'get',
|
|
10
|
+
url: currentUrl,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const $ = cheerio.load(response.data);
|
|
14
|
+
|
|
15
|
+
const list = $('.elementor-heading-title a')
|
|
16
|
+
.map((_, item) => {
|
|
17
|
+
item = $(item);
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
title: item.text(),
|
|
21
|
+
link: item.attr('href'),
|
|
22
|
+
};
|
|
23
|
+
})
|
|
24
|
+
.get();
|
|
25
|
+
|
|
26
|
+
const items = await Promise.all(
|
|
27
|
+
list.map((item) =>
|
|
28
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
29
|
+
const detailResponse = await got({
|
|
30
|
+
method: 'get',
|
|
31
|
+
url: item.link,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const content = cheerio.load(detailResponse.data);
|
|
35
|
+
|
|
36
|
+
content('.wp-block-spacer').remove();
|
|
37
|
+
content('.elementor-widget-container p').eq(0).remove();
|
|
38
|
+
|
|
39
|
+
content('img').each(function () {
|
|
40
|
+
content(this).attr('src', content(this).attr('data-lazy-src'));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
item.description = content('.elementor-widget-theme-post-content').html();
|
|
44
|
+
item.pubDate = parseDate(content('meta[property="article:modified_time"]').attr('content'));
|
|
45
|
+
|
|
46
|
+
return item;
|
|
47
|
+
})
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
ctx.state.data = {
|
|
52
|
+
title: $('title').text(),
|
|
53
|
+
link: currentUrl,
|
|
54
|
+
item: items,
|
|
55
|
+
};
|
|
56
|
+
};
|