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
@@ -83,7 +83,7 @@ async function handler(ctx) {
83
83
  `Danmaku: ${item.video_review} Comment: ${item.review}<br/>` +
84
84
  `<br/>${des}<br/>` +
85
85
  `<img src="${img}"><br/>` +
86
- `Match By: ${item.hit_columns.join(',')}` +
86
+ `Match By: ${item.hit_columns?.join(',') || ''}` +
87
87
  (disableEmbed ? '' : `<br><br>${utils.iframe(item.aid)}`),
88
88
  pubDate: parseDate(item.pubdate, 'X'),
89
89
  guid: item.arcurl,
@@ -3,6 +3,7 @@ import { load } from 'cheerio';
3
3
  import ofetch from '@/utils/ofetch';
4
4
 
5
5
  import { fetchArticle } from './utils';
6
+ import asyncPool from 'tiny-async-pool';
6
7
 
7
8
  export const route: Route = {
8
9
  path: '/cat/:cat',
@@ -34,10 +35,17 @@ async function handler(ctx) {
34
35
  category: $(a).parent().find('.source').text().trim(),
35
36
  }));
36
37
 
37
- const out = await Promise.all(list.map((item) => fetchArticle(item)));
38
+ const out = await asyncPoolAll(2, list, (item) => fetchArticle(item));
38
39
  return {
39
40
  title: `新京报 - 分类 - ${$('.cur').text().trim()}`,
40
41
  link: url,
41
42
  item: out,
42
43
  };
43
44
  }
45
+ async function asyncPoolAll<IN, OUT>(poolLimit: number, array: readonly IN[], iteratorFn: (generator: IN) => Promise<OUT>) {
46
+ const results: Awaited<OUT[]> = [];
47
+ for await (const result of asyncPool(poolLimit, array, iteratorFn)) {
48
+ results.push(result);
49
+ }
50
+ return results;
51
+ }
@@ -0,0 +1,380 @@
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 timezone from '@/utils/timezone';
7
+ import { parseDate } from '@/utils/parse-date';
8
+
9
+ export const handler = async (ctx) => {
10
+ const { bigId = '2', smallId = '11' } = ctx.req.param();
11
+ const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15;
12
+
13
+ const rootUrl = 'http://www.cbpanet.com';
14
+ const currentUrl = new URL(`dzp_news.aspx?bigid=${bigId}&smallid=${smallId}`, rootUrl).href;
15
+
16
+ const { data: response } = await got(currentUrl);
17
+
18
+ const $ = load(response);
19
+
20
+ const language = $('html').prop('lang');
21
+
22
+ let items = $('div.divmore ul li')
23
+ .slice(0, limit)
24
+ .toArray()
25
+ .map((item) => {
26
+ item = $(item);
27
+
28
+ const a = item.find('div.zxcont1 a');
29
+
30
+ return {
31
+ title: a.text(),
32
+ pubDate: parseDate(item.find('div.zxtime1').text(), 'YY/MM/DD'),
33
+ link: new URL(a.prop('href'), rootUrl).href,
34
+ };
35
+ });
36
+
37
+ items = await Promise.all(
38
+ items.map((item) =>
39
+ cache.tryGet(item.link, async () => {
40
+ const { data: detailResponse } = await got(item.link);
41
+
42
+ const $$ = load(detailResponse);
43
+
44
+ const description = $$('div.newscont').html();
45
+
46
+ item.title = $$('div.newstlt').text();
47
+ item.description = description;
48
+ item.pubDate = timezone(
49
+ parseDate(
50
+ $$('div.newstime')
51
+ .text()
52
+ .replace(/发布时间:/, ''),
53
+ 'YYYY/M/D HH:mm:ss'
54
+ ),
55
+ +8
56
+ );
57
+ item.content = {
58
+ html: description,
59
+ text: $$('div.newscont').text(),
60
+ };
61
+ return item;
62
+ })
63
+ )
64
+ );
65
+
66
+ const title = $('title').text();
67
+ const image = new URL($('div#logo img').prop('src'), rootUrl).href;
68
+
69
+ return {
70
+ title,
71
+ description: title.split(/-/).pop(),
72
+ link: currentUrl,
73
+ item: items,
74
+ allowEmpty: true,
75
+ image,
76
+ author: title.split(/-/)[0],
77
+ language,
78
+ };
79
+ };
80
+
81
+ export const route: Route = {
82
+ path: '/dzp_news/:bigId?/:smallId?',
83
+ name: '资讯',
84
+ url: 'cbpanet.com',
85
+ maintainers: ['nczitzk'],
86
+ handler,
87
+ example: '/cbpanet/dzp_news/2/11',
88
+ parameters: {
89
+ bigId: '分类 id,默认为 `2`,即行业资讯,可在对应分类页 URL 中找到',
90
+ smallId: '子分类 id,默认为 `11`,即行业资讯,可在对应分类页 URL 中找到',
91
+ },
92
+ description: `:::tip
93
+ 若订阅 [行业资讯](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=11),网址为 \`http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=11\`。截取 \`https://www.cbpanet.com/\` 的 \`bigid\` 和 \`smallid\` 的部分作为参数填入,此时路由为 [\`/cbpanet/dzp_news/4/15\`](https://rsshub.app/cbpanet/dzp_news/4/15)。
94
+ :::
95
+
96
+ <details>
97
+ <summary>更多分类</summary>
98
+
99
+ #### [协会](http://www.cbpanet.com/dzp_xiehui.aspx)
100
+
101
+ | [协会介绍](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=1) | [协会章程](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=2) | [理事会](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=3) | [内设机构](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=4) | [协会通知](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=5) | [协会活动](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=6) |
102
+ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ---------------------------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
103
+ | [1/1](https://rsshub.app/cbpanet/dzp_news/1/1) | [1/2](https://rsshub.app/cbpanet/dzp_news/1/2) | [1/3](https://rsshub.app/cbpanet/dzp_news/1/3) | [1/4](https://rsshub.app/cbpanet/dzp_news/1/4) | [1/5](https://rsshub.app/cbpanet/dzp_news/1/5) | [1/6](https://rsshub.app/cbpanet/dzp_news/1/6) |
104
+
105
+ | [出版物](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=7) | [会员权利与义务](http://www.cbpanet.com/dzp_news.aspx?bigid=1&smallid=30) |
106
+ | ---------------------------------------------------------------- | ------------------------------------------------------------------------- |
107
+ | [1/7](https://rsshub.app/cbpanet/dzp_news/1/7) | [1/30](https://rsshub.app/cbpanet/dzp_news/1/30) |
108
+
109
+ #### [行业资讯](http://www.cbpanet.com/dzp_news_list.aspx)
110
+
111
+ | [国内资讯](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=8) | [海外资讯](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=9) | [企业新闻](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=10) | [行业资讯](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=11) | [热点聚焦](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=43) | [今日推荐](http://www.cbpanet.com/dzp_news.aspx?bigid=2&smallid=44) |
112
+ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
113
+ | [2/8](https://rsshub.app/cbpanet/dzp_news/2/8) | [2/9](https://rsshub.app/cbpanet/dzp_news/2/9) | [2/10](https://rsshub.app/cbpanet/dzp_news/2/10) | [2/11](https://rsshub.app/cbpanet/dzp_news/2/11) | [2/43](https://rsshub.app/cbpanet/dzp_news/2/43) | [2/44](https://rsshub.app/cbpanet/dzp_news/2/44) |
114
+
115
+ #### [原料信息](http://www.cbpanet.com/dzp_yuanliao.aspx)
116
+
117
+ | [价格行情](http://www.cbpanet.com/dzp_news.aspx?bigid=3&smallid=12) | [分析预测](http://www.cbpanet.com/dzp_news.aspx?bigid=3&smallid=13) | [原料信息](http://www.cbpanet.com/dzp_news.aspx?bigid=3&smallid=40) | [热点聚焦](http://www.cbpanet.com/dzp_news.aspx?bigid=3&smallid=45) |
118
+ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
119
+ | [3/12](https://rsshub.app/cbpanet/dzp_news/3/12) | [3/13](https://rsshub.app/cbpanet/dzp_news/3/13) | [3/40](https://rsshub.app/cbpanet/dzp_news/3/40) | [3/45](https://rsshub.app/cbpanet/dzp_news/3/45) |
120
+
121
+ #### [法规标准](http://www.cbpanet.com/dzp_fagui.aspx)
122
+
123
+ | [法规资讯](http://www.cbpanet.com/dzp_news.aspx?bigid=4&smallid=15) | [法律法规](http://www.cbpanet.com/dzp_news.aspx?bigid=4&smallid=16) | [国内标准](http://www.cbpanet.com/dzp_news.aspx?bigid=4&smallid=14) | [国外标准](http://www.cbpanet.com/dzp_news.aspx?bigid=4&smallid=17) | [法规聚焦](http://www.cbpanet.com/dzp_news.aspx?bigid=4&smallid=46) | [今日推荐](http://www.cbpanet.com/dzp_news.aspx?bigid=4&smallid=47) |
124
+ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
125
+ | [4/15](https://rsshub.app/cbpanet/dzp_news/4/15) | [4/16](https://rsshub.app/cbpanet/dzp_news/4/16) | [4/14](https://rsshub.app/cbpanet/dzp_news/4/14) | [4/17](https://rsshub.app/cbpanet/dzp_news/4/17) | [4/46](https://rsshub.app/cbpanet/dzp_news/4/46) | [4/47](https://rsshub.app/cbpanet/dzp_news/4/47) |
126
+
127
+ #### [技术专区](http://www.cbpanet.com/dzp_jishu.aspx)
128
+
129
+ | [产品介绍](http://www.cbpanet.com/dzp_news.aspx?bigid=5&smallid=18) | [科技成果](http://www.cbpanet.com/dzp_news.aspx?bigid=5&smallid=19) | [学术论文](http://www.cbpanet.com/dzp_news.aspx?bigid=5&smallid=20) | [资料下载](http://www.cbpanet.com/dzp_news.aspx?bigid=5&smallid=21) | [专家](http://www.cbpanet.com/dzp_news.aspx?bigid=5&smallid=50) | [民间智库](http://www.cbpanet.com/dzp_news.aspx?bigid=5&smallid=57) |
130
+ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------- |
131
+ | [5/18](https://rsshub.app/cbpanet/dzp_news/5/18) | [5/19](https://rsshub.app/cbpanet/dzp_news/5/19) | [5/20](https://rsshub.app/cbpanet/dzp_news/5/20) | [5/21](https://rsshub.app/cbpanet/dzp_news/5/21) | [5/50](https://rsshub.app/cbpanet/dzp_news/5/50) | [5/57](https://rsshub.app/cbpanet/dzp_news/5/57) |
132
+
133
+ #### [豆制品消费指南](http://www.cbpanet.com/dzp_zhinan.aspx)
134
+
135
+ | [膳食指南](http://www.cbpanet.com/dzp_news.aspx?bigid=6&smallid=22) | [营养成分](http://www.cbpanet.com/dzp_news.aspx?bigid=6&smallid=23) | [豆食菜谱](http://www.cbpanet.com/dzp_news.aspx?bigid=6&smallid=24) | [问与答](http://www.cbpanet.com/dzp_news.aspx?bigid=6&smallid=31) | [今日推荐](http://www.cbpanet.com/dzp_news.aspx?bigid=6&smallid=48) | [消费热点](http://www.cbpanet.com/dzp_news.aspx?bigid=6&smallid=53) |
136
+ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
137
+ | [6/22](https://rsshub.app/cbpanet/dzp_news/6/22) | [6/23](https://rsshub.app/cbpanet/dzp_news/6/23) | [6/24](https://rsshub.app/cbpanet/dzp_news/6/24) | [6/31](https://rsshub.app/cbpanet/dzp_news/6/31) | [6/48](https://rsshub.app/cbpanet/dzp_news/6/48) | [6/53](https://rsshub.app/cbpanet/dzp_news/6/53) |
138
+
139
+ #### [营养与健康](http://www.cbpanet.com/dzp_yingyang.aspx)
140
+
141
+ | [大豆营养概况](http://www.cbpanet.com/dzp_news.aspx?bigid=7&smallid=25) | [大豆食品和人类健康](http://www.cbpanet.com/dzp_news.aspx?bigid=7&smallid=26) | [世界豆类日,爱豆大行动](http://www.cbpanet.com/dzp_news.aspx?bigid=7&smallid=27) | [谣言粉碎机](http://www.cbpanet.com/dzp_news.aspx?bigid=7&smallid=29) | [最新资讯](http://www.cbpanet.com/dzp_news.aspx?bigid=7&smallid=41) | [专家视点](http://www.cbpanet.com/dzp_news.aspx?bigid=7&smallid=49) |
142
+ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
143
+ | [7/25](https://rsshub.app/cbpanet/dzp_news/7/25) | [7/26](https://rsshub.app/cbpanet/dzp_news/7/26) | [7/27](https://rsshub.app/cbpanet/dzp_news/7/27) | [7/29](https://rsshub.app/cbpanet/dzp_news/7/29) | [7/41](https://rsshub.app/cbpanet/dzp_news/7/41) | [7/49](https://rsshub.app/cbpanet/dzp_news/7/49) |
144
+
145
+ </details>
146
+ `,
147
+ categories: ['new-media'],
148
+
149
+ features: {
150
+ requireConfig: false,
151
+ requirePuppeteer: false,
152
+ antiCrawler: false,
153
+ supportRadar: true,
154
+ supportBT: false,
155
+ supportPodcast: false,
156
+ supportScihub: false,
157
+ },
158
+ radar: [
159
+ {
160
+ source: ['www.cbpanet.com/dzp_news.aspx'],
161
+ target: (_, url) => {
162
+ url = new URL(url);
163
+ const bigId = url.searchParams.get('bigid');
164
+ const smallId = url.searchParams.get('smallid');
165
+
166
+ return `/dzp_news${bigId ? `/${bigId}${smallId ? `/${smallId}` : ''}` : ''}`;
167
+ },
168
+ },
169
+ {
170
+ title: '协会 - 协会介绍',
171
+ source: ['www.cbpanet.com/dzp_news.aspx'],
172
+ target: '/dzp_news/1/1',
173
+ },
174
+ {
175
+ title: '协会 - 协会章程',
176
+ source: ['www.cbpanet.com/dzp_news.aspx'],
177
+ target: '/dzp_news/1/2',
178
+ },
179
+ {
180
+ title: '协会 - 理事会',
181
+ source: ['www.cbpanet.com/dzp_news.aspx'],
182
+ target: '/dzp_news/1/3',
183
+ },
184
+ {
185
+ title: '协会 - 内设机构',
186
+ source: ['www.cbpanet.com/dzp_news.aspx'],
187
+ target: '/dzp_news/1/4',
188
+ },
189
+ {
190
+ title: '协会 - 协会通知',
191
+ source: ['www.cbpanet.com/dzp_news.aspx'],
192
+ target: '/dzp_news/1/5',
193
+ },
194
+ {
195
+ title: '协会 - 协会活动',
196
+ source: ['www.cbpanet.com/dzp_news.aspx'],
197
+ target: '/dzp_news/1/6',
198
+ },
199
+ {
200
+ title: '协会 - 出版物',
201
+ source: ['www.cbpanet.com/dzp_news.aspx'],
202
+ target: '/dzp_news/1/7',
203
+ },
204
+ {
205
+ title: '协会 - 会员权利与义务',
206
+ source: ['www.cbpanet.com/dzp_news.aspx'],
207
+ target: '/dzp_news/1/30',
208
+ },
209
+ {
210
+ title: '行业资讯 - 国内资讯',
211
+ source: ['www.cbpanet.com/dzp_news.aspx'],
212
+ target: '/dzp_news/2/8',
213
+ },
214
+ {
215
+ title: '行业资讯 - 海外资讯',
216
+ source: ['www.cbpanet.com/dzp_news.aspx'],
217
+ target: '/dzp_news/2/9',
218
+ },
219
+ {
220
+ title: '行业资讯 - 企业新闻',
221
+ source: ['www.cbpanet.com/dzp_news.aspx'],
222
+ target: '/dzp_news/2/10',
223
+ },
224
+ {
225
+ title: '行业资讯 - 行业资讯',
226
+ source: ['www.cbpanet.com/dzp_news.aspx'],
227
+ target: '/dzp_news/2/11',
228
+ },
229
+ {
230
+ title: '行业资讯 - 热点聚焦',
231
+ source: ['www.cbpanet.com/dzp_news.aspx'],
232
+ target: '/dzp_news/2/43',
233
+ },
234
+ {
235
+ title: '行业资讯 - 今日推荐',
236
+ source: ['www.cbpanet.com/dzp_news.aspx'],
237
+ target: '/dzp_news/2/44',
238
+ },
239
+ {
240
+ title: '原料信息 - 价格行情',
241
+ source: ['www.cbpanet.com/dzp_news.aspx'],
242
+ target: '/dzp_news/3/12',
243
+ },
244
+ {
245
+ title: '原料信息 - 分析预测',
246
+ source: ['www.cbpanet.com/dzp_news.aspx'],
247
+ target: '/dzp_news/3/13',
248
+ },
249
+ {
250
+ title: '原料信息 - 原料信息',
251
+ source: ['www.cbpanet.com/dzp_news.aspx'],
252
+ target: '/dzp_news/3/40',
253
+ },
254
+ {
255
+ title: '原料信息 - 热点聚焦',
256
+ source: ['www.cbpanet.com/dzp_news.aspx'],
257
+ target: '/dzp_news/3/45',
258
+ },
259
+ {
260
+ title: '法规标准 - 法规资讯',
261
+ source: ['www.cbpanet.com/dzp_news.aspx'],
262
+ target: '/dzp_news/4/15',
263
+ },
264
+ {
265
+ title: '法规标准 - 法律法规',
266
+ source: ['www.cbpanet.com/dzp_news.aspx'],
267
+ target: '/dzp_news/4/16',
268
+ },
269
+ {
270
+ title: '法规标准 - 国内标准',
271
+ source: ['www.cbpanet.com/dzp_news.aspx'],
272
+ target: '/dzp_news/4/14',
273
+ },
274
+ {
275
+ title: '法规标准 - 国外标准',
276
+ source: ['www.cbpanet.com/dzp_news.aspx'],
277
+ target: '/dzp_news/4/17',
278
+ },
279
+ {
280
+ title: '法规标准 - 法规聚焦',
281
+ source: ['www.cbpanet.com/dzp_news.aspx'],
282
+ target: '/dzp_news/4/46',
283
+ },
284
+ {
285
+ title: '法规标准 - 今日推荐',
286
+ source: ['www.cbpanet.com/dzp_news.aspx'],
287
+ target: '/dzp_news/4/47',
288
+ },
289
+ {
290
+ title: '技术专区 - 产品介绍',
291
+ source: ['www.cbpanet.com/dzp_news.aspx'],
292
+ target: '/dzp_news/5/18',
293
+ },
294
+ {
295
+ title: '技术专区 - 科技成果',
296
+ source: ['www.cbpanet.com/dzp_news.aspx'],
297
+ target: '/dzp_news/5/19',
298
+ },
299
+ {
300
+ title: '技术专区 - 学术论文',
301
+ source: ['www.cbpanet.com/dzp_news.aspx'],
302
+ target: '/dzp_news/5/20',
303
+ },
304
+ {
305
+ title: '技术专区 - 资料下载',
306
+ source: ['www.cbpanet.com/dzp_news.aspx'],
307
+ target: '/dzp_news/5/21',
308
+ },
309
+ {
310
+ title: '技术专区 - 专家',
311
+ source: ['www.cbpanet.com/dzp_news.aspx'],
312
+ target: '/dzp_news/5/50',
313
+ },
314
+ {
315
+ title: '技术专区 - 民间智库',
316
+ source: ['www.cbpanet.com/dzp_news.aspx'],
317
+ target: '/dzp_news/5/57',
318
+ },
319
+ {
320
+ title: '豆制品消费指南 - 膳食指南',
321
+ source: ['www.cbpanet.com/dzp_news.aspx'],
322
+ target: '/dzp_news/6/22',
323
+ },
324
+ {
325
+ title: '豆制品消费指南 - 营养成分',
326
+ source: ['www.cbpanet.com/dzp_news.aspx'],
327
+ target: '/dzp_news/6/23',
328
+ },
329
+ {
330
+ title: '豆制品消费指南 - 豆食菜谱',
331
+ source: ['www.cbpanet.com/dzp_news.aspx'],
332
+ target: '/dzp_news/6/24',
333
+ },
334
+ {
335
+ title: '豆制品消费指南 - 问与答',
336
+ source: ['www.cbpanet.com/dzp_news.aspx'],
337
+ target: '/dzp_news/6/31',
338
+ },
339
+ {
340
+ title: '豆制品消费指南 - 今日推荐',
341
+ source: ['www.cbpanet.com/dzp_news.aspx'],
342
+ target: '/dzp_news/6/48',
343
+ },
344
+ {
345
+ title: '豆制品消费指南 - 消费热点',
346
+ source: ['www.cbpanet.com/dzp_news.aspx'],
347
+ target: '/dzp_news/6/53',
348
+ },
349
+ {
350
+ title: '营养与健康 - 大豆营养概况',
351
+ source: ['www.cbpanet.com/dzp_news.aspx'],
352
+ target: '/dzp_news/7/25',
353
+ },
354
+ {
355
+ title: '营养与健康 - 大豆食品和人类健康',
356
+ source: ['www.cbpanet.com/dzp_news.aspx'],
357
+ target: '/dzp_news/7/26',
358
+ },
359
+ {
360
+ title: '营养与健康 - 世界豆类日,爱豆大行动',
361
+ source: ['www.cbpanet.com/dzp_news.aspx'],
362
+ target: '/dzp_news/7/27',
363
+ },
364
+ {
365
+ title: '营养与健康 - 谣言粉碎机',
366
+ source: ['www.cbpanet.com/dzp_news.aspx'],
367
+ target: '/dzp_news/7/29',
368
+ },
369
+ {
370
+ title: '营养与健康 - 最新资讯',
371
+ source: ['www.cbpanet.com/dzp_news.aspx'],
372
+ target: '/dzp_news/7/41',
373
+ },
374
+ {
375
+ title: '营养与健康 - 专家视点',
376
+ source: ['www.cbpanet.com/dzp_news.aspx'],
377
+ target: '/dzp_news/7/49',
378
+ },
379
+ ],
380
+ };
@@ -0,0 +1,8 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: '中国豆制品网',
5
+ url: 'cbpanet.com',
6
+ categories: ['new-media'],
7
+ description: '',
8
+ };
@@ -0,0 +1,72 @@
1
+ import { Data, 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 { Context } from 'hono';
7
+
8
+ export const route: Route = {
9
+ path: '/blog/:topic?',
10
+ categories: ['blog'],
11
+ example: '/ceph/blog/a11y',
12
+ parameters: {
13
+ category: 'filter blog post by category, return all posts if not specified',
14
+ },
15
+ features: {
16
+ requireConfig: false,
17
+ requirePuppeteer: false,
18
+ antiCrawler: false,
19
+ supportBT: false,
20
+ supportPodcast: false,
21
+ supportScihub: false,
22
+ },
23
+ radar: [
24
+ {
25
+ source: ['ceph.io/'],
26
+ },
27
+ ],
28
+ name: 'Blog',
29
+ maintainers: ['pandada8'],
30
+ handler,
31
+ url: 'ceph.io',
32
+ };
33
+
34
+ async function handler(ctx: Context): Promise<Data> {
35
+ const { category } = ctx.req.param();
36
+ const url = category ? `https://ceph.io/en/news/blog/category/${category}/` : 'https://ceph.io/en/news/blog/';
37
+ const response = await got.get(url);
38
+ const data = response.data;
39
+ const $ = load(data);
40
+ const list = $('#main .section li')
41
+ .toArray()
42
+ .map((e) => {
43
+ const element = $(e);
44
+ const title = element.find('a').text().trim();
45
+ const pubDate = parseDate(element.find('time').attr('datetime'));
46
+ return {
47
+ title,
48
+ link: new URL(element.find('a').attr('href'), 'https://ceph.io').href,
49
+ pubDate,
50
+ };
51
+ });
52
+
53
+ const result = await Promise.all(
54
+ list.map((item) =>
55
+ cache.tryGet(item.link, async () => {
56
+ const itemReponse = await got.get(item.link);
57
+ const data = itemReponse.data;
58
+ const item$ = load(data);
59
+
60
+ item.author = item$('#main section > div:nth-child(1) span').text().trim();
61
+ item.description = item$('#main section > div:nth-child(2) > div').html();
62
+ return item;
63
+ })
64
+ )
65
+ );
66
+
67
+ return {
68
+ title: 'Ceph Blog',
69
+ link: url,
70
+ item: result,
71
+ };
72
+ }
@@ -0,0 +1,7 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Ceph',
5
+ url: 'ceph.io',
6
+ description: 'Ceph is an open source distributed storage system designed to evolve with data.',
7
+ };
@@ -34,7 +34,7 @@ async function handler(ctx) {
34
34
  title: $(item).text(),
35
35
  }))
36
36
  .get()
37
- .slice(0, ctx.req.query('limit') ? (Number.parseInt(ctx.req.query('limit')) > 125 ? 125 : Number.parseInt(ctx.req.query('limit'))) : 50);
37
+ .slice(0, ctx.req.query('limit') ? Math.min(Number.parseInt(ctx.req.query('limit')), 125) : 50);
38
38
 
39
39
  const items = await Promise.all(
40
40
  list.map((item) =>
@@ -64,7 +64,7 @@ async function handler(ctx) {
64
64
  link: rootUrl + $(item).attr('href'),
65
65
  }))
66
66
  .get()
67
- .slice(0, ctx.req.query('limit') ? (Number.parseInt(ctx.req.query('limit')) > 20 ? 20 : Number.parseInt(ctx.req.query('limit'))) : 20);
67
+ .slice(0, ctx.req.query('limit') ? Math.min(Number.parseInt(ctx.req.query('limit')), 20) : 20);
68
68
 
69
69
  const items = await Promise.all(
70
70
  list.map((item) =>