rsshub 1.0.0-master.e2d6718 → 1.0.0-master.e2f463a

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 (157) hide show
  1. package/lib/config.ts +14 -0
  2. package/lib/errors/index.test.ts +2 -2
  3. package/lib/middleware/template.tsx +12 -3
  4. package/lib/router.js +0 -3
  5. package/lib/routes/0x80/index.ts +87 -0
  6. package/lib/routes/0x80/namespace.ts +7 -0
  7. package/lib/routes/accessbriefing/index.ts +217 -0
  8. package/lib/routes/accessbriefing/namespace.ts +8 -0
  9. package/lib/routes/accessbriefing/templates/description.art +27 -0
  10. package/lib/routes/aljazeera/index.ts +17 -14
  11. package/lib/routes/apple/podcast.ts +64 -0
  12. package/lib/routes/baai/events.ts +10 -21
  13. package/lib/routes/baai/hub.ts +59 -29
  14. package/lib/routes/baai/utils.ts +19 -4
  15. package/lib/routes/bbc/index.ts +4 -7
  16. package/lib/routes/bilibili/cache.ts +1 -1
  17. package/lib/routes/bing/daily-wallpaper.ts +9 -8
  18. package/lib/routes/bnu/mba.ts +202 -0
  19. package/lib/routes/byau/namespace.ts +6 -0
  20. package/lib/routes/byau/xinwen/index.ts +72 -0
  21. package/lib/routes/caixin/weekly.ts +5 -14
  22. package/lib/routes/chub/characters.ts +64 -0
  23. package/lib/routes/{thecatcity → chub}/namespace.ts +2 -2
  24. package/lib/routes/colamanga/manga.ts +88 -0
  25. package/lib/routes/colamanga/namespace.ts +9 -0
  26. package/lib/routes/copernicium/index.ts +67 -0
  27. package/lib/routes/copernicium/namespace.ts +6 -0
  28. package/lib/routes/cpcaauto/index.ts +255 -0
  29. package/lib/routes/cpcaauto/namespace.ts +8 -0
  30. package/lib/routes/crossbell/feeds/following.ts +20 -18
  31. package/lib/routes/crossbell/notes/utils.ts +15 -17
  32. package/lib/routes/daily/discussed.ts +0 -11
  33. package/lib/routes/daily/index.ts +2 -2
  34. package/lib/routes/daily/namespace.ts +1 -0
  35. package/lib/routes/daily/templates/posts.art +7 -0
  36. package/lib/routes/daily/upvoted.ts +5 -16
  37. package/lib/routes/daily/user.ts +227 -0
  38. package/lib/routes/daily/utils.ts +33 -16
  39. package/lib/routes/dehenglaw/index.ts +128 -0
  40. package/lib/routes/dehenglaw/namespace.ts +8 -0
  41. package/lib/routes/dehenglaw/templates/description.art +7 -0
  42. package/lib/routes/douyin/live.ts +1 -1
  43. package/lib/routes/douyu/room.ts +58 -18
  44. package/lib/routes/ecnu/jwc.ts +67 -0
  45. package/lib/routes/ecnu/namespace.ts +1 -1
  46. package/lib/routes/fanbox/index.ts +62 -0
  47. package/lib/routes/fanbox/namespace.ts +6 -0
  48. package/lib/routes/fanbox/templates/fanbox-post.art +7 -0
  49. package/lib/routes/fanbox/types.ts +239 -0
  50. package/lib/routes/fanbox/utils.ts +188 -0
  51. package/lib/routes/freexcomic/book.ts +84 -0
  52. package/lib/routes/freexcomic/namespace.ts +7 -0
  53. package/lib/routes/gov/ah/kjt.ts +229 -0
  54. package/lib/routes/gov/ah/namespace.ts +8 -0
  55. package/lib/routes/gov/jiangsu/wlt/index.ts +99 -0
  56. package/lib/routes/gov/jiangsu/wlt/templates/wlt.art +9 -0
  57. package/lib/routes/gov/{namespace.ts → pbc/namespace.ts} +1 -1
  58. package/lib/routes/gov/stats/index.ts +25 -22
  59. package/lib/routes/gov/zj/search.ts +80 -0
  60. package/lib/routes/gxmzu/ai.ts +1 -1
  61. package/lib/routes/gxmzu/lib.ts +9 -26
  62. package/lib/routes/gxmzu/utils/index.ts +31 -13
  63. package/lib/routes/gxmzu/yjs.ts +1 -1
  64. package/lib/routes/hackernews/index.ts +1 -1
  65. package/lib/routes/hellogithub/index.ts +2 -2
  66. package/lib/routes/hellogithub/report.ts +2 -1
  67. package/lib/routes/hellogithub/volume.ts +39 -24
  68. package/lib/routes/hoyolab/news.ts +5 -5
  69. package/lib/routes/ieee-security/sp.ts +6 -15
  70. package/lib/routes/iehou/index.ts +125 -0
  71. package/lib/routes/iehou/namespace.ts +8 -0
  72. package/lib/routes/jou/utils/index.ts +35 -25
  73. package/lib/routes/kpmg/insights.ts +143 -0
  74. package/lib/routes/kpmg/namespace.ts +10 -0
  75. package/lib/routes/kpmg/templates/description.art +11 -0
  76. package/lib/routes/lianxh/index.ts +116 -0
  77. package/lib/routes/lianxh/namespace.ts +7 -0
  78. package/lib/routes/lofter/tag.ts +3 -3
  79. package/lib/routes/lofter/user.ts +3 -3
  80. package/lib/routes/mckinsey/cn/index.ts +4 -7
  81. package/lib/routes/mihoyo/bbs/official.ts +86 -17
  82. package/lib/routes/mihoyo/templates/official.art +7 -0
  83. package/lib/routes/mixcloud/index.ts +26 -6
  84. package/lib/routes/mixcloud/queries.ts +934 -186
  85. package/lib/routes/ncu/jwc.ts +13 -2
  86. package/lib/routes/nju/jw.ts +4 -2
  87. package/lib/routes/njxzc/utils/index.ts +31 -13
  88. package/lib/routes/olevod/namespace.ts +6 -0
  89. package/lib/routes/olevod/vod.ts +49 -0
  90. package/lib/routes/olevod/vodlist.ts +48 -0
  91. package/lib/routes/ollama/models.ts +39 -0
  92. package/lib/routes/ollama/namespace.ts +6 -0
  93. package/lib/routes/papers/index.ts +100 -59
  94. package/lib/routes/papers/namespace.ts +2 -0
  95. package/lib/routes/qingting/podcast.ts +61 -39
  96. package/lib/routes/reuters/common.ts +2 -2
  97. package/lib/routes/sara/index.ts +66 -0
  98. package/lib/routes/sara/namespace.ts +6 -0
  99. package/lib/routes/sigsac/ccs.ts +16 -22
  100. package/lib/routes/sjtu/yzb/zkxx.ts +2 -2
  101. package/lib/routes/sohu/mp.ts +183 -63
  102. package/lib/routes/stbu/jsjxy.ts +3 -3
  103. package/lib/routes/stbu/xyxw.ts +14 -3
  104. package/lib/routes/steam/appcommunityfeed.ts +92 -0
  105. package/lib/routes/steam/templates/appcommunityfeed-description.art +4 -0
  106. package/lib/routes/telegram/channel.ts +12 -0
  107. package/lib/routes/tencent/news/author.ts +13 -11
  108. package/lib/routes/test/index.ts +11 -1
  109. package/lib/routes/{thecatcity → thepetcity}/index.ts +23 -32
  110. package/lib/routes/thepetcity/namespace.ts +6 -0
  111. package/lib/routes/thepetcity/terms-map.ts +28 -0
  112. package/lib/routes/threads/index.ts +36 -38
  113. package/lib/routes/threads/utils.ts +43 -12
  114. package/lib/routes/ttv/index.ts +78 -0
  115. package/lib/routes/ttv/namespace.ts +6 -0
  116. package/lib/routes/twitter/api/mobile-api/login.ts +36 -33
  117. package/lib/routes/twitter/api/web-api/constants.ts +30 -0
  118. package/lib/routes/twitter/api/web-api/utils.ts +1 -1
  119. package/lib/routes/twitter/namespace.ts +2 -2
  120. package/lib/routes/twitter/tweet.ts +10 -1
  121. package/lib/routes/twitter/user.ts +5 -0
  122. package/lib/routes/u3c3/index.ts +1 -1
  123. package/lib/routes/u3c3/namespace.ts +1 -1
  124. package/lib/routes/u9a9/index.ts +2 -2
  125. package/lib/routes/u9a9/namespace.ts +1 -1
  126. package/lib/routes/usenix/usenix.ts +24 -31
  127. package/lib/routes/wechat/tgchannel.ts +8 -1
  128. package/lib/routes/weibo/keyword.ts +12 -10
  129. package/lib/routes/yenpress/namespace.ts +7 -0
  130. package/lib/routes/yenpress/series.ts +115 -0
  131. package/lib/routes/yenpress/templates/series.art +25 -0
  132. package/lib/routes/zhihu/activities.ts +5 -4
  133. package/lib/routes/zsxq/group.ts +63 -0
  134. package/lib/routes/zsxq/namespace.ts +6 -0
  135. package/lib/routes/zsxq/types.ts +149 -0
  136. package/lib/routes/zsxq/user.ts +58 -0
  137. package/lib/routes/zsxq/utils.ts +70 -0
  138. package/lib/setup.test.ts +184 -12
  139. package/lib/utils/got.test.ts +2 -1
  140. package/lib/utils/got.ts +2 -5
  141. package/lib/utils/render.ts +1 -1
  142. package/lib/utils/request-rewriter/get.ts +8 -1
  143. package/lib/utils/wechat-mp.test.ts +411 -32
  144. package/lib/utils/wechat-mp.ts +447 -76
  145. package/lib/views/error.tsx +1 -23
  146. package/lib/views/index.tsx +4 -26
  147. package/lib/views/layout.tsx +50 -0
  148. package/lib/views/{rss3-ums.ts → rss3.ts} +2 -2
  149. package/package.json +49 -45
  150. package/lib/routes/baai/comments.ts +0 -59
  151. package/lib/routes/gov/anhui/kjt.ts +0 -65
  152. package/lib/routes/thecatcity/terms-map.ts +0 -28
  153. package/lib/routes-deprecated/fanbox/conv.js +0 -227
  154. package/lib/routes-deprecated/fanbox/header.js +0 -13
  155. package/lib/routes-deprecated/fanbox/main.js +0 -45
  156. package/lib/routes-deprecated/kpmg/insights.js +0 -79
  157. package/lib/routes-deprecated/manxiaosi/book.js +0 -49
@@ -1,47 +1,77 @@
1
1
  import { Route } from '@/types';
2
2
  import cache from '@/utils/cache';
3
- import got from '@/utils/got';
3
+ import ofetch from '@/utils/ofetch';
4
4
  import { load } from 'cheerio';
5
5
 
6
- import { baseUrl, apiHost, parseEventDetail, parseItem } from './utils';
6
+ import { baseUrl, apiHost, getTagsData, parseEventDetail, parseItem } from './utils';
7
+ import InvalidParameterError from '@/errors/types/invalid-parameter';
7
8
 
8
9
  export const route: Route = {
9
- path: ['/hub/:tagId/:sort?/:range?', '/hub/:tagId/:sort?', '/hub/:sort?'],
10
- name: 'Unknown',
11
- maintainers: [],
10
+ path: ['/hub/:tagId?/:sort?/:range?'],
11
+ categories: ['programming'],
12
+ example: '/baai/hub',
13
+ parameters: {
14
+ tagId: '社群 ID,可在 [社群页](https://hub.baai.ac.cn/taglist) 或 URL 中找到',
15
+ sort: '排序,见下表,默认为 `new`',
16
+ range: '时间跨度,仅在排序 `readCnt` 时有效',
17
+ },
18
+ description: `排序
19
+
20
+ | 最新 | 最热 |
21
+ | ---- | ------- |
22
+ | new | readCnt |
23
+
24
+ 时间跨度
25
+
26
+ | 3 天 | 本周 | 本月 |
27
+ | ---- | ---- | ---- |
28
+ | 3 | 7 | 30 |`,
29
+ radar: [
30
+ {
31
+ source: ['baai.ac.cn/'],
32
+ target: (_params, url) => {
33
+ const searchParams = new URL(url).searchParams;
34
+ const tagId = searchParams.get('tag_id');
35
+ const sort = searchParams.get('sort');
36
+ const range = searchParams.get('time_range');
37
+ return `/baai/hub${tagId ? `/${tagId}` : ''}${sort ? `/${sort}` : ''}${range ? `/${range}` : ''}`;
38
+ },
39
+ },
40
+ ],
41
+ name: '智源社区',
42
+ maintainers: ['TonyRL'],
12
43
  handler,
13
44
  };
14
45
 
15
46
  async function handler(ctx) {
16
- const { tagId, sort = 'new', range } = ctx.req.param();
47
+ const { tagId = '', sort = 'new', range } = ctx.req.param();
17
48
 
18
49
  let title, description, brief, iconUrl;
19
50
  if (tagId) {
20
- const { data } = await got(`${apiHost}/api/v1/tags`, {
21
- searchParams: {
22
- id: tagId,
23
- },
24
- });
25
- title = data.data[0].title;
26
- description = data.data[0].description;
27
- brief = data.data[0].brief;
28
- iconUrl = data.data[0].icon_url;
51
+ const tagsData = await getTagsData();
52
+
53
+ const tag = (tagsData as Record<string, string>[]).find((tag) => tag.id === tagId);
54
+ if (tag) {
55
+ title = tag.title;
56
+ description = tag.description;
57
+ brief = tag.brief;
58
+ iconUrl = tag.iconUrl;
59
+ } else {
60
+ throw new InvalidParameterError('Tag not found');
61
+ }
29
62
  }
30
63
 
31
- const responses = await got.all(
32
- Array.from(
33
- {
34
- // first 3 pages
35
- length: (ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 18) / 6,
36
- },
37
- (_, v) => `${apiHost}/api/v1/story/list?page=${v + 1}&sort=${sort}${tagId ? `&tag_id=${tagId}` : ''}${range ? `&time_range=${range}` : ''}`
38
- ).map((url) => got.post(url))
39
- );
64
+ const response = await ofetch(`${apiHost}/api/v1/story/list`, {
65
+ method: 'POST',
66
+ query: {
67
+ page: 1,
68
+ sort,
69
+ tag_id: tagId,
70
+ time_range: range,
71
+ },
72
+ });
40
73
 
41
- const list = responses
42
- .filter((response) => response.data.data)
43
- .flatMap((response) => response.data.data)
44
- .map((item) => parseItem(item));
74
+ const list = response.data.map((item) => parseItem(item));
45
75
 
46
76
  const items = await Promise.all(
47
77
  list.map((item) =>
@@ -49,7 +79,7 @@ async function handler(ctx) {
49
79
  if (item.eventId) {
50
80
  item.description = await parseEventDetail(item);
51
81
  } else {
52
- const { data: response } = await got(item.link);
82
+ const response = await ofetch(item.link);
53
83
  const $ = load(response);
54
84
  item.description = item.is_event ? $('div.box2').html() : $('.post-content').html();
55
85
  }
@@ -1,11 +1,25 @@
1
- import got from '@/utils/got';
1
+ import ofetch from '@/utils/ofetch';
2
+ import { destr } from 'destr';
2
3
  import { parseDate } from '@/utils/parse-date';
3
4
  import timezone from '@/utils/timezone';
5
+ import cache from '@/utils/cache';
4
6
 
5
7
  const baseUrl = 'https://hub.baai.ac.cn';
6
8
  const eventUrl = 'https://event.baai.ac.cn';
7
9
  const apiHost = 'https://hub-api.baai.ac.cn';
8
10
 
11
+ const getTagsData = () =>
12
+ cache.tryGet('baai:tags', async () => {
13
+ const { data } = await ofetch(`${apiHost}/api/v1/tags`);
14
+ return data.map((item) => ({
15
+ id: item.id,
16
+ title: item.title,
17
+ description: item.description,
18
+ brief: item.brief,
19
+ iconUrl: item.icon_url,
20
+ }));
21
+ });
22
+
9
23
  const parseItem = (item) => ({
10
24
  link: item.is_event ? `${eventUrl}/activities/${item.event_info.id}` : `${baseUrl}/view/${item.story_id}`,
11
25
  title: item.is_event ? item.event_info.name : item.story_info.title,
@@ -16,12 +30,13 @@ const parseItem = (item) => ({
16
30
  });
17
31
 
18
32
  const parseEventDetail = async (item) => {
19
- const { data } = await got(`${eventUrl}/api/api/Activity/IntroductionTypes`, {
20
- searchParams: {
33
+ const data = await ofetch(`${eventUrl}/api/api/Activity/IntroductionTypes`, {
34
+ query: {
21
35
  activityId: item.eventId,
22
36
  },
37
+ parseResponse: (txt) => destr(txt),
23
38
  });
24
39
  return data.data.ac_desc + data.data.ac_desc_two;
25
40
  };
26
41
 
27
- export { baseUrl, eventUrl, apiHost, parseItem, parseEventDetail };
42
+ export { baseUrl, eventUrl, apiHost, getTagsData, parseItem, parseEventDetail };
@@ -1,9 +1,9 @@
1
1
  import { Route } from '@/types';
2
2
  import cache from '@/utils/cache';
3
- import got from '@/utils/got';
4
3
  import parser from '@/utils/rss-parser';
5
4
  import { load } from 'cheerio';
6
5
  import utils from './utils';
6
+ import ofetch from '@/utils/ofetch';
7
7
 
8
8
  export const route: Route = {
9
9
  path: '/:site?/:channel?',
@@ -61,14 +61,11 @@ async function handler(ctx) {
61
61
  const items = await Promise.all(
62
62
  feed.items.map((item) =>
63
63
  cache.tryGet(item.link, async () => {
64
- const response = await got({
65
- method: 'get',
66
- url: item.link,
67
- });
64
+ const response = await ofetch(item.link);
68
65
 
69
- const $ = load(response.data);
66
+ const $ = load(response);
70
67
 
71
- const description = response.request.options.url.pathname.startsWith('/news/av') ? item.content : utils.ProcessFeed($);
68
+ const description = new URL(item.link).pathname.startsWith('/news/av') ? item.content : utils.ProcessFeed($);
72
69
 
73
70
  let section = 'sport';
74
71
  const urlSplit = item.link.split('/');
@@ -27,7 +27,7 @@ const getCookie = () => {
27
27
  await page.goto('https://space.bilibili.com/1/dynamic');
28
28
  const cookieString = await waitForRequest;
29
29
  logger.debug(`Got bilibili cookie: ${cookieString}`);
30
-
30
+ await browser.close();
31
31
  return cookieString;
32
32
  });
33
33
  };
@@ -1,5 +1,7 @@
1
1
  import { Route } from '@/types';
2
- import got from '@/utils/got';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { parseDate } from '@/utils/parse-date';
4
+ import timezone from '@/utils/timezone';
3
5
 
4
6
  export const route: Route = {
5
7
  path: '/',
@@ -9,25 +11,23 @@ export const route: Route = {
9
11
  target: '',
10
12
  },
11
13
  ],
12
- name: 'Unknown',
14
+ name: '每日壁纸',
13
15
  maintainers: ['FHYunCai'],
14
16
  handler,
15
17
  url: 'cn.bing.com/',
16
18
  };
17
19
 
18
20
  async function handler(ctx) {
19
- const response = await got({
20
- method: 'get',
21
- prefixUrl: 'https://cn.bing.com',
22
- url: 'HPImageArchive.aspx',
23
- searchParams: {
21
+ const response = await ofetch('HPImageArchive.aspx', {
22
+ baseURL: 'https://cn.bing.com',
23
+ query: {
24
24
  format: 'js',
25
25
  idx: 0,
26
26
  n: ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 7,
27
27
  mkt: 'zh-CN',
28
28
  },
29
29
  });
30
- const data = response.data;
30
+ const data = response;
31
31
  return {
32
32
  title: 'Bing每日壁纸',
33
33
  link: 'https://cn.bing.com/',
@@ -35,6 +35,7 @@ async function handler(ctx) {
35
35
  title: item.copyright,
36
36
  description: `<img src="https://cn.bing.com${item.url}">`,
37
37
  link: item.copyrightlink,
38
+ pubDate: timezone(parseDate(item.fullstartdate), 0),
38
39
  })),
39
40
  };
40
41
  }
@@ -0,0 +1,202 @@
1
+ import { Route } from '@/types';
2
+
3
+ import cache from '@/utils/cache';
4
+ import got from '@/utils/got';
5
+ import { load } from 'cheerio';
6
+ import { parseDate } from '@/utils/parse-date';
7
+
8
+ export const handler = async (ctx) => {
9
+ const { category = 'xwdt' } = ctx.req.param();
10
+ const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20;
11
+
12
+ const rootUrl = 'https://mba.bnu.edu.cn';
13
+ const currentUrl = new URL(`${category.replace(/\/$/, '')}/`, rootUrl).href;
14
+
15
+ const { data: response } = await got(currentUrl);
16
+
17
+ const $ = load(response);
18
+
19
+ const language = $('html').prop('lang');
20
+
21
+ let items = $('ul.concrcc li')
22
+ .slice(0, limit)
23
+ .toArray()
24
+ .map((item) => {
25
+ item = $(item);
26
+
27
+ const a = item.find('a.listlj');
28
+ const title = a.text();
29
+
30
+ return {
31
+ title,
32
+ pubDate: parseDate(item.find('div.crq').text()),
33
+ link: new URL(a.prop('href'), currentUrl).href,
34
+ language,
35
+ };
36
+ });
37
+
38
+ items = await Promise.all(
39
+ items.map((item) =>
40
+ cache.tryGet(item.link, async () => {
41
+ const { data: detailResponse } = await got(item.link);
42
+
43
+ const $$ = load(detailResponse);
44
+
45
+ const title = $$('div.connewst').text();
46
+ const description = $$('div.concrczw').html();
47
+ const image = $$('div.concrczw img').first().prop('src');
48
+
49
+ item.title = title;
50
+ item.description = description;
51
+ item.pubDate = parseDate($$('div.connewstis-time').text().split(/:/).pop());
52
+ item.content = {
53
+ html: description,
54
+ text: $$('div.concrczw').text(),
55
+ };
56
+ item.image = image;
57
+ item.banner = image;
58
+ item.language = language;
59
+
60
+ return item;
61
+ })
62
+ )
63
+ );
64
+
65
+ const author = $('title').text();
66
+ const image = new URL('images/logo5.png', rootUrl).href;
67
+
68
+ return {
69
+ title: `${author} - ${$('div.concrchbt').text()}`,
70
+ link: currentUrl,
71
+ item: items,
72
+ allowEmpty: true,
73
+ image,
74
+ author,
75
+ language,
76
+ };
77
+ };
78
+
79
+ export const route: Route = {
80
+ path: '/mba/:category{.+}?',
81
+ name: '经济与工商管理学院MBA',
82
+ url: 'mba.bnu.edu.cn',
83
+ maintainers: ['nczitzk'],
84
+ handler,
85
+ example: '/bnu/mba/xwdt',
86
+ parameters: { category: '分类,默认为 xwdt,即新闻聚焦' },
87
+ description: `:::tip
88
+ 若订阅 [新闻聚焦](https://mba.bnu.edu.cn/xwdt/index.html),网址为 \`https://mba.bnu.edu.cn/xwdt/index.html\`。截取 \`https://mba.bnu.edu.cn/\` 到末尾 \`/index.html\` 的部分 \`xwdt\` 作为参数填入,此时路由为 [\`/bnu/mba/xwdt\`](https://rsshub.app/bnu/mba/xwdt)。
89
+ :::
90
+
91
+ #### [主页](https://mba.bnu.edu.cn)
92
+
93
+ | [新闻聚焦](https://mba.bnu.edu.cn/xwdt/index.html) | [通知公告](https://mba.bnu.edu.cn/tzgg/index.html) | [MBA 系列讲座](https://mba.bnu.edu.cn/mbaxljz/index.html) |
94
+ | -------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- |
95
+ | [xwdt](https://rsshub.app/bnu/mba/xwdt) | [tzgg](https://rsshub.app/bnu/mba/tzgg) | [mbaxljz](https://rsshub.app/bnu/mba/mbaxljz) |
96
+
97
+ #### [招生动态](https://mba.bnu.edu.cn/zsdt/zsjz/index.html)
98
+
99
+ | [下载专区](https://mba.bnu.edu.cn/zsdt/cjwt/index.html) |
100
+ | ------------------------------------------------------- |
101
+ | [zsdt/cjwt](https://rsshub.app/bnu/mba/zsdt/cjwt) |
102
+
103
+ #### [国际视野](https://mba.bnu.edu.cn/gjhz/hwjd/index.html)
104
+
105
+ | [海外基地](https://mba.bnu.edu.cn/gjhz/hwjd/index.html) | [学位合作](https://mba.bnu.edu.cn/gjhz/xwhz/index.html) | [长期交换](https://mba.bnu.edu.cn/gjhz/zqjh/index.html) | [短期项目](https://mba.bnu.edu.cn/gjhz/dqxm/index.html) |
106
+ | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
107
+ | [gjhz/hwjd](https://rsshub.app/bnu/mba/gjhz/hwjd) | [gjhz/xwhz](https://rsshub.app/bnu/mba/gjhz/xwhz) | [gjhz/zqjh](https://rsshub.app/bnu/mba/gjhz/zqjh) | [gjhz/dqxm](https://rsshub.app/bnu/mba/gjhz/dqxm) |
108
+
109
+ #### [校园生活](https://mba.bnu.edu.cn/xysh/xszz/index.html)
110
+
111
+ | [学生组织](https://mba.bnu.edu.cn/xysh/xszz/index.html) |
112
+ | ------------------------------------------------------- |
113
+ | [xysh/xszz](https://rsshub.app/bnu/mba/xysh/xszz) |
114
+
115
+ #### [职业发展](https://mba.bnu.edu.cn/zyfz/xwds/index.html)
116
+
117
+ | [校外导师](https://mba.bnu.edu.cn/zyfz/xwds/index.html) | [企业实践](https://mba.bnu.edu.cn/zyfz/zycp/index.html) | [就业创业](https://mba.bnu.edu.cn/zyfz/jycy/index.html) |
118
+ | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
119
+ | [zyfz/xwds](https://rsshub.app/bnu/mba/zyfz/xwds) | [zyfz/zycp](https://rsshub.app/bnu/mba/zyfz/zycp) | [zyfz/jycy](https://rsshub.app/bnu/mba/zyfz/jycy) |
120
+ `,
121
+ categories: ['university'],
122
+
123
+ features: {
124
+ requireConfig: false,
125
+ requirePuppeteer: false,
126
+ antiCrawler: false,
127
+ supportRadar: true,
128
+ supportBT: false,
129
+ supportPodcast: false,
130
+ supportScihub: false,
131
+ },
132
+ radar: [
133
+ {
134
+ source: ['mba.bnu.edu.cn/:category?'],
135
+ target: (params) => {
136
+ const category = params.category;
137
+
138
+ return category ? `/${category.replace(/\/index\.html$/, '')}` : '';
139
+ },
140
+ },
141
+ {
142
+ title: '新闻聚焦',
143
+ source: ['mba.bnu.edu.cn/xwdt/index.html'],
144
+ target: '/mba/xwdt',
145
+ },
146
+ {
147
+ title: '通知公告',
148
+ source: ['mba.bnu.edu.cn/tzgg/index.html'],
149
+ target: '/mba/tzgg',
150
+ },
151
+ {
152
+ title: 'MBA系列讲座',
153
+ source: ['mba.bnu.edu.cn/mbaxljz/index.html'],
154
+ target: '/mba/mbaxljz',
155
+ },
156
+ {
157
+ title: '招生动态 - 下载专区',
158
+ source: ['mba.bnu.edu.cn/zsdt/cjwt/index.html'],
159
+ target: '/mba/zsdt/cjwt',
160
+ },
161
+ {
162
+ title: '国际视野 - 海外基地',
163
+ source: ['mba.bnu.edu.cn/gjhz/hwjd/index.html'],
164
+ target: '/mba/gjhz/hwjd',
165
+ },
166
+ {
167
+ title: '国际视野 - 学位合作',
168
+ source: ['mba.bnu.edu.cn/gjhz/xwhz/index.html'],
169
+ target: '/mba/gjhz/xwhz',
170
+ },
171
+ {
172
+ title: '国际视野 - 长期交换',
173
+ source: ['mba.bnu.edu.cn/gjhz/zqjh/index.html'],
174
+ target: '/mba/gjhz/zqjh',
175
+ },
176
+ {
177
+ title: '国际视野 - 短期项目',
178
+ source: ['mba.bnu.edu.cn/gjhz/dqxm/index.html'],
179
+ target: '/mba/gjhz/dqxm',
180
+ },
181
+ {
182
+ title: '校园生活 - 学生组织',
183
+ source: ['mba.bnu.edu.cn/xysh/xszz/index.html'],
184
+ target: '/mba/xysh/xszz',
185
+ },
186
+ {
187
+ title: '职业发展 - 校外导师',
188
+ source: ['mba.bnu.edu.cn/zyfz/xwds/index.html'],
189
+ target: '/mba/zyfz/xwds',
190
+ },
191
+ {
192
+ title: '职业发展 - 企业实践',
193
+ source: ['mba.bnu.edu.cn/zyfz/zycp/index.html'],
194
+ target: '/mba/zyfz/zycp',
195
+ },
196
+ {
197
+ title: '职业发展 - 就业创业',
198
+ source: ['mba.bnu.edu.cn/zyfz/jycy/index.html'],
199
+ target: '/mba/zyfz/jycy',
200
+ },
201
+ ],
202
+ };
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: '黑龙江八一农垦大学',
5
+ url: 'byau.edu.cn',
6
+ };
@@ -0,0 +1,72 @@
1
+ import { Route } from '@/types';
2
+ import cache from '@/utils/cache';
3
+ import got from '@/utils/got';
4
+ import { load } from 'cheerio';
5
+ import { parseDate } from '@/utils/parse-date';
6
+ import timezone from '@/utils/timezone';
7
+
8
+ export const route: Route = {
9
+ path: '/news/:type_id',
10
+ categories: ['university'],
11
+ example: '/byau/news/3674',
12
+ parameters: { type_id: '栏目类型(从菜单栏获取对应 ID)' },
13
+ radar: [
14
+ {
15
+ source: ['xinwen.byau.edu.cn/:type_id/list.htm'],
16
+ target: '/news/:type_id',
17
+ },
18
+ ],
19
+ name: '新闻网',
20
+ maintainers: ['ueiu'],
21
+ handler,
22
+ url: 'xinwen.byau.edu.cn',
23
+ description: `| 学校要闻 | 校园动态 |
24
+ | ---- | ----------- |
25
+ | 3674 | 3676 |`,
26
+ };
27
+
28
+ async function handler(ctx) {
29
+ const baseUrl = 'http://xinwen.byau.edu.cn/';
30
+
31
+ const typeID = ctx.req.param('type_id');
32
+ const url = `${baseUrl}${typeID}/list.htm`;
33
+
34
+ const response = await got(url);
35
+ const $ = load(response.data);
36
+
37
+ const list = $('.news')
38
+ .toArray()
39
+ .map((item) => {
40
+ const $$ = load(item);
41
+
42
+ const originalItemUrl = $$('a').attr('href');
43
+ // 因为学校要闻的头两个像是固定了跳转专栏页面的,不能相同处理
44
+ const startsWithHttp = originalItemUrl.startsWith('http');
45
+ const itemUrl = startsWithHttp ? originalItemUrl : new URL(originalItemUrl, baseUrl).href;
46
+
47
+ return {
48
+ title: $$('a').text(),
49
+ link: itemUrl,
50
+ pubDate: timezone(parseDate($$('.news_meta').text()), +8),
51
+ };
52
+ });
53
+
54
+ const items = await Promise.all(
55
+ list.map((item) =>
56
+ cache.tryGet(item.link, async () => {
57
+ const response = await got(item.link);
58
+ const $ = load(response.data);
59
+
60
+ item.description = $('.col_news_con').html();
61
+
62
+ return item;
63
+ })
64
+ )
65
+ );
66
+
67
+ return {
68
+ title: $('title').text(),
69
+ link: url,
70
+ item: items,
71
+ };
72
+ }
@@ -1,4 +1,4 @@
1
- import { Route } from '@/types';
1
+ import { DataItem, Route } from '@/types';
2
2
  import cache from '@/utils/cache';
3
3
  import got from '@/utils/got';
4
4
  import { load } from 'cheerio';
@@ -8,15 +8,6 @@ export const route: Route = {
8
8
  path: '/weekly',
9
9
  categories: ['traditional-media'],
10
10
  example: '/caixin/weekly',
11
- parameters: {},
12
- features: {
13
- requireConfig: false,
14
- requirePuppeteer: false,
15
- antiCrawler: false,
16
- supportBT: false,
17
- supportPodcast: false,
18
- supportScihub: false,
19
- },
20
11
  radar: [
21
12
  {
22
13
  source: ['weekly.caixin.com/', 'weekly.caixin.com/*'],
@@ -38,16 +29,16 @@ async function handler(ctx) {
38
29
  ...$('.mi')
39
30
  .toArray()
40
31
  .map((item) => ({
41
- link: $(item).find('a').attr('href'),
32
+ link: $(item).find('a').attr('href')?.replace('http:', 'https:'),
42
33
  })),
43
34
  ...$('.xsjCon a')
44
35
  .toArray()
45
36
  .map((item) => ({
46
37
  link: $(item).attr('href'),
47
38
  })),
48
- ].slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10);
39
+ ].slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10) as DataItem[];
49
40
 
50
- const items = await Promise.all(
41
+ const items = (await Promise.all(
51
42
  list.map((item) =>
52
43
  cache.tryGet(item.link, async () => {
53
44
  const { data } = await got(item.link);
@@ -73,7 +64,7 @@ async function handler(ctx) {
73
64
  return item;
74
65
  })
75
66
  )
76
- );
67
+ )) as DataItem[];
77
68
 
78
69
  return {
79
70
  title: $('head title')
@@ -0,0 +1,64 @@
1
+ import { Route } from '@/types';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { parseDate } from '@/utils/parse-date';
4
+
5
+ export const route: Route = {
6
+ path: '/characters',
7
+ categories: ['new-media'],
8
+ example: '/chub/characters',
9
+ name: 'Characters',
10
+ maintainers: ['flameleaf'],
11
+ handler,
12
+ };
13
+
14
+ async function handler() {
15
+ const hostURL = 'https://www.chub.ai/characters';
16
+ const apiURL = 'https://api.chub.ai/api/characters/search';
17
+ const data = await ofetch(apiURL, {
18
+ headers: { Accept: 'application/json' },
19
+ query: {
20
+ query: '',
21
+ first: 200,
22
+ page: 1,
23
+ sort: 'last_activity_at',
24
+ asc: 'false',
25
+ include_forks: 'false',
26
+ nsfw: 'true',
27
+ nsfl: 'true',
28
+ nsfw_only: 'false',
29
+ require_images: 'false',
30
+ require_example_dialogues: 'false',
31
+ require_alternate_greetings: 'false',
32
+ require_custom_prompt: 'false',
33
+ exclude_mine: 'false',
34
+ venus: 'true',
35
+ chub: 'true',
36
+ min_tokens: 50,
37
+ require_expressions: 'false',
38
+ require_lore: 'false',
39
+ mine_first: 'false',
40
+ require_lore_embedded: 'false',
41
+ require_lore_linked: 'false',
42
+ inclusive_or: 'false',
43
+ recommended_verified: 'false',
44
+ },
45
+ });
46
+ const nodes = data.nodes;
47
+
48
+ return {
49
+ allowEmpty: true,
50
+ title: 'Chub',
51
+ link: hostURL,
52
+ item: nodes.map((item) => ({
53
+ title: item.name,
54
+ description: `${item.tagline}<br><br>${item.description}`,
55
+ pubDate: parseDate(item.createdAt),
56
+ updated: parseDate(item.lastActivityAt),
57
+ link: `${hostURL}/${item.fullPath}`,
58
+ author: String(item.fullPath.split('/', 1)),
59
+ enclosure_url: item.avatar_url,
60
+ enclosure_type: `image/webp`,
61
+ category: item.topics,
62
+ })),
63
+ };
64
+ }
@@ -1,6 +1,6 @@
1
1
  import type { Namespace } from '@/types';
2
2
 
3
3
  export const namespace: Namespace = {
4
- name: '貓奴日常',
5
- url: 'thecatcity.com',
4
+ name: 'Chub',
5
+ url: 'chub.ai',
6
6
  };