rsshub 1.0.0-master.f72af1b → 1.0.0-master.f7347d9

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 (222) hide show
  1. package/lib/config.ts +18 -0
  2. package/lib/middleware/template.tsx +10 -2
  3. package/lib/routes/163/music/playlist.ts +2 -1
  4. package/lib/routes/5eplay/index.ts +1 -51
  5. package/lib/routes/a9vg/index.ts +214 -0
  6. package/lib/routes/a9vg/namespace.ts +1 -0
  7. package/lib/routes/a9vg/templates/description.art +17 -0
  8. package/lib/routes/aibase/discover.ts +388 -0
  9. package/lib/routes/aibase/namespace.ts +8 -0
  10. package/lib/routes/aibase/news.ts +118 -0
  11. package/lib/routes/aibase/templates/description.art +100 -0
  12. package/lib/routes/aibase/topic.ts +614 -0
  13. package/lib/routes/aibase/util.ts +114 -0
  14. package/lib/routes/apnews/api.ts +18 -3
  15. package/lib/routes/apnews/rss.ts +1 -1
  16. package/lib/routes/apnews/topics.ts +4 -3
  17. package/lib/routes/apple/podcast.ts +19 -15
  18. package/lib/routes/bangumi/templates/tv/subject.art +6 -0
  19. package/lib/routes/bangumi/tv/other/followrank.ts +19 -22
  20. package/lib/routes/bangumi/tv/user/collections.ts +172 -0
  21. package/lib/routes/bilibili/cache.ts +16 -8
  22. package/lib/routes/bilibili/utils.ts +85 -3
  23. package/lib/routes/bilibili/video.ts +7 -9
  24. package/lib/routes/bilibili/vsearch.ts +1 -1
  25. package/lib/routes/bjnews/cat.ts +9 -1
  26. package/lib/routes/cbpanet/index.ts +380 -0
  27. package/lib/routes/cbpanet/namespace.ts +8 -0
  28. package/lib/routes/ceph/blog.ts +72 -0
  29. package/lib/routes/ceph/namespace.ts +7 -0
  30. package/lib/routes/chinanews/index.ts +1 -1
  31. package/lib/routes/chinaventure/index.ts +1 -1
  32. package/lib/routes/cisia/index.ts +264 -0
  33. package/lib/routes/cisia/namespace.ts +8 -0
  34. package/lib/routes/cjlu/namespace.ts +10 -0
  35. package/lib/routes/cjlu/yjsy/index.ts +107 -0
  36. package/lib/routes/cnki/journals.ts +31 -2
  37. package/lib/routes/cohere/index.ts +54 -0
  38. package/lib/routes/cohere/namespace.ts +6 -0
  39. package/lib/routes/coolapk/dyh.ts +7 -1
  40. package/lib/routes/coolapk/hot.ts +7 -1
  41. package/lib/routes/coolapk/huati.ts +7 -1
  42. package/lib/routes/coolapk/namespace.ts +6 -0
  43. package/lib/routes/coolapk/toutiao.ts +7 -1
  44. package/lib/routes/coolapk/tuwen.ts +10 -5
  45. package/lib/routes/coolapk/user-dynamic.ts +7 -1
  46. package/lib/routes/damai/activity.ts +3 -2
  47. package/lib/routes/dcfever/trading.ts +3 -5
  48. package/lib/routes/dcfever/utils.ts +13 -4
  49. package/lib/routes/dealstreetasia/home.ts +72 -0
  50. package/lib/routes/dealstreetasia/namespace.ts +6 -0
  51. package/lib/routes/dealstreetasia/section.ts +57 -0
  52. package/lib/routes/dlsite/campaign.ts +1 -2
  53. package/lib/routes/dlsite/new.ts +1 -2
  54. package/lib/routes/dlsite/{index.ts → z-index/index.ts} +1 -1
  55. package/lib/routes/douban/other/topic.ts +10 -4
  56. package/lib/routes/douyin/types.ts +795 -0
  57. package/lib/routes/douyin/user.ts +51 -23
  58. package/lib/routes/douyin/utils.ts +1 -87
  59. package/lib/routes/dribbble/keyword.ts +1 -1
  60. package/lib/routes/dribbble/popular.ts +1 -1
  61. package/lib/routes/dribbble/user.ts +1 -1
  62. package/lib/routes/dribbble/utils.ts +16 -18
  63. package/lib/routes/famitsu/category.ts +1 -1
  64. package/lib/routes/fanbox/index.ts +1 -1
  65. package/lib/routes/fanbox/types.ts +1 -5
  66. package/lib/routes/fediverse/timeline.ts +21 -3
  67. package/lib/routes/follow/profile.ts +4 -2
  68. package/lib/routes/follow/types.ts +11 -1
  69. package/lib/routes/github/advisor.ts +97 -0
  70. package/lib/routes/github/discussions.ts +194 -0
  71. package/lib/routes/github/issue.ts +1 -1
  72. package/lib/routes/github/pulls.ts +1 -1
  73. package/lib/routes/gmcmonline/chinacustoms.ts +130 -0
  74. package/lib/routes/gmcmonline/namespace.ts +8 -0
  75. package/lib/routes/gov/csrc/csrc.ts +541 -0
  76. package/lib/routes/gov/customs/list.ts +5 -2
  77. package/lib/routes/gov/customs/namespace.ts +7 -0
  78. package/lib/routes/gov/jgjcndrc/index.ts +95 -66
  79. package/lib/routes/gov/moa/moa.ts +3 -3
  80. package/lib/routes/gov/moa/szcpxx.ts +115 -0
  81. package/lib/routes/gov/moa/zdscxx.ts +71 -21
  82. package/lib/routes/gov/ndrc/zfxxgk.ts +106 -0
  83. package/lib/routes/gov/pudong/zwgk.ts +65 -0
  84. package/lib/routes/gov/zj/search.ts +17 -12
  85. package/lib/routes/guancha/member.ts +1 -1
  86. package/lib/routes/hellogithub/index.ts +17 -67
  87. package/lib/routes/hellogithub/report.ts +1 -1
  88. package/lib/routes/hex-rays/index.ts +23 -29
  89. package/lib/routes/hfut/hf/notice.ts +43 -0
  90. package/lib/routes/hfut/hf/utils.ts +80 -0
  91. package/lib/routes/hfut/namespace.ts +6 -0
  92. package/lib/routes/hfut/xc/notice.ts +43 -0
  93. package/lib/routes/hfut/xc/utils.ts +73 -0
  94. package/lib/routes/hko/earthquake.ts +56 -0
  95. package/lib/routes/hko/namespace.ts +8 -0
  96. package/lib/routes/hko/weather.ts +56 -0
  97. package/lib/routes/huggingface/blog-zh.ts +1 -1
  98. package/lib/routes/hust/mse.ts +575 -0
  99. package/lib/routes/i-cable/namespace.ts +6 -0
  100. package/lib/routes/i-cable/news.ts +77 -0
  101. package/lib/routes/i-cable/templates/description.art +8 -0
  102. package/lib/routes/infoq/presentations.ts +203 -0
  103. package/lib/routes/infoq/templates/description.art +41 -0
  104. package/lib/routes/ipsw.dev/index.ts +64 -0
  105. package/lib/routes/ipsw.dev/namespace.ts +7 -0
  106. package/lib/routes/ipsw.dev/templates/description.art +20 -0
  107. package/lib/routes/ixigua/user-video.ts +18 -7
  108. package/lib/routes/javtiful/actress.ts +37 -0
  109. package/lib/routes/javtiful/channel.ts +37 -0
  110. package/lib/routes/javtiful/namespace.ts +6 -0
  111. package/lib/routes/javtiful/templates/description.art +7 -0
  112. package/lib/routes/javtiful/utils.ts +18 -0
  113. package/lib/routes/kisskiss/blog.ts +74 -0
  114. package/lib/routes/kisskiss/namespace.ts +6 -0
  115. package/lib/routes/ktown4u/artist-brandlist.ts +61 -0
  116. package/lib/routes/ktown4u/namespace.ts +6 -0
  117. package/lib/routes/lorientlejour/index.ts +186 -0
  118. package/lib/routes/lorientlejour/namespace.ts +7 -0
  119. package/lib/routes/lorientlejour/templates/description.art +18 -0
  120. package/lib/routes/lovelive-anime/namespace.ts +1 -1
  121. package/lib/routes/lovelive-anime/news.ts +56 -26
  122. package/lib/routes/lovelive-anime/schedules.ts +18 -6
  123. package/lib/routes/lovelive-anime/templates/description.art +1 -1
  124. package/lib/routes/lovelive-anime/templates/scheduleDesc.art +0 -1
  125. package/lib/routes/lovelive-anime/topics.ts +1 -1
  126. package/lib/routes/manhuagui/comic.ts +1 -1
  127. package/lib/routes/mi/crowdfunding.ts +43 -22
  128. package/lib/routes/mi/templates/crowdfunding.art +28 -0
  129. package/lib/routes/mi/types.ts +40 -0
  130. package/lib/routes/mi/utils.ts +80 -0
  131. package/lib/routes/misskey/utils.ts +1 -0
  132. package/lib/routes/misskon/namespace.ts +6 -0
  133. package/lib/routes/misskon/posts.ts +33 -0
  134. package/lib/routes/misskon/tag.ts +38 -0
  135. package/lib/routes/misskon/top.ts +67 -0
  136. package/lib/routes/misskon/utils.ts +41 -0
  137. package/lib/routes/natgeo/dailyphoto.ts +1 -1
  138. package/lib/routes/natgeo/dailyselection.ts +1 -1
  139. package/lib/routes/ncku/namespace.ts +1 -1
  140. package/lib/routes/ncku/phys.ts +95 -0
  141. package/lib/routes/news/namespace.ts +1 -1
  142. package/lib/routes/nikkei/cn/index.ts +12 -1
  143. package/lib/routes/nudt/yjszs.ts +33 -13
  144. package/lib/routes/nytimes/book.ts +11 -11
  145. package/lib/routes/nytimes/daily-briefing-chinese.ts +4 -4
  146. package/lib/routes/nytimes/namespace.ts +1 -1
  147. package/lib/routes/oncc/templates/article.art +1 -1
  148. package/lib/routes/papers/index.ts +7 -1
  149. package/lib/routes/parliament.uk/commonslibrary.ts +55 -0
  150. package/lib/routes/parliament.uk/lordslibrary.ts +55 -0
  151. package/lib/routes/parliament.uk/namespace.ts +6 -0
  152. package/lib/routes/picuki/profile.ts +50 -39
  153. package/lib/routes/pornhub/model.ts +3 -5
  154. package/lib/routes/pornhub/pornstar.ts +3 -5
  155. package/lib/routes/pornhub/users.ts +3 -5
  156. package/lib/routes/resonac/namespace.ts +6 -0
  157. package/lib/routes/resonac/products.ts +85 -0
  158. package/lib/routes/rsshub/transform/html.ts +114 -75
  159. package/lib/routes/rsshub/transform/json.ts +14 -8
  160. package/lib/routes/sciencenet/user.ts +3 -1
  161. package/lib/routes/scmp/utils.ts +2 -2
  162. package/lib/routes/skeb/following-creators.ts +52 -0
  163. package/lib/routes/skeb/following-works.ts +52 -0
  164. package/lib/routes/skeb/friend-works.ts +52 -0
  165. package/lib/routes/skeb/index.ts +131 -0
  166. package/lib/routes/skeb/namespace.ts +6 -0
  167. package/lib/routes/skeb/search.ts +77 -0
  168. package/lib/routes/skeb/templates/creator.art +8 -0
  169. package/lib/routes/skeb/templates/work.art +10 -0
  170. package/lib/routes/skeb/utils.ts +155 -0
  171. package/lib/routes/skeb/works.ts +88 -0
  172. package/lib/routes/skebetter/illust.ts +83 -0
  173. package/lib/routes/skebetter/index.ts +83 -0
  174. package/lib/routes/skebetter/manga.ts +65 -0
  175. package/lib/routes/skebetter/namespace.ts +6 -0
  176. package/lib/routes/skebetter/utils.ts +72 -0
  177. package/lib/routes/spankbang/namespace.ts +6 -0
  178. package/lib/routes/spankbang/new-videos.ts +90 -0
  179. package/lib/routes/spankbang/templates/video.art +7 -0
  180. package/lib/routes/straitstimes/index.ts +135 -0
  181. package/lib/routes/straitstimes/namespace.ts +7 -0
  182. package/lib/routes/straitstimes/templates/description.art +27 -0
  183. package/lib/routes/szftedu/dongtai.ts +62 -0
  184. package/lib/routes/szftedu/gonggao.ts +62 -0
  185. package/lib/routes/szftedu/namespace.ts +6 -0
  186. package/lib/routes/the/index.ts +1 -1
  187. package/lib/routes/tkww/index.ts +83 -0
  188. package/lib/routes/tkww/namespace.ts +6 -0
  189. package/lib/routes/ttv/index.ts +1 -1
  190. package/lib/routes/tvb/news.ts +2 -1
  191. package/lib/routes/twitter/api/mobile-api/login.ts +5 -0
  192. package/lib/routes/twitter/api/web-api/api.ts +16 -10
  193. package/lib/routes/twitter/api/web-api/constants.ts +1 -1
  194. package/lib/routes/twitter/api/web-api/utils.ts +94 -56
  195. package/lib/routes/twitter/list.ts +4 -12
  196. package/lib/routes/twitter/media.ts +13 -4
  197. package/lib/routes/twitter/user.ts +15 -6
  198. package/lib/routes/udn/breaking-news.ts +2 -2
  199. package/lib/routes/uestc/gr.ts +65 -37
  200. package/lib/routes/uestc/jwc.ts +49 -28
  201. package/lib/routes/wechat/ershcimi.ts +4 -2
  202. package/lib/routes/weibo/user.ts +10 -2
  203. package/lib/routes/xaut/index.ts +13 -20
  204. package/lib/routes/xaut/namespace.ts +1 -1
  205. package/lib/routes/xbookcn/blog.ts +66 -0
  206. package/lib/routes/xbookcn/namespace.ts +6 -0
  207. package/lib/routes/xiaoyuzhou/podcast.ts +35 -7
  208. package/lib/routes/xueqiu/cookies.ts +5 -3
  209. package/lib/routes/xueqiu/stock-info.ts +6 -12
  210. package/lib/routes/yande/namespace.ts +1 -1
  211. package/lib/routes/yande/post.ts +6 -6
  212. package/lib/routes/zaobao/util.ts +41 -43
  213. package/lib/routes/zhihu/activities.ts +2 -1
  214. package/lib/routes/zhihu/timeline.ts +6 -1
  215. package/lib/routes/zhihu/utils.ts +1 -1
  216. package/lib/routes/zjut/cs/index.ts +105 -0
  217. package/lib/routes/zjut/jwc/index.ts +117 -0
  218. package/lib/utils/cache/redis.ts +1 -1
  219. package/package.json +35 -36
  220. package/lib/routes/a9vg/a9vg.ts +0 -45
  221. package/lib/routes/gov/ndrc/zfxxgk/articles.ts +0 -73
  222. package/lib/routes-deprecated/hko/weather.js +0 -44
@@ -0,0 +1,33 @@
1
+ import { Route } from '@/types';
2
+ import { ENDPOINT, getPosts } from './utils';
3
+
4
+ export const route: Route = {
5
+ path: '/posts/:routeParams?',
6
+ categories: ['picture'],
7
+ example: '/misskon/posts/search=video&tags_exclude=353,3100&per_page=5',
8
+ parameters: { routeParams: 'Additional parameters for filtering posts, refer to [WordPress API Reference](https://developer.wordpress.org/rest-api/reference/posts/#arguments) for details.' },
9
+ features: {
10
+ requireConfig: false,
11
+ requirePuppeteer: false,
12
+ antiCrawler: false,
13
+ supportBT: false,
14
+ supportPodcast: false,
15
+ supportScihub: false,
16
+ },
17
+ radar: [
18
+ {
19
+ source: ['misskon.com/'],
20
+ target: '/posts',
21
+ },
22
+ ],
23
+ name: 'Posts',
24
+ maintainers: ['Urabartin'],
25
+ handler: async (ctx) => {
26
+ const { routeParams = '' } = ctx.req.param();
27
+ return {
28
+ title: `MissKON - ${routeParams || 'Posts'}`,
29
+ link: `${ENDPOINT}/posts` + (routeParams ? `?${routeParams}` : ''),
30
+ item: await getPosts(routeParams),
31
+ };
32
+ },
33
+ };
@@ -0,0 +1,38 @@
1
+ import { Route } from '@/types';
2
+ import { getPosts, getTags } from './utils';
3
+
4
+ export const route: Route = {
5
+ path: '/tag/:tag',
6
+ categories: ['picture'],
7
+ example: '/misskon/tag/cosplay',
8
+ parameters: { tag: 'Any tag that exists in MissKon' },
9
+ features: {
10
+ requireConfig: false,
11
+ requirePuppeteer: false,
12
+ antiCrawler: false,
13
+ supportBT: false,
14
+ supportPodcast: false,
15
+ supportScihub: false,
16
+ },
17
+ radar: [
18
+ {
19
+ source: ['misskon.com/tag/:tag/'],
20
+ target: '/tag/:tag',
21
+ },
22
+ ],
23
+ name: 'Tag',
24
+ maintainers: ['Urabartin'],
25
+ handler: async (ctx) => {
26
+ const { tag } = ctx.req.param();
27
+ const tagData = await getTags(tag);
28
+ const searchParams = new URLSearchParams();
29
+ searchParams.set('tags', tagData.id);
30
+ const items = await getPosts(searchParams.toString());
31
+ return {
32
+ title: `MissKON - ${tagData.name}`,
33
+ link: tagData.link,
34
+ description: tagData.description,
35
+ item: items,
36
+ };
37
+ },
38
+ };
@@ -0,0 +1,67 @@
1
+ import { Route } from '@/types';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { load } from 'cheerio';
4
+ import { getPosts } from './utils';
5
+
6
+ export const route: Route = {
7
+ path: '/top/:k',
8
+ categories: ['picture'],
9
+ example: '/misskon/top/60',
10
+ parameters: { k: 'Top k days, can be 3, 7, 30 or 60' },
11
+ features: {
12
+ requireConfig: false,
13
+ requirePuppeteer: false,
14
+ antiCrawler: false,
15
+ supportBT: false,
16
+ supportPodcast: false,
17
+ supportScihub: false,
18
+ },
19
+ radar: [
20
+ {
21
+ title: 'Top 3 days',
22
+ source: ['misskon.com/top3/'],
23
+ target: '/top/3',
24
+ },
25
+ {
26
+ title: 'Top 7 days',
27
+ source: ['misskon.com/top7/'],
28
+ target: '/top/7',
29
+ },
30
+ {
31
+ title: 'Top 30 days',
32
+ source: ['misskon.com/top30/'],
33
+ target: '/top/30',
34
+ },
35
+ {
36
+ title: 'Top 60 days',
37
+ source: ['misskon.com/top60/'],
38
+ target: '/top/60',
39
+ },
40
+ ],
41
+ name: 'Top k days',
42
+ maintainers: ['Urabartin'],
43
+ handler: async (ctx) => {
44
+ const { k } = ctx.req.param();
45
+ if (!['3', '7', '30', '60'].includes(k)) {
46
+ throw new Error(`Invalid k: k=${k}`);
47
+ }
48
+ const topLink = `https://misskon.com/top${k}/`;
49
+ const response = await ofetch(topLink);
50
+ const $ = load(response);
51
+
52
+ const feedTitle = $('.page-title').text();
53
+ const feedDesc = $('.content > p').first().text();
54
+ const itemSlugs = $('#main-content article.item-list > h2 a')
55
+ .toArray()
56
+ .map((link) => new URL($(link).attr('href') || '').pathname.slice(1, -1));
57
+ const searchParams = new URLSearchParams();
58
+ searchParams.set('slug', itemSlugs.join(','));
59
+ searchParams.set('per_page', itemSlugs.length.toString());
60
+ return {
61
+ title: `MissKON - ${feedTitle}`,
62
+ link: topLink,
63
+ description: feedDesc,
64
+ item: await getPosts(searchParams),
65
+ };
66
+ },
67
+ };
@@ -0,0 +1,41 @@
1
+ import ofetch from '@/utils/ofetch';
2
+ import { load } from 'cheerio';
3
+ import { parseDate } from '@/utils/parse-date';
4
+ import timezone from '@/utils/timezone';
5
+
6
+ const ENDPOINT = 'https://misskon.com/wp-json/wp/v2';
7
+ const getPosts = async (searchParams) => {
8
+ const url = new URL(`${ENDPOINT}/posts?${searchParams}`);
9
+ url.searchParams.append('_embed', 'wp:term');
10
+ const data = await ofetch(url.href);
11
+ return data.map((item) => {
12
+ const $ = load(item.content.rendered);
13
+ $('input').each(function () {
14
+ $(this).replaceWith($(this).attr('value') || '');
15
+ });
16
+ $('script').remove();
17
+ return {
18
+ title: item.title.rendered,
19
+ link: item.link,
20
+ description: $.html(),
21
+ pubDate: timezone(parseDate(item.date_gmt), 0),
22
+ category: item._embedded['wp:term']
23
+ .flat()
24
+ .filter((x) => x.taxonomy === 'post_tag')
25
+ .map((x) => x.name),
26
+ };
27
+ });
28
+ };
29
+ const getTags = async (slug) => {
30
+ const data = await ofetch(`${ENDPOINT}/tags?slug=${slug}`);
31
+ if (data.length === 0) {
32
+ throw new Error(`Invalid tag slug: ${slug}`);
33
+ }
34
+ return {
35
+ id: data[0].id,
36
+ name: data[0].name,
37
+ link: data[0].link,
38
+ description: data[0].description,
39
+ };
40
+ };
41
+ export { ENDPOINT, getPosts, getTags };
@@ -12,7 +12,7 @@ import { config } from '@/config';
12
12
 
13
13
  export const route: Route = {
14
14
  path: '/dailyphoto',
15
- categories: ['picture', 'popular'],
15
+ categories: ['picture'],
16
16
  view: ViewType.Pictures,
17
17
  example: '/natgeo/dailyphoto',
18
18
  parameters: {},
@@ -21,7 +21,7 @@ export const route: Route = {
21
21
  source: ['nationalgeographic.com/'],
22
22
  },
23
23
  ],
24
- maintainers: ['OrangeEd1t', 'pseudoyu'],
24
+ maintainers: ['OrangeEd1t'],
25
25
  handler,
26
26
  };
27
27
 
@@ -2,5 +2,5 @@ import type { Namespace } from '@/types';
2
2
 
3
3
  export const namespace: Namespace = {
4
4
  name: 'National Cheng Kung University',
5
- url: 'ncku.edu.tw',
5
+ url: 'www.ncku.edu.tw',
6
6
  };
@@ -0,0 +1,95 @@
1
+ import type { Route } from '@/types';
2
+ import { CheerioAPI, load } from 'cheerio';
3
+ import ofetch from '@/utils/ofetch';
4
+
5
+ const currentURL = (catagory: string) => `https://phys.ncku.edu.tw/news/${catagory === '_all' ? '' : catagory}`;
6
+
7
+ const catagories = {
8
+ '24': '物理系',
9
+ scholarship: '獎助學金',
10
+ admission: '招生與錄取報到',
11
+ 'course-announcement': '助教公告',
12
+ 'bachelor-announcement': '大學部',
13
+ 'master-announcement': '研究所',
14
+ graduation: '畢業離校',
15
+ 'student-guide': '學生手冊與新生入學',
16
+ honor: '榮譽榜',
17
+ career: '求才公告',
18
+ others: '其他',
19
+ _all: '所有訊息',
20
+ };
21
+
22
+ export const route: Route = {
23
+ 'zh-TW': {
24
+ name: '國立成功大學物理系公告',
25
+ },
26
+ name: 'Phys News',
27
+ description: `| 分類 | catagory |
28
+ | 物理系 | 24 |
29
+ | 獎助學金 | scholarship |
30
+ | 招生與錄取報到 | admission |
31
+ | 助教公告 | course-announcement |
32
+ | 大學部 | bachelor-announcement |
33
+ | 研究所 | master-announcement |
34
+ | 畢業離校 | graduation |
35
+ | 學生手冊與新生入學 | student-guide |
36
+ | 榮譽榜 | honor |
37
+ | 求才公告 | career |
38
+ | 其他 | others |
39
+ | 所有訊息 | _all |
40
+ `,
41
+ path: '/phys/:catagory?',
42
+ parameters: {
43
+ catagory: 'catagory, default is _all',
44
+ },
45
+ categories: ['university'],
46
+ example: '/ncku/phys/_all',
47
+ features: {
48
+ requireConfig: false,
49
+ requirePuppeteer: false,
50
+ antiCrawler: false,
51
+ supportBT: false,
52
+ supportPodcast: false,
53
+ supportScihub: false,
54
+ },
55
+ radar: [
56
+ {
57
+ source: ['phys.ncku.edu.tw/news/'],
58
+ target: '/phys/_all',
59
+ },
60
+ {
61
+ source: ['phys.ncku.edu.tw/news/:catagory/'],
62
+ target: '/phys/:catagory',
63
+ },
64
+ ],
65
+ maintainers: ['simbafs'],
66
+ handler: async (ctx) => {
67
+ let catagory = ctx.req.param('catagory') ?? '_all';
68
+ if (catagories[catagory] === undefined) {
69
+ catagory = '_all';
70
+ }
71
+
72
+ const $ = await ofetch<CheerioAPI>(currentURL(catagory), {
73
+ parseResponse: load,
74
+ });
75
+
76
+ const item = $('.newsList .Txt')
77
+ .toArray()
78
+ .map((e) => ({
79
+ title: $('a', e).text(),
80
+ pubDate: new Date(
81
+ $('.newsDate', e)
82
+ .text()
83
+ .match(/\d{4}(?: \/ \d{2}){2}/)?.[0] || ''
84
+ ),
85
+ link: $('a', e).attr('href'),
86
+ catagory: $('.newIcon', e).text(),
87
+ }));
88
+
89
+ return {
90
+ title: `成大物理系公告 - ${catagories[catagory]}`,
91
+ link: currentURL(catagory),
92
+ item,
93
+ };
94
+ },
95
+ };
@@ -1,6 +1,6 @@
1
1
  import type { Namespace } from '@/types';
2
2
 
3
3
  export const namespace: Namespace = {
4
- name: '小黑盒',
4
+ name: '新华社',
5
5
  url: 'news.cn',
6
6
  };
@@ -5,7 +5,18 @@ import got from '@/utils/got';
5
5
  import { load } from 'cheerio';
6
6
  import timezone from '@/utils/timezone';
7
7
  import { parseDate } from '@/utils/parse-date';
8
- import parser from '@/utils/rss-parser';
8
+ import { config } from '@/config';
9
+ import Parser from 'rss-parser';
10
+
11
+ const parser = new Parser({
12
+ customFields: {
13
+ item: ['magnet'],
14
+ },
15
+ headers: {
16
+ 'User-Agent': config.ua,
17
+ },
18
+ defaultRSS: 0.9,
19
+ });
9
20
 
10
21
  export const route: Route = {
11
22
  path: '/cn/*',
@@ -5,21 +5,35 @@ import { parseDate } from '@/utils/parse-date';
5
5
  import InvalidParameterError from '@/errors/types/invalid-parameter';
6
6
  import timezone from '@/utils/timezone';
7
7
 
8
- /* 研究生院*/
8
+ /* 研究生院 */
9
9
  const host = 'http://yjszs.nudt.edu.cn';
10
10
 
11
+ // 目前研究生院最近仍在更新的链接
11
12
  const yjszs = new Map([
13
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=2
12
14
  // http://yjszs.nudt.edu.cn//pubweb/homePageList/searchContent.view
13
- ['tzgg', { title: '国防科技大学研究生院 - 通知公告', view: 'searchContent' }],
15
+ ['2', { title: '国防科技大学研究生院 - 通知公告' }],
16
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=1
17
+ ['1', { title: '国防科技大学研究生院 - 首页' }],
18
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=8
19
+ ['8', { title: '国防科技大学研究生院 - 招生简章' }],
20
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=12
21
+ ['12', { title: '国防科技大学研究生院 - 学校政策' }],
14
22
  // http://yjszs.nudt.edu.cn//pubweb/homePageList/recruitStudents.view?keyId=16
15
- ['sszs', { title: '国防科技大学研究生院 - 硕士招生', view: 'recruitStudents', keyId: '16' }],
23
+ ['16', { title: '国防科技大学研究生院 - 硕士招生' }],
24
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=17
25
+ ['17', { title: '国防科技大学研究生院 - 博士招生' }],
26
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=23
27
+ ['23', { title: '国防科技大学研究生院 - 院所发文' }],
28
+ // http://yjszs.nudt.edu.cn/pubweb/homePageList/recruitStudents.view?keyId=25
29
+ ['25', { title: '国防科技大学研究生院 - 数据统计' }],
16
30
  ]);
17
31
 
18
32
  export const route: Route = {
19
- path: '/yjszs/:type?',
33
+ path: '/yjszs/:keyId?',
20
34
  categories: ['university'],
21
- example: '/nudt/yjszs/sszs',
22
- parameters: { type: '分类,见下表,默认为硕士招生' },
35
+ example: '/nudt/yjszs/2',
36
+ parameters: { keyId: '分类,见下表,默认为通知公告' },
23
37
  features: {
24
38
  requireConfig: false,
25
39
  requirePuppeteer: false,
@@ -28,22 +42,28 @@ export const route: Route = {
28
42
  supportPodcast: false,
29
43
  supportScihub: false,
30
44
  },
45
+ radar: [
46
+ {
47
+ source: ['yjszs.nudt.edu.cn'],
48
+ },
49
+ ],
31
50
  name: '研究生院',
32
51
  maintainers: ['Blank0120'],
33
52
  handler,
34
53
  url: 'yjszs.nudt.edu.cn/',
35
- description: `| 通知公告 | 硕士招生 |
36
- | -------- | -------- |
37
- | tzgg | sszs |`,
54
+ description: `| 通知公告 | 首页 | 招生简章 | 学校政策 | 硕士招生 | 博士招生 | 院所发文 | 数据统计 |
55
+ | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
56
+ | 2 | 1 | 8 | 12 | 16 | 17 | 23 | 25 |`,
38
57
  };
39
58
 
40
59
  async function handler(ctx) {
41
- const type = ctx.req.param('type') ?? 'sszs';
42
- const info = yjszs.get(type);
60
+ const keyId = ctx.req.param('keyId') ?? '2';
61
+ const info = yjszs.get(keyId);
43
62
  if (!info) {
44
- throw new InvalidParameterError('invalid type');
63
+ throw new InvalidParameterError('invalid keyId');
45
64
  }
46
- const link = `${host}/pubweb/homePageList/${info.view}.view?keyId=${info.keyId ?? ''}`;
65
+ let link = `${host}/pubweb/homePageList`;
66
+ link += keyId === '2' ? `/searchContent.view` : `/recruitStudents.view?keyId=${keyId}`;
47
67
  const response = await got({
48
68
  method: 'get',
49
69
  url: link,
@@ -3,17 +3,17 @@ import got from '@/utils/got';
3
3
  import { load } from 'cheerio';
4
4
 
5
5
  const categoryList = {
6
- 'combined-print-and-e-book-nonfiction': '非虚构类 - 综合',
7
- 'hardcover-nonfiction': '非虚构类 - 精装本',
8
- 'paperback-nonfiction': '非虚构类 - 平装本',
9
- 'advice-how-to-and-miscellaneous': '工具类',
10
- 'combined-print-and-e-book-fiction': '虚构类 - 综合',
11
- 'hardcover-fiction': '虚构类 - 精装本',
12
- 'trade-fiction-paperback': '虚构类 - 平装本',
13
- 'childrens-middle-grade-hardcover': '儿童 - 中年级',
14
- 'picture-books': '儿童 - 绘本',
15
- 'series-books': '儿童 - 系列图书',
16
- 'young-adult-hardcover': '青少年',
6
+ 'combined-print-and-e-book-nonfiction': 'Combined Print & E-Book Nonfiction',
7
+ 'hardcover-nonfiction': 'Hardcover Nonfiction',
8
+ 'paperback-nonfiction': 'Paperback Nonfiction',
9
+ 'advice-how-to-and-miscellaneous': 'Advice, How-To & Miscellaneous',
10
+ 'combined-print-and-e-book-fiction': 'Combined Print & E-Book Fiction',
11
+ 'hardcover-fiction': 'Hardcover Fiction',
12
+ 'trade-fiction-paperback': 'Paperback Trade Fiction',
13
+ 'childrens-middle-grade-hardcover': "Children's Middle Grade Hardcover",
14
+ 'picture-books': 'Picture Books',
15
+ 'series-books': 'Series Books',
16
+ 'young-adult-hardcover': 'Young Adult Hardcover',
17
17
  };
18
18
 
19
19
  export const route: Route = {
@@ -11,7 +11,7 @@ import path from 'node:path';
11
11
 
12
12
  export const route: Route = {
13
13
  path: '/daily_briefing_chinese',
14
- categories: ['traditional-media'],
14
+ categories: ['traditional-media', 'popular'],
15
15
  example: '/nytimes/daily_briefing_chinese',
16
16
  parameters: {},
17
17
  features: {
@@ -28,11 +28,11 @@ export const route: Route = {
28
28
  target: '',
29
29
  },
30
30
  ],
31
- name: '新闻简报',
31
+ name: 'Daily Briefing',
32
32
  maintainers: ['yueyericardo', 'nczitzk'],
33
33
  handler,
34
34
  url: 'nytimes.com/',
35
- description: `网站地址:[https://www.nytimes.com/zh-hans/series/daily-briefing-chinese](https://www.nytimes.com/zh-hans/series/daily-briefing-chinese)`,
35
+ description: `URL: [https://www.nytimes.com/zh-hans/series/daily-briefing-chinese](https://www.nytimes.com/zh-hans/series/daily-briefing-chinese)`,
36
36
  };
37
37
 
38
38
  async function handler() {
@@ -91,7 +91,7 @@ async function handler() {
91
91
  );
92
92
 
93
93
  return {
94
- title: '新闻简报 - The New York Times',
94
+ title: 'Daily Briefing - The New York Times',
95
95
  link: currentUrl,
96
96
  item: items,
97
97
  };
@@ -1,6 +1,6 @@
1
1
  import type { Namespace } from '@/types';
2
2
 
3
3
  export const namespace: Namespace = {
4
- name: 'The New York Times 纽约时报',
4
+ name: 'The New York Times',
5
5
  url: 'nytimes.com',
6
6
  };
@@ -1,2 +1,2 @@
1
1
  <img src="{{ imageUrl }}">
2
- {{ content }}
2
+ {{@ content }}
@@ -20,7 +20,7 @@ export const handler = async (ctx) => {
20
20
  const feedUrl = new URL(`${category}/feed`, rootUrl).href;
21
21
 
22
22
  const site = category.split(/\//)[0];
23
- const apiKimiUrl = new URL(`${site}/kimi/`, rootUrl).href;
23
+ const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href;
24
24
 
25
25
  const feed = await parser.parseURL(feedUrl);
26
26
 
@@ -91,6 +91,7 @@ export const route: Route = {
91
91
  | arXiv Computation and Language (cs.CL) | arxiv/cs.CL |
92
92
  | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV |
93
93
  | arXiv Machine Learning (cs.LG) | arxiv/cs.LG |
94
+ | arXiv Robotics (cs.RO) | arxiv/cs.RO |
94
95
  `,
95
96
  categories: ['journal'],
96
97
 
@@ -124,5 +125,10 @@ export const route: Route = {
124
125
  source: ['papers.cool/arxiv/cs.LG'],
125
126
  target: '/arxiv/cs.LG',
126
127
  },
128
+ {
129
+ title: 'arXiv Robotics (cs.RO)',
130
+ source: ['papers.cool/arxiv/cs.RO'],
131
+ target: '/arxiv/cs.RO',
132
+ },
127
133
  ],
128
134
  };
@@ -0,0 +1,55 @@
1
+ import { load } from 'cheerio';
2
+ import { Route } from '@/types';
3
+ import puppeteer from '@/utils/puppeteer';
4
+ import timezone from '@/utils/timezone';
5
+
6
+ export const route: Route = {
7
+ path: '/commonslibrary/type/:topic?',
8
+ categories: ['government'],
9
+ example: '/parliament.uk/commonslibrary/type/research-briefing',
10
+ parameters: { topic: 'research by topic, string, example: [research-briefing|data-dashboard]' },
11
+ features: {
12
+ requireConfig: false,
13
+ requirePuppeteer: true,
14
+ antiCrawler: false,
15
+ supportBT: false,
16
+ supportPodcast: false,
17
+ supportScihub: false,
18
+ },
19
+ name: 'Commonlibrary',
20
+ maintainers: ['AntiKnot'],
21
+ handler,
22
+ };
23
+
24
+ async function handler(ctx) {
25
+ const { topic } = ctx.req.param();
26
+ const baseUrl = 'https://commonslibrary.parliament.uk';
27
+ const url = `${baseUrl}/type/${topic}/`;
28
+ const browser = await puppeteer();
29
+ const page = await browser.newPage();
30
+ await page.setRequestInterception(true);
31
+ page.on('request', (request) => {
32
+ request.resourceType() === 'document' ? request.continue() : request.abort();
33
+ });
34
+ await page.goto(url, {
35
+ waitUntil: 'domcontentloaded',
36
+ });
37
+
38
+ const html = await page.evaluate(() => document.documentElement.innerHTML);
39
+ await page.close();
40
+ const $ = load(html);
41
+ const items = $('div.l-box.l-box--no-border.card__text')
42
+ .map((_, article) => ({
43
+ title: $(article).find('.card__text a').text().trim(),
44
+ link: $(article).find('.card__text a').attr('href'),
45
+ description: $(article).find('p').last().text().trim(),
46
+ pubDate: timezone($(article).find('.card__date time').attr('datetime')),
47
+ }))
48
+ .toArray();
49
+ browser.close();
50
+ return {
51
+ title: `parliament - lordslibrary - ${topic}`,
52
+ link: url,
53
+ item: items,
54
+ };
55
+ }
@@ -0,0 +1,55 @@
1
+ import { load } from 'cheerio';
2
+ import { Route } from '@/types';
3
+ import puppeteer from '@/utils/puppeteer';
4
+ import timezone from '@/utils/timezone';
5
+
6
+ export const route: Route = {
7
+ path: '/lordslibrary/type/:topic?',
8
+ categories: ['government'],
9
+ example: '/parliament.uk/lordslibrary/type/research-briefing',
10
+ parameters: { topic: 'research by topic, string, example: [research-briefing|buisness|economy]' },
11
+ features: {
12
+ requireConfig: false,
13
+ requirePuppeteer: true,
14
+ antiCrawler: false,
15
+ supportBT: false,
16
+ supportPodcast: false,
17
+ supportScihub: false,
18
+ },
19
+ name: 'House of Lords Library',
20
+ maintainers: ['AntiKnot'],
21
+ handler,
22
+ };
23
+
24
+ async function handler(ctx) {
25
+ const { topic } = ctx.req.param();
26
+ const baseUrl = 'https://lordslibrary.parliament.uk';
27
+ const url = `${baseUrl}/type/${topic}/`;
28
+ const browser = await puppeteer();
29
+ const page = await browser.newPage();
30
+ await page.setRequestInterception(true);
31
+ page.on('request', (request) => {
32
+ request.resourceType() === 'document' ? request.continue() : request.abort();
33
+ });
34
+ await page.goto(url, {
35
+ waitUntil: 'domcontentloaded',
36
+ });
37
+
38
+ const html = await page.evaluate(() => document.documentElement.innerHTML);
39
+ await page.close();
40
+ const $ = load(html);
41
+ const items = $('div.l-box.l-box--no-border.card__text')
42
+ .map((_, article) => ({
43
+ title: $(article).find('.card__text a').text().trim(),
44
+ link: $(article).find('.card__text a').attr('href'),
45
+ description: $(article).find('p').last().text().trim(),
46
+ pubDate: timezone($(article).find('.card__date time').attr('datetime')),
47
+ }))
48
+ .toArray();
49
+ browser.close();
50
+ return {
51
+ title: `parliament - lordslibrary - ${topic}`,
52
+ link: url,
53
+ item: items,
54
+ };
55
+ }
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'UK Parliament',
5
+ url: 'parliament.uk',
6
+ };