rsshub 1.0.0-master.baeafb9 → 1.0.0-master.bb80a2e

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.
Files changed (104) hide show
  1. package/README.md +4 -3
  2. package/lib/config.js +4 -0
  3. package/lib/middleware/cache/index.js +3 -3
  4. package/lib/middleware/cache/memory.js +5 -11
  5. package/lib/router.js +23 -22
  6. package/lib/routes/amd/graphicsdrivers.js +1 -1
  7. package/lib/routes/weibo/keyword.js +18 -10
  8. package/lib/routes/weibo/super_index.js +24 -15
  9. package/lib/routes/weibo/timeline.js +37 -14
  10. package/lib/routes/weibo/user.js +42 -18
  11. package/lib/routes/weibo/utils.js +39 -0
  12. package/lib/utils/parse-date.js +171 -17
  13. package/lib/utils/torrent.js +9 -1
  14. package/lib/v2/asus/bios.js +38 -0
  15. package/lib/v2/asus/maintainer.js +3 -0
  16. package/lib/v2/asus/radar.js +13 -0
  17. package/lib/v2/asus/router.js +3 -0
  18. package/lib/v2/asus/templates/bios.art +6 -0
  19. package/lib/v2/douban/people/status.js +10 -2
  20. package/lib/v2/douban/people/wish.js +55 -43
  21. package/lib/v2/gov/anhui/kjt.js +56 -0
  22. package/lib/v2/gov/maintainer.js +1 -0
  23. package/lib/v2/gov/radar.js +90 -76
  24. package/lib/v2/gov/router.js +1 -0
  25. package/lib/v2/hupu/all.js +73 -0
  26. package/lib/v2/hupu/bbs.js +64 -0
  27. package/lib/v2/hupu/index.js +72 -0
  28. package/lib/v2/hupu/maintainer.js +7 -0
  29. package/lib/v2/hupu/radar.js +35 -0
  30. package/lib/v2/hupu/router.js +7 -0
  31. package/lib/v2/hupu/templates/description.art +6 -0
  32. package/lib/{routes → v2}/ifeng/feng.js +7 -5
  33. package/lib/v2/ifeng/maintainer.js +3 -0
  34. package/lib/v2/ifeng/radar.js +11 -0
  35. package/lib/v2/ifeng/router.js +3 -0
  36. package/lib/{routes → v2}/ifeng/utils.js +0 -0
  37. package/lib/v2/kakuyomu/episode.js +54 -0
  38. package/lib/v2/kakuyomu/maintainer.js +3 -0
  39. package/lib/v2/kakuyomu/radar.js +13 -0
  40. package/lib/v2/kakuyomu/router.js +1 -0
  41. package/lib/v2/mihoyo/bbs.js +62 -0
  42. package/lib/v2/mihoyo/maintainer.js +3 -0
  43. package/lib/v2/mihoyo/radar.js +31 -0
  44. package/lib/v2/mihoyo/router.js +3 -0
  45. package/lib/v2/mihoyo/templates/description.art +6 -0
  46. package/lib/{routes → v2}/mpaypass/main.js +23 -27
  47. package/lib/v2/mpaypass/maintainer.js +4 -0
  48. package/lib/v2/mpaypass/news.js +39 -0
  49. package/lib/v2/mpaypass/radar.js +19 -0
  50. package/lib/v2/mpaypass/router.js +4 -0
  51. package/lib/v2/natgeo/dailyphoto.js +32 -0
  52. package/lib/v2/natgeo/dailyselection.js +41 -0
  53. package/lib/v2/natgeo/maintainer.js +5 -0
  54. package/lib/{routes → v2}/natgeo/natgeo.js +18 -32
  55. package/lib/v2/natgeo/radar.js +24 -0
  56. package/lib/v2/natgeo/router.js +5 -0
  57. package/lib/v2/natgeo/templates/dailyPhoto.art +5 -0
  58. package/lib/v2/nuaa/cs/index.js +87 -0
  59. package/lib/v2/nuaa/jwc/jwc.js +82 -0
  60. package/lib/v2/nuaa/maintainer.js +5 -0
  61. package/lib/v2/nuaa/radar.js +23 -0
  62. package/lib/v2/nuaa/router.js +5 -0
  63. package/lib/{routes/universities → v2}/nuaa/utils/pypasswaf.js +1 -1
  64. package/lib/{routes/universities → v2}/nuaa/yjsy/yjsy.js +16 -22
  65. package/lib/v2/picuki/profile.js +12 -3
  66. package/lib/v2/pubmed/maintainer.js +3 -0
  67. package/lib/v2/pubmed/radar.js +13 -0
  68. package/lib/v2/pubmed/router.js +3 -0
  69. package/lib/v2/pubmed/templates/description.art +7 -0
  70. package/lib/v2/pubmed/trending.js +58 -0
  71. package/lib/v2/qweather/3days.js +46 -0
  72. package/lib/v2/qweather/maintainer.js +4 -0
  73. package/lib/v2/qweather/now.js +46 -0
  74. package/lib/v2/qweather/router.js +4 -0
  75. package/lib/v2/qweather/util/3days.art +20 -0
  76. package/lib/v2/qweather/util/now.art +16 -0
  77. package/lib/v2/telegram/channel.js +10 -6
  78. package/lib/v2/test/index.js +1 -1
  79. package/lib/{routes → v2}/thepaper/839studio/category.js +0 -0
  80. package/lib/{routes → v2}/thepaper/839studio/studio.js +0 -0
  81. package/lib/{routes → v2}/thepaper/channel.js +0 -0
  82. package/lib/v2/thepaper/factpaper.js +61 -0
  83. package/lib/{routes → v2}/thepaper/featured.js +0 -0
  84. package/lib/{routes → v2}/thepaper/list.js +0 -0
  85. package/lib/v2/thepaper/maintainer.js +8 -0
  86. package/lib/v2/thepaper/radar.js +42 -0
  87. package/lib/v2/thepaper/router.js +8 -0
  88. package/lib/v2/thepaper/templates/factpaper.art +12 -0
  89. package/lib/v2/thepaper/utils.js +55 -0
  90. package/lib/v2/zooTeam/blog.js +32 -0
  91. package/lib/v2/zooTeam/maintainer.js +4 -0
  92. package/lib/v2/zooTeam/radar.js +21 -0
  93. package/lib/v2/zooTeam/router.js +4 -0
  94. package/lib/v2/zooTeam/weekly.js +34 -0
  95. package/package.json +12 -8
  96. package/lib/routes/hupu/all.js +0 -53
  97. package/lib/routes/hupu/bbs.js +0 -83
  98. package/lib/routes/hupu/dept.js +0 -66
  99. package/lib/routes/mpaypass/news.js +0 -43
  100. package/lib/routes/natgeo/dailyphoto.js +0 -27
  101. package/lib/routes/pubmed/trending.js +0 -65
  102. package/lib/routes/thepaper/utils.js +0 -48
  103. package/lib/routes/universities/nuaa/cs/index.js +0 -84
  104. package/lib/routes/universities/nuaa/jwc/jwc.js +0 -105
@@ -2,7 +2,7 @@ const host = 'http://aao.nuaa.edu.cn/';
2
2
 
3
3
  /**
4
4
  * async function 获取cookie
5
- * @desc 返回一个可用的cookie,使用 `got` 发起请求的时候,传入到`options.header.cookie`即可
5
+ * @desc 返回一个可用的cookie,使用 `got` 发起请求的时候,传入到`options.headers.cookie`即可
6
6
  */
7
7
  module.exports = async function getCookie() {
8
8
  const browser = await require('@/utils/puppeteer')();
@@ -1,8 +1,7 @@
1
1
  const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
- const url = require('url');
4
3
  const host = 'http://www.graduate.nuaa.edu.cn/';
5
- const formatPubDate = require('@/utils/date.js');
4
+ const { parseDate } = require('@/utils/parse-date');
6
5
 
7
6
  const map = {
8
7
  latest: '2146/list.htm',
@@ -12,24 +11,20 @@ const map = {
12
11
  xxfw: '2147/list.htm',
13
12
  };
14
13
 
15
- async function load(link, ctx) {
16
- const cache = await ctx.cache.get(link);
17
- if (cache) {
18
- return cache;
19
- }
20
- const response = await got.get(host + link);
21
- const $ = cheerio.load(response.data);
22
- const images = $('img');
23
- for (let k = 0; k < images.length; k++) {
24
- $(images[k]).replaceWith(`<img src="${url.resolve(host, $(images[k]).attr('src'))}" />`);
25
- }
26
- const description = $('.wp_articlecontent').html();
27
- ctx.cache.set(link, description);
28
- return { description };
29
- }
14
+ const load = (link, ctx) =>
15
+ ctx.cache.tryGet(link, async () => {
16
+ const response = await got(host + link);
17
+ const $ = cheerio.load(response.data);
18
+ const images = $('img');
19
+ for (let k = 0; k < images.length; k++) {
20
+ $(images[k]).replaceWith(`<img src="${new URL($(images[k]).attr('src'), host).href}" />`);
21
+ }
22
+ const description = $('.wp_articlecontent').html();
23
+ return { description };
24
+ });
30
25
 
31
26
  module.exports = async (ctx) => {
32
- const type = ctx.params.type || 'latest';
27
+ const type = ctx.params.type ?? 'latest';
33
28
  const response = await got({
34
29
  method: 'get',
35
30
  url: host + map[type],
@@ -43,12 +38,11 @@ module.exports = async (ctx) => {
43
38
  const itemUrl = a.attr('href');
44
39
  const single = {
45
40
  title: a.text(),
46
- link: url.resolve(host, itemUrl),
47
- guid: url.resolve(host, itemUrl),
48
- pubDate: formatPubDate(t.text()),
41
+ link: new URL(itemUrl, host).href,
42
+ pubDate: parseDate(t.text(), 'YYYY-MM-DD'),
49
43
  };
50
44
  const other = await load(itemUrl, ctx);
51
- return Promise.resolve(Object.assign({}, single, other));
45
+ return { ...single, ...other };
52
46
  })
53
47
  );
54
48
 
@@ -3,6 +3,7 @@ const cheerio = require('cheerio');
3
3
  const chrono = require('chrono-node');
4
4
  const { art } = require('@/utils/render');
5
5
  const path = require('path');
6
+ const config = require('@/config').value;
6
7
 
7
8
  module.exports = async (ctx) => {
8
9
  const id = ctx.params.id;
@@ -11,8 +12,16 @@ module.exports = async (ctx) => {
11
12
 
12
13
  const profileUrl = `https://www.picuki.com/profile/${id}`;
13
14
 
14
- const response = await got.get(profileUrl);
15
- const $ = cheerio.load(response.data);
15
+ const data = await ctx.cache.tryGet(
16
+ profileUrl,
17
+ async () => {
18
+ const _r = await got(profileUrl);
19
+ return _r.data;
20
+ },
21
+ config.cache.routeExpire,
22
+ false
23
+ );
24
+ const $ = cheerio.load(data);
16
25
 
17
26
  const profileName = $('.profile-name-bottom').text();
18
27
  const profileImg = $('.profile-avatar > img').attr('src');
@@ -22,7 +31,7 @@ module.exports = async (ctx) => {
22
31
 
23
32
  async function getMedia(url) {
24
33
  const getPost = async () => {
25
- const response = await got.get(url, {
34
+ const response = await got(url, {
26
35
  headers: {
27
36
  Referer: profileUrl,
28
37
  },
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/trending/:filters?': ['nczitzk'],
3
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ 'pubmed.ncbi.nlm.nih.gov': {
3
+ _name: 'PubMed',
4
+ '.': [
5
+ {
6
+ title: 'Trending articles',
7
+ docs: 'https://docs.rsshub.app/journal.html#pubmed-trending-articles',
8
+ source: ['/trending', '/'],
9
+ target: (params, url) => `/pubmed/trending/${new URL(url).searchParams.getAll('filter').join(',')}`,
10
+ },
11
+ ],
12
+ },
13
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = function (router) {
2
+ router.get('/trending/:filters?', require('./trending'));
3
+ };
@@ -0,0 +1,7 @@
1
+ {{ if authors }}
2
+ {{@ authors }}
3
+ {{ /if}}
4
+ <br>
5
+ {{ if abs }}
6
+ {{@ abs }}
7
+ {{ /if}}
@@ -0,0 +1,58 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+ const { art } = require('@/utils/render');
5
+ const path = require('path');
6
+
7
+ module.exports = async (ctx) => {
8
+ const filters = ctx.params.filters;
9
+
10
+ const rootUrl = 'https://pubmed.ncbi.nlm.nih.gov';
11
+ const currentUrl = `${rootUrl}/trending${filters ? `?filter=${filters.replace(/,/g, '&filter=')}` : ''}`;
12
+
13
+ const response = await got({
14
+ method: 'get',
15
+ url: currentUrl,
16
+ });
17
+
18
+ const $ = cheerio.load(response.data);
19
+
20
+ let items = $('a[data-article-id]')
21
+ .toArray()
22
+ .map((item) => {
23
+ item = $(item);
24
+
25
+ return {
26
+ title: item.text(),
27
+ link: `${rootUrl}/${item.attr('data-article-id')}`,
28
+ };
29
+ });
30
+
31
+ items = await Promise.all(
32
+ items.map((item) =>
33
+ ctx.cache.tryGet(item.link, async () => {
34
+ const detailResponse = await got({
35
+ method: 'get',
36
+ url: item.link,
37
+ });
38
+
39
+ const content = cheerio.load(detailResponse.data);
40
+
41
+ item.doi = content('meta[name="citation_doi"]').attr('content');
42
+ item.pubDate = parseDate(content('meta[name="citation_date"]').attr('content'));
43
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
44
+ authors: content('.authors-list').html(),
45
+ abs: content('#enc-abstract').html(),
46
+ });
47
+
48
+ return item;
49
+ })
50
+ )
51
+ );
52
+
53
+ ctx.state.data = {
54
+ title: 'Trending page - PubMed',
55
+ link: currentUrl,
56
+ item: items,
57
+ };
58
+ };
@@ -0,0 +1,46 @@
1
+ const got = require('@/utils/got');
2
+ const { art } = require('@/utils/render');
3
+ const path = require('path');
4
+ const config = require('@/config').value;
5
+ const rootUrl = 'https://devapi.qweather.com/v7/weather/3d?';
6
+
7
+ module.exports = async (ctx) => {
8
+ const id = await ctx.cache.tryGet(ctx.params.location + '_id', async () => {
9
+ const response = await got(`https://geoapi.qweather.com/v2/city/lookup?location=${ctx.params.location}&key=${config.hefeng.key}`);
10
+ const data = [];
11
+ for (const i in response.data.location) {
12
+ data.push(response.data.location[i]);
13
+ }
14
+ return data[0].id;
15
+ });
16
+ const requestUrl = rootUrl + 'key=' + config.hefeng.key + '&location=' + id;
17
+ const responseData = await ctx.cache.tryGet(
18
+ ctx.params.location,
19
+ async () => {
20
+ const response = await got(requestUrl);
21
+ return response.data;
22
+ },
23
+ config.cache.contentExpire,
24
+ false
25
+ );
26
+ const data = [];
27
+ for (const i in responseData.daily) {
28
+ data.push(responseData.daily[i]);
29
+ }
30
+ const items = data.map((item) => ({
31
+ title: '预报日期:' + item.fxDate,
32
+ description: art(path.join(__dirname, './util/3days.art'), {
33
+ item,
34
+ }),
35
+ pubDate: responseData.updateTime,
36
+ guid: '位置:' + ctx.params.location + '--日期:' + item.fxDate,
37
+ link: responseData.fxLink,
38
+ }));
39
+
40
+ ctx.state.data = {
41
+ title: ctx.params.location + '未来三天天气',
42
+ description: ctx.params.location + '未来三天天气情况,使用和风彩云api',
43
+ item: items,
44
+ link: responseData.fxLink,
45
+ };
46
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '/qweather/3days/:location': ['Rein-Ou'],
3
+ '/qweather/now/:location': ['Rein-Ou'],
4
+ };
@@ -0,0 +1,46 @@
1
+ const got = require('@/utils/got');
2
+ const { art } = require('@/utils/render');
3
+ const path = require('path');
4
+ const { parseDate } = require('@/utils/parse-date');
5
+ const config = require('@/config').value;
6
+ const rootUrl = 'https://devapi.qweather.com/v7/weather/now?';
7
+ module.exports = async (ctx) => {
8
+ const id = await ctx.cache.tryGet(ctx.params.location + '_id', async () => {
9
+ const response = await got(`https://geoapi.qweather.com/v2/city/lookup?location=${ctx.params.location}&key=${config.hefeng.key}`);
10
+ const data = [];
11
+ for (const i in response.data.location) {
12
+ data.push(response.data.location[i]);
13
+ }
14
+ return data[0].id;
15
+ });
16
+ const requestUrl = rootUrl + 'key=' + config.hefeng.key + '&location=' + id;
17
+ const responseData = await ctx.cache.tryGet(
18
+
19
+ ctx.params.location + '_now',
20
+ async () => {
21
+ const response = await got(requestUrl);
22
+ return response.data;
23
+ },
24
+ 3600, // second
25
+ false
26
+ );
27
+
28
+ const data = [responseData.now];
29
+
30
+ const timeObj = parseDate(responseData.updateTime);
31
+
32
+ const time_show = timeObj.getFullYear() + '-' + timeObj.getMonth() + '-' + timeObj.getDay() + ' ' + timeObj.getHours() + ':' + timeObj.getMinutes();
33
+
34
+ ctx.state.data = {
35
+ title: ctx.params.location + '实时天气',
36
+ description: ctx.params.location + '实时天气状况',
37
+ item: data.map((item) => ({
38
+ title: '观测时间:' + time_show,
39
+ description: art(path.join(__dirname, './util/now.art'), { item }),
40
+ pubDate: timeObj,
41
+ guid: '位置:' + ctx.params.location + '--时间:' + time_show,
42
+ link: responseData.fxLink,
43
+ })),
44
+ link: responseData.fxLink,
45
+ };
46
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = function (router) {
2
+ router.get('/3days/:location', require('./3days'));
3
+ router.get('/now/:location', require('./now'));
4
+ };
@@ -0,0 +1,20 @@
1
+ <text>白天:{{item.textDay}}——夜间:{{item.textNight}}</text>
2
+ <br>
3
+ <text>气温:{{item.tempMin}}℃~{{item.tempMax}}℃</text>
4
+ <br>
5
+ <text>相对湿度:{{item.humidity}}%</text>
6
+ <br>
7
+ <text>大气压强:{{item.pressure}}百帕</text>
8
+ <br>
9
+ <text>紫外线强度:{{item.uvIndex}}</text>
10
+ <br>
11
+ <text>白天风向:{{item.windDirDay}} 风力:{{item.windScaleDay}}级 风速:{{item.windSpeedDay}}公里/小时</text>
12
+ <br>
13
+ <text>夜间风向:{{item.windDirNight}} 风力:{{item.windScaleNight}}级 风速:{{item.windSpeedNight}}公里/小时</text>
14
+ <br>
15
+ <text>能见度:{{item.vis}}公里</text>
16
+ <br>
17
+ <text>日出:{{item.sunrise}} 日落: {{item.sunset}}</text>
18
+ <br>
19
+ <text>月相:{{item.moonPhase}} 月出:{{item.sunrise}} 月落:{{item.moonset}}
20
+ <br>
@@ -0,0 +1,16 @@
1
+ <text>天气:{{item.text}}</text>
2
+ <br>
3
+ <text>气温:{{item.temp}}</text>
4
+ <br>
5
+ <text>体感温度:{{item.feelsLike}}</text>
6
+ <br>
7
+ <text>风向:{{item.windDir}}</text>
8
+ <br>
9
+ <text>风力:{{item.windScale}} 风速:{{item.windSpeed}}公里</text>
10
+ <br>
11
+ <text>湿度:{{item.humidity}}% 大气压强:{{item.pressure}}百帕</text>
12
+ <br>
13
+ <text>本小时降水量:{{item.precip}}</text>
14
+ <br>
15
+ <text>能见度:{{item.vis}}公里</text>
16
+ <br>
@@ -82,12 +82,16 @@ module.exports = async (ctx) => {
82
82
 
83
83
  const resourceUrl = searchQuery ? `https://t.me/s/${username}?q=${encodeURIComponent(searchQuery)}` : `https://t.me/s/${username}`;
84
84
 
85
- let data = await ctx.cache.get(resourceUrl, false);
86
- if (!data) {
87
- const response = await got.get(resourceUrl);
88
- data = response.data;
89
- ctx.cache.set(resourceUrl, data, config.cache.routeExpire);
90
- }
85
+ const data = await ctx.cache.tryGet(
86
+ resourceUrl,
87
+ async () => {
88
+ const _r = await got(resourceUrl);
89
+ return _r.data;
90
+ },
91
+ config.cache.routeExpire,
92
+ false
93
+ );
94
+
91
95
  const $ = cheerio.load(data);
92
96
  const list = includeServiceMsg
93
97
  ? $('.tgme_widget_message_wrap:not(.tgme_widget_message_wrap:has(.tme_no_messages_found))') // exclude 'no posts found' messages
@@ -62,7 +62,7 @@ module.exports = async (ctx) => {
62
62
  }
63
63
  if (!noRefresh) {
64
64
  noRefresh = '0';
65
- await ctx.cache.set('noRefreshCache', '1', undefined, false);
65
+ await ctx.cache.set('noRefreshCache', '1', undefined);
66
66
  }
67
67
  item.push({
68
68
  title: 'Cache Title',
File without changes
File without changes
@@ -0,0 +1,61 @@
1
+ const got = require('@/utils/got');
2
+ const timezone = require('@/utils/timezone');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+ const { art } = require('@/utils/render');
5
+ const path = require('path');
6
+
7
+ module.exports = async (ctx) => {
8
+ const status = parseInt(ctx.params.status ?? '1');
9
+
10
+ const rootUrl = 'https://www.factpaper.cn';
11
+ const apiRootUrl = 'https://api.factpaper.cn';
12
+ const currentUrl = `${apiRootUrl}/fact-check/front/proveList`;
13
+
14
+ const response = await got({
15
+ method: 'post',
16
+ url: currentUrl,
17
+ json: {
18
+ pageNum: 1,
19
+ pageSize: 20,
20
+ status,
21
+ },
22
+ });
23
+
24
+ let items = response.data.data.list.map((item) => ({
25
+ title: item.title,
26
+ guid: item.proveId,
27
+ link: `${rootUrl}/detail?id=${item.proveId}`,
28
+ pubDate: timezone(parseDate(item.publishTime), +8),
29
+ }));
30
+
31
+ items = await Promise.all(
32
+ items.map((item) =>
33
+ ctx.cache.tryGet(item.link, async () => {
34
+ const detailResponse = await got({
35
+ method: 'post',
36
+ url: `${apiRootUrl}/fact-check/front/proveInfo`,
37
+ json: {
38
+ proveId: item.guid,
39
+ },
40
+ });
41
+
42
+ const data = detailResponse.data.data;
43
+
44
+ item.author = data.userName;
45
+ item.description = art(path.join(__dirname, 'templates/factpaper.art'), {
46
+ content: data.content,
47
+ checkinfo: data.checkInfoList,
48
+ finalCheckInfo: data.finalCheckInfo,
49
+ });
50
+
51
+ return item;
52
+ })
53
+ )
54
+ );
55
+
56
+ ctx.state.data = {
57
+ title: `澎湃明查 - ${status === 1 ? '有定论' : '核查中'}`,
58
+ link: rootUrl,
59
+ item: items,
60
+ };
61
+ };
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ '/839studio/:id': ['umm233'],
3
+ '/839studio': ['umm233'],
4
+ '/channel/:id': ['xyqfer', 'nczitzk'],
5
+ '/featured': ['HenryQW', 'nczitzk'],
6
+ '/factpaper/:status?': ['nczitzk'],
7
+ '/list/:id': ['nczitzk'],
8
+ };
@@ -0,0 +1,42 @@
1
+ module.exports = {
2
+ 'thepaper.cn': {
3
+ _name: '澎湃新闻',
4
+ '.': [
5
+ {
6
+ title: '首页头条',
7
+ docs: 'https://docs.rsshub.app/traditional-media.html#peng-pai-xin-wen-shou-ye-tou-tiao',
8
+ source: ['/'],
9
+ target: '/thepaper/featured',
10
+ },
11
+ {
12
+ title: '频道',
13
+ docs: 'https://docs.rsshub.app/traditional-media.html#peng-pai-xin-wen-pin-dao',
14
+ source: ['/'],
15
+ target: (params, url) => `/thepaper/channel/${new URL(url).search(/channel_(\d+)/)}`,
16
+ },
17
+ {
18
+ title: '列表',
19
+ docs: 'https://docs.rsshub.app/traditional-media.html#peng-pai-xin-wen-lie-biao',
20
+ source: ['/'],
21
+ target: (params, url) => `/thepaper/channel/${new URL(url).search(/list_(\d+)/)}`,
22
+ },
23
+ {
24
+ title: '澎湃美数组作品集',
25
+ docs: 'https://docs.rsshub.app/traditional-media.html#peng-pai-xin-wen-peng-pai-mei-shu-zuo-pin-ji',
26
+ source: ['/'],
27
+ target: '/thepaper/839studio/:id',
28
+ },
29
+ ],
30
+ },
31
+ 'factpaper.cn': {
32
+ _name: '澎湃新闻',
33
+ '.': [
34
+ {
35
+ title: '明查',
36
+ docs: 'https://docs.rsshub.app/traditional-media.html#peng-pai-xin-wen-ming-cha',
37
+ source: ['/'],
38
+ target: '/thepaper/factpaper/:status',
39
+ },
40
+ ],
41
+ },
42
+ };
@@ -0,0 +1,8 @@
1
+ module.exports = function (router) {
2
+ router.get('/839studio', require('./839studio/studio'));
3
+ router.get('/839studio/:id', require('./839studio/category'));
4
+ router.get('/channel/:id', require('./channel'));
5
+ router.get('/featured', require('./featured'));
6
+ router.get('/factpaper/:status?', require('./factpaper'));
7
+ router.get('/list/:id', require('./list'));
8
+ };
@@ -0,0 +1,12 @@
1
+ <h1>发起求证</h1>
2
+ {{@ content }}
3
+ {{if checkinfo}}
4
+ <h1>一起核查</h1>
5
+ {{each checkinfo check}}
6
+ {{@ check.content }}
7
+ {{/each}}
8
+ {{/if}}
9
+ {{if finalCheckInfo}}
10
+ <h1>有定论了</h1>
11
+ {{@ finalCheckInfo.content }}
12
+ {{/if}}
@@ -0,0 +1,55 @@
1
+ const cheerio = require('cheerio');
2
+ const date = require('@/utils/date');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+ const timezone = require('@/utils/timezone');
5
+ const got = require('@/utils/got');
6
+
7
+ module.exports = {
8
+ ProcessFeed: async (query, link, ctx) => {
9
+ const res = await got(link);
10
+
11
+ const $ = cheerio.load(res.data);
12
+ const list = $(query).slice(0, 10).get();
13
+
14
+ return Promise.all(
15
+ list.map((item) => {
16
+ const $ = cheerio.load(item);
17
+ const itemUrl = `https://m.thepaper.cn/${$(item).find('a').eq(0).attr('href')}`;
18
+ return ctx.cache.tryGet(itemUrl, async () => {
19
+ const res = await got(itemUrl);
20
+ const content = cheerio.load(res.data);
21
+
22
+ let description, pubDate;
23
+
24
+ if (content('div.news_video_msg').length > 0) {
25
+ description = content('#vdetail_sum').html();
26
+ pubDate = timezone(
27
+ parseDate(
28
+ content('div.news_video_msg')
29
+ .html()
30
+ .replace(/&nbsp;/gi, '')
31
+ .split('<br>')[0]
32
+ ),
33
+ +8
34
+ );
35
+ } else if (content('#slider_wrapper_ul').length > 0) {
36
+ description = '';
37
+ pubDate = new Date(date($(item).find('div.list_item_extra span').eq(1).text())).toUTCString();
38
+ } else {
39
+ description = content('div.newsdetail_content').html();
40
+ pubDate = timezone(parseDate(content('div.date').text().trim().split('来源:')[0].trim()), +8);
41
+ }
42
+
43
+ const single = {
44
+ title: content('title').text(),
45
+ link: itemUrl,
46
+ description,
47
+ pubDate,
48
+ author: content('div.author').text(),
49
+ };
50
+ return single;
51
+ });
52
+ })
53
+ );
54
+ },
55
+ };
@@ -0,0 +1,32 @@
1
+ const got = require('@/utils/got');
2
+ const timezone = require('@/utils/timezone');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+
5
+ module.exports = async (ctx) => {
6
+ const response = await got({
7
+ method: 'get',
8
+ url: 'https://www.zoo.team/api/articles',
9
+ });
10
+ const data = response.data.data.articles;
11
+ ctx.state.data = {
12
+ // 源标题
13
+ title: '政采云前端博客',
14
+ // 源链接
15
+ link: 'https://www.zoo.team',
16
+ // 源说明
17
+ description: '政采云前端博客',
18
+ // 遍历此前获取的数据
19
+ item: data.map((item) => ({
20
+ // 文章标题
21
+ title: item.title,
22
+ // 文章正文
23
+ description: `${item.desc}<br><img src="${item.cover}">`,
24
+ // 文章发布时间
25
+ pubDate: timezone(parseDate(item.created_at), +8),
26
+ // 文章链接
27
+ link: `https://zoo.team/article/${item.path}`,
28
+ // 分类
29
+ category: item.category,
30
+ })),
31
+ };
32
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '/zooTeam/blog': ['Pulset'],
3
+ '/zooTeam/weekly': ['Pulset'],
4
+ };
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ 'zoo.team': {
3
+ _name: '政采云前端技术团队',
4
+ weekly: [
5
+ {
6
+ title: '小报',
7
+ docs: 'https://docs.rsshub.app/blog.html#zheng-cai-yun-qian-duan-ji-shu-tuan-dui',
8
+ source: '/',
9
+ target: '/zooTeam/weekly',
10
+ },
11
+ ],
12
+ www: [
13
+ {
14
+ title: '博客',
15
+ docs: 'https://docs.rsshub.app/blog.html#zheng-cai-yun-qian-duan-ji-shu-tuan-dui',
16
+ source: '/',
17
+ target: '/zooTeam/blog',
18
+ },
19
+ ],
20
+ },
21
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = function (router) {
2
+ router.get('/blog', require('./blog'));
3
+ router.get('/weekly', require('./weekly'));
4
+ };