rsshub 1.0.0-master.d24db95 → 1.0.0-master.d251822
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/router.js +8 -1
- package/lib/routes/blogs/foreverblog.js +33 -0
- package/lib/routes/ehentai/search.js +6 -1
- package/lib/routes/ehentai/tag.js +1 -1
- package/lib/routes/github/trending.js +2 -1
- package/lib/routes/secrss/author.js +22 -0
- package/lib/routes/secrss/category.js +25 -0
- package/lib/v2/mydrivers/index.js +110 -0
- package/lib/v2/mydrivers/maintainer.js +3 -0
- package/lib/v2/mydrivers/radar.js +13 -0
- package/lib/v2/mydrivers/router.js +3 -0
- package/lib/v2/pku/hr.js +54 -0
- package/lib/v2/pku/maintainer.js +3 -0
- package/lib/v2/pku/radar.js +13 -0
- package/lib/v2/pku/router.js +3 -0
- package/lib/v2/pts/dailynews.js +52 -0
- package/lib/v2/pts/maintainer.js +3 -0
- package/lib/v2/pts/radar.js +13 -0
- package/lib/v2/pts/router.js +3 -0
- package/lib/v2/ruc/hr.js +52 -0
- package/lib/v2/ruc/maintainer.js +3 -0
- package/lib/v2/ruc/radar.js +13 -0
- package/lib/v2/ruc/router.js +3 -0
- package/package.json +1 -1
package/lib/router.js
CHANGED
|
@@ -278,7 +278,7 @@ router.get('/readhub/category/:category', lazyloadRouteHandler('./routes/readhub
|
|
|
278
278
|
|
|
279
279
|
// GitHub
|
|
280
280
|
router.get('/github/repos/:user', lazyloadRouteHandler('./routes/github/repos'));
|
|
281
|
-
router.get('/github/trending/:since/:language?', lazyloadRouteHandler('./routes/github/trending'));
|
|
281
|
+
router.get('/github/trending/:since/:language?/:spoken_language?', lazyloadRouteHandler('./routes/github/trending'));
|
|
282
282
|
router.get('/github/issue/:user/:repo/:state?/:labels?', lazyloadRouteHandler('./routes/github/issue'));
|
|
283
283
|
router.get('/github/pull/:user/:repo', lazyloadRouteHandler('./routes/github/pulls'));
|
|
284
284
|
router.get('/github/user/followers/:user', lazyloadRouteHandler('./routes/github/follower'));
|
|
@@ -4230,6 +4230,9 @@ router.get('/now/news/rank', lazyloadRouteHandler('./routes/now/rank'));
|
|
|
4230
4230
|
// s-hentai
|
|
4231
4231
|
router.get('/s-hentai/:id?', lazyloadRouteHandler('./routes/s-hentai'));
|
|
4232
4232
|
|
|
4233
|
+
// foreverblog
|
|
4234
|
+
router.get('/blogs/foreverblog', lazyloadRouteHandler('./routes/blogs/foreverblog'));
|
|
4235
|
+
|
|
4233
4236
|
// Netflix
|
|
4234
4237
|
router.get('/netflix/newsroom/:category?/:region?', lazyloadRouteHandler('./routes/netflix/newsroom'));
|
|
4235
4238
|
|
|
@@ -4259,4 +4262,8 @@ router.get('/fashionnetwork/news/:sectors?/:categories?/:language?', lazyloadRou
|
|
|
4259
4262
|
// dykszx
|
|
4260
4263
|
router.get('/dykszx/news/:type?', lazyloadRouteHandler('./routes/dykszx/news'));
|
|
4261
4264
|
|
|
4265
|
+
// 安全内参
|
|
4266
|
+
router.get('/secrss/category/:category?', lazyloadRouteHandler('./routes/secrss/category'));
|
|
4267
|
+
router.get('/secrss/author/:author?', lazyloadRouteHandler('./routes/secrss/author'));
|
|
4268
|
+
|
|
4262
4269
|
module.exports = router;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const response = await got({
|
|
6
|
+
method: 'get',
|
|
7
|
+
url: 'https://www.foreverblog.cn/feeds.html',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const data = response.data;
|
|
11
|
+
|
|
12
|
+
const $ = cheerio.load(data);
|
|
13
|
+
const list = $('article[class="post post-type-normal"]');
|
|
14
|
+
|
|
15
|
+
ctx.state.data = {
|
|
16
|
+
title: '十年之约 - 订阅',
|
|
17
|
+
link: 'https://www.foreverblog.cn/feeds.html',
|
|
18
|
+
language: 'zh-cn',
|
|
19
|
+
item:
|
|
20
|
+
list &&
|
|
21
|
+
list
|
|
22
|
+
.map((index, item) => {
|
|
23
|
+
item = $(item);
|
|
24
|
+
return {
|
|
25
|
+
title: item.find('a.post-title-link>span').text(),
|
|
26
|
+
description: item.find('div.post-author').text(),
|
|
27
|
+
link: item.find('a.post-title-link').attr('href'),
|
|
28
|
+
pubDate: item.find('time.post-time').text(),
|
|
29
|
+
};
|
|
30
|
+
})
|
|
31
|
+
.get(),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -12,8 +12,13 @@ module.exports = async (ctx) => {
|
|
|
12
12
|
} else {
|
|
13
13
|
items = await EhAPI.getSearchItems(ctx.cache, params, undefined, bittorrent);
|
|
14
14
|
}
|
|
15
|
+
let title = params;
|
|
16
|
+
const match = /f_search=([^&]+)/.exec(title);
|
|
17
|
+
if (match !== null) {
|
|
18
|
+
title = match[1];
|
|
19
|
+
}
|
|
15
20
|
ctx.state.data = {
|
|
16
|
-
title: 'E-Hentai Search',
|
|
21
|
+
title: title + ' - E-Hentai Search ',
|
|
17
22
|
link: `https://e-hentai.org/?${params}`,
|
|
18
23
|
item: items,
|
|
19
24
|
};
|
|
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
|
|
|
6
6
|
const bittorrent = ctx.params.bittorrent || false;
|
|
7
7
|
const items = await EhAPI.getTagItems(ctx.cache, tag, page, bittorrent);
|
|
8
8
|
ctx.state.data = {
|
|
9
|
-
title: 'E-Hentai
|
|
9
|
+
title: tag + ' - E-Hentai Tag',
|
|
10
10
|
link: `https://e-hentai.org/tag/${tag}`,
|
|
11
11
|
item: items,
|
|
12
12
|
};
|
|
@@ -4,7 +4,8 @@ const cheerio = require('cheerio');
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
5
|
const since = ctx.params.since;
|
|
6
6
|
const language = ctx.params.language || '';
|
|
7
|
-
const
|
|
7
|
+
const spoken_language = ctx.params.spoken_language || '';
|
|
8
|
+
const url = `https://github.com/trending/${encodeURIComponent(language)}?since=${since}&spoken_language_code=${spoken_language}`;
|
|
8
9
|
|
|
9
10
|
const response = await got({
|
|
10
11
|
method: 'get',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx) => {
|
|
4
|
+
const api = 'https://www.secrss.com/api/articles/group?author=';
|
|
5
|
+
const author = ctx.params.author;
|
|
6
|
+
const host = 'https://www.secrss.com';
|
|
7
|
+
const res = await got.get(`${api}${author}`);
|
|
8
|
+
const dataArray = res.data.data.list;
|
|
9
|
+
|
|
10
|
+
const items = dataArray.map((item) => ({
|
|
11
|
+
title: item.title,
|
|
12
|
+
description: item.summary,
|
|
13
|
+
pubDate: new Date(item.original_timestamp * 1000).toUTCString(),
|
|
14
|
+
link: `${host}${item.url}`,
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
ctx.state.data = {
|
|
18
|
+
title: `安全内参-${author}`,
|
|
19
|
+
link: 'https://www.secrss.com',
|
|
20
|
+
item: items,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx) => {
|
|
4
|
+
const api = 'https://www.secrss.com/api/articles?tag=';
|
|
5
|
+
let type = ctx.params.category;
|
|
6
|
+
if (type === undefined) {
|
|
7
|
+
type = "";
|
|
8
|
+
}
|
|
9
|
+
const host = 'https://www.secrss.com';
|
|
10
|
+
const res = await got.get(`${api}${type}`);
|
|
11
|
+
const dataArray = res.data.data;
|
|
12
|
+
|
|
13
|
+
const items = dataArray.map((item) => ({
|
|
14
|
+
title: item.title,
|
|
15
|
+
description: item.summary,
|
|
16
|
+
pubDate: new Date(item.published_at + " GMT").toUTCString(),
|
|
17
|
+
link: `${host}/articles/${item.id}`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
ctx.state.data = {
|
|
21
|
+
title: `安全内参-${type}`,
|
|
22
|
+
link: 'https://www.secrss.com',
|
|
23
|
+
item: items,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
const titles = {
|
|
7
|
+
'': { '': '最新' },
|
|
8
|
+
new: { '': '最新' },
|
|
9
|
+
hot: { '': '最热' },
|
|
10
|
+
ac: {
|
|
11
|
+
new: '最新',
|
|
12
|
+
hot: '最热',
|
|
13
|
+
},
|
|
14
|
+
bcid: {
|
|
15
|
+
801: '电脑',
|
|
16
|
+
802: '手机',
|
|
17
|
+
803: '业界',
|
|
18
|
+
806: '游戏',
|
|
19
|
+
807: '汽车',
|
|
20
|
+
809: '影视',
|
|
21
|
+
},
|
|
22
|
+
tid: {
|
|
23
|
+
1000: '科学',
|
|
24
|
+
1001: '排行',
|
|
25
|
+
1002: '评测',
|
|
26
|
+
1003: '一图',
|
|
27
|
+
},
|
|
28
|
+
icid: {
|
|
29
|
+
67: '百度',
|
|
30
|
+
90: '微软',
|
|
31
|
+
121: '安卓',
|
|
32
|
+
136: '华为',
|
|
33
|
+
140: '魅族',
|
|
34
|
+
148: 'OPPO',
|
|
35
|
+
154: '三星',
|
|
36
|
+
194: 'Xbox',
|
|
37
|
+
270: '阿里',
|
|
38
|
+
288: 'VIVO',
|
|
39
|
+
385: '一加',
|
|
40
|
+
429: '奔驰',
|
|
41
|
+
461: '宝马',
|
|
42
|
+
481: '大众',
|
|
43
|
+
770: '比亚迪',
|
|
44
|
+
1193: '特斯拉',
|
|
45
|
+
6950: 'PS5',
|
|
46
|
+
7259: '小鹏',
|
|
47
|
+
7318: '蔚来',
|
|
48
|
+
9355: '小米',
|
|
49
|
+
12947: '理想',
|
|
50
|
+
},
|
|
51
|
+
cid: {
|
|
52
|
+
12: '显卡',
|
|
53
|
+
13: 'CPU',
|
|
54
|
+
38: '路由器',
|
|
55
|
+
201: '苹果',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
module.exports = async (ctx) => {
|
|
60
|
+
const type = ctx.params.type ?? '';
|
|
61
|
+
const id = ctx.params.id ?? '';
|
|
62
|
+
|
|
63
|
+
const rootUrl = 'https://m.mydrivers.com';
|
|
64
|
+
const currentUrl = `${rootUrl}/${type === '' || type === 'ac' ? 'm/newslist.ashx' : 'newsclass.aspx'}${type ? (id ? `?${type}=${id}` : `?ac=${type}`) : ''}`;
|
|
65
|
+
|
|
66
|
+
const response = await got({
|
|
67
|
+
method: 'get',
|
|
68
|
+
url: currentUrl,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const $ = cheerio.load(response.data);
|
|
72
|
+
|
|
73
|
+
const list = $('.newst a')
|
|
74
|
+
.map((_, item) => {
|
|
75
|
+
item = $(item);
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
title: item.text(),
|
|
79
|
+
link: `${rootUrl}${item.attr('href')}`,
|
|
80
|
+
};
|
|
81
|
+
})
|
|
82
|
+
.get();
|
|
83
|
+
|
|
84
|
+
const items = await Promise.all(
|
|
85
|
+
list.map((item) =>
|
|
86
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
87
|
+
const detailResponse = await got({
|
|
88
|
+
method: 'get',
|
|
89
|
+
url: item.link,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const content = cheerio.load(detailResponse.data);
|
|
93
|
+
|
|
94
|
+
content('.ab, .bb').remove();
|
|
95
|
+
|
|
96
|
+
item.author = content('.writer').text();
|
|
97
|
+
item.description = content('#content').html();
|
|
98
|
+
item.pubDate = timezone(parseDate(content('.news_t1 ul li').eq(1).text().trim(), 'YYYY年MM月DD日 mm:ss'), +8);
|
|
99
|
+
|
|
100
|
+
return item;
|
|
101
|
+
})
|
|
102
|
+
)
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
ctx.state.data = {
|
|
106
|
+
title: `${titles[type][id]} - 快科技`,
|
|
107
|
+
link: currentUrl,
|
|
108
|
+
item: items,
|
|
109
|
+
};
|
|
110
|
+
};
|
package/lib/v2/pku/hr.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
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 category = ctx.params.category?.replace(/-/g, '/') ?? 'zxgg';
|
|
7
|
+
|
|
8
|
+
const rootUrl = 'https://hr.pku.edu.cn/';
|
|
9
|
+
const currentUrl = `${rootUrl}/${category}/index.htm`;
|
|
10
|
+
|
|
11
|
+
const response = await got({
|
|
12
|
+
method: 'get',
|
|
13
|
+
url: currentUrl,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const $ = cheerio.load(response.data);
|
|
17
|
+
|
|
18
|
+
const list = $('.item-list li a')
|
|
19
|
+
.map((_, item) => {
|
|
20
|
+
item = $(item);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
title: item.text().replace(/\d+、/, ''),
|
|
24
|
+
link: `${rootUrl}/${category}/${item.attr('href')}`,
|
|
25
|
+
};
|
|
26
|
+
})
|
|
27
|
+
.get();
|
|
28
|
+
|
|
29
|
+
const items = await Promise.all(
|
|
30
|
+
list.map((item) =>
|
|
31
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
32
|
+
const detailResponse = await got({
|
|
33
|
+
method: 'get',
|
|
34
|
+
url: item.link,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const content = cheerio.load(detailResponse.data);
|
|
38
|
+
|
|
39
|
+
content('.title').remove();
|
|
40
|
+
|
|
41
|
+
item.description = content('.article').html();
|
|
42
|
+
item.pubDate = parseDate(content('#date').text());
|
|
43
|
+
|
|
44
|
+
return item;
|
|
45
|
+
})
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
ctx.state.data = {
|
|
50
|
+
title: `${$('h2').text()} - ${$('title').text()}`,
|
|
51
|
+
link: currentUrl,
|
|
52
|
+
item: items,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const rootUrl = 'https://news.pts.org.tw';
|
|
8
|
+
const currentUrl = `${rootUrl}/dailynews`;
|
|
9
|
+
|
|
10
|
+
const response = await got({
|
|
11
|
+
method: 'get',
|
|
12
|
+
url: currentUrl,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const $ = cheerio.load(response.data);
|
|
16
|
+
|
|
17
|
+
const list = $('h2 a')
|
|
18
|
+
.map((_, item) => {
|
|
19
|
+
item = $(item);
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
title: item.text(),
|
|
23
|
+
link: item.attr('href'),
|
|
24
|
+
};
|
|
25
|
+
})
|
|
26
|
+
.get();
|
|
27
|
+
|
|
28
|
+
const items = await Promise.all(
|
|
29
|
+
list.map((item) =>
|
|
30
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
31
|
+
const detailResponse = await got({
|
|
32
|
+
method: 'get',
|
|
33
|
+
url: item.link,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const content = cheerio.load(detailResponse.data);
|
|
37
|
+
|
|
38
|
+
item.author = content('meta[property="article:author"]').attr('content');
|
|
39
|
+
item.pubDate = timezone(parseDate(content('meta[property="article:published_time"]').attr('content')), +8);
|
|
40
|
+
item.description = `<img src="${content('meta[property="og:image"]').attr('content')}">${content('.post-article').html()}`;
|
|
41
|
+
|
|
42
|
+
return item;
|
|
43
|
+
})
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
ctx.state.data = {
|
|
48
|
+
title: '即時 | 公視新聞網 PNN',
|
|
49
|
+
link: currentUrl,
|
|
50
|
+
item: items,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'pts.org.tw': {
|
|
3
|
+
_name: '公視新聞網 PNN',
|
|
4
|
+
news: [
|
|
5
|
+
{
|
|
6
|
+
title: '即時',
|
|
7
|
+
docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-ji-shi-xin-wen',
|
|
8
|
+
source: ['/dailynews'],
|
|
9
|
+
target: '/pts/dailynews',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
package/lib/v2/ruc/hr.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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 category = ctx.params.category?.replace(/-/g, '/') ?? 'tzgg';
|
|
7
|
+
|
|
8
|
+
const rootUrl = 'http://hr.ruc.edu.cn';
|
|
9
|
+
const currentUrl = `${rootUrl}/${category}/index.htm`;
|
|
10
|
+
|
|
11
|
+
const response = await got({
|
|
12
|
+
method: 'get',
|
|
13
|
+
url: currentUrl,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const $ = cheerio.load(response.data);
|
|
17
|
+
|
|
18
|
+
const list = $('a[title]')
|
|
19
|
+
.map((_, item) => {
|
|
20
|
+
item = $(item);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
title: item.text(),
|
|
24
|
+
link: `${rootUrl}/${category}/${item.attr('href')}`,
|
|
25
|
+
};
|
|
26
|
+
})
|
|
27
|
+
.get();
|
|
28
|
+
|
|
29
|
+
const items = await Promise.all(
|
|
30
|
+
list.map((item) =>
|
|
31
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
32
|
+
const detailResponse = await got({
|
|
33
|
+
method: 'get',
|
|
34
|
+
url: item.link,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const content = cheerio.load(detailResponse.data);
|
|
38
|
+
|
|
39
|
+
item.description = content('.neirong').html();
|
|
40
|
+
item.pubDate = parseDate(detailResponse.data.match(/日期:(\d{4}-\d{2}-\d{2})/)[1]);
|
|
41
|
+
|
|
42
|
+
return item;
|
|
43
|
+
})
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
ctx.state.data = {
|
|
48
|
+
title: $('title').text(),
|
|
49
|
+
link: currentUrl,
|
|
50
|
+
item: items,
|
|
51
|
+
};
|
|
52
|
+
};
|