rsshub 1.0.0-master.c183692 → 1.0.0-master.c1913c8

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 (103) hide show
  1. package/README.md +6 -9
  2. package/lib/config.ts +18 -0
  3. package/lib/errors/index.tsx +1 -1
  4. package/lib/middleware/logger.ts +2 -2
  5. package/lib/routes/abc/index.ts +2 -2
  6. package/lib/routes/apnews/api.ts +6 -1
  7. package/lib/routes/apnews/rss.ts +1 -1
  8. package/lib/routes/apnews/sitemap.ts +2 -1
  9. package/lib/routes/apnews/topics.ts +2 -2
  10. package/lib/routes/asus/bios.ts +39 -6
  11. package/lib/routes/bilibili/bilibili-recommend.ts +42 -0
  12. package/lib/routes/bilibili/cache.ts +22 -0
  13. package/lib/routes/bilibili/dynamic.ts +101 -97
  14. package/lib/routes/bilibili/followings-video.ts +9 -3
  15. package/lib/routes/bilibili/utils.ts +5 -0
  16. package/lib/routes/bilibili/video.ts +2 -1
  17. package/lib/routes/bitget/announcement.ts +200 -0
  18. package/lib/routes/bitget/namespace.ts +6 -0
  19. package/lib/routes/bitget/type.ts +26 -0
  20. package/lib/routes/bjp/apod.ts +4 -2
  21. package/lib/routes/bupt/jwc.ts +130 -0
  22. package/lib/routes/ccfa/index.ts +216 -0
  23. package/lib/routes/ccfa/namespace.ts +8 -0
  24. package/lib/routes/ccfa/templates/description.art +7 -0
  25. package/lib/routes/devtrium/namespace.ts +6 -0
  26. package/lib/routes/devtrium/posts.ts +55 -0
  27. package/lib/routes/discourse/official.ts +55 -0
  28. package/lib/routes/dockerhub/utils.ts +4 -3
  29. package/lib/routes/douban/movie/coming.ts +68 -0
  30. package/lib/routes/douban/templates/movie_coming.art +27 -0
  31. package/lib/routes/follow/profile.ts +35 -5
  32. package/lib/routes/github/comments.ts +32 -30
  33. package/lib/routes/gov/cn/namespace.ts +8 -0
  34. package/lib/routes/gov/{news → cn/news}/index.ts +11 -7
  35. package/lib/routes/gov/ndrc/fggz.ts +637 -2
  36. package/lib/routes/gov/ndrc/namespace.ts +8 -0
  37. package/lib/routes/gov/ndrc/xwdt.ts +28 -8
  38. package/lib/routes/gov/ndrc/zfxxgk/articles.ts +73 -0
  39. package/lib/routes/hpoi/all.ts +3 -2
  40. package/lib/routes/hpoi/character.ts +3 -2
  41. package/lib/routes/hpoi/work.ts +3 -2
  42. package/lib/routes/jjwxc/book.ts +18 -14
  43. package/lib/routes/lofter/collection.ts +87 -0
  44. package/lib/routes/malaysiakini/index.ts +179 -0
  45. package/lib/routes/malaysiakini/namespace.ts +11 -0
  46. package/lib/routes/mastodon/acct.ts +4 -3
  47. package/lib/routes/mastodon/timeline-local.ts +3 -2
  48. package/lib/routes/mastodon/timeline-remote.ts +3 -2
  49. package/lib/routes/meishichina/index.ts +1997 -0
  50. package/lib/routes/meishichina/namespace.ts +8 -0
  51. package/lib/routes/oct0pu5/namespace.ts +10 -0
  52. package/lib/routes/oct0pu5/rss.ts +48 -0
  53. package/lib/routes/pconline/focus.ts +143 -0
  54. package/lib/routes/pconline/namespace.ts +10 -0
  55. package/lib/routes/people/index.ts +6 -2
  56. package/lib/routes/pixivision/index.ts +84 -0
  57. package/lib/routes/pixivision/namespace.ts +6 -0
  58. package/lib/routes/pixivision/utils.ts +86 -0
  59. package/lib/routes/pku/bbs/hot.ts +1 -1
  60. package/lib/routes/pornhub/category.ts +3 -2
  61. package/lib/routes/pornhub/model.ts +4 -3
  62. package/lib/routes/pornhub/pornstar.ts +4 -3
  63. package/lib/routes/pornhub/search.ts +3 -2
  64. package/lib/routes/qiche365/namespace.ts +5 -0
  65. package/lib/routes/qiche365/recall.ts +53 -0
  66. package/lib/routes/sdu/{cs.ts → cs/index.ts} +46 -12
  67. package/lib/routes/sdu/namespace.ts +2 -2
  68. package/lib/routes/soundon/namespace.ts +6 -0
  69. package/lib/routes/soundon/podcast.ts +80 -0
  70. package/lib/routes/soundon/types.ts +67 -0
  71. package/lib/routes/swjtu/scai/bks.ts +80 -0
  72. package/lib/routes/telegram/blog.ts +3 -2
  73. package/lib/routes/telegram/stickerpack.ts +3 -2
  74. package/lib/routes/tencent/news/author.ts +2 -1
  75. package/lib/routes/the/index.ts +3 -2
  76. package/lib/routes/theinitium/app.ts +137 -0
  77. package/lib/routes/theinitium/templates/description.art +17 -0
  78. package/lib/routes/threads/index.ts +26 -20
  79. package/lib/routes/tju/cic/index.ts +2 -2
  80. package/lib/routes/tju/news/index.ts +2 -2
  81. package/lib/routes/tju/oaa/index.ts +2 -2
  82. package/lib/routes/twitch/live.ts +3 -2
  83. package/lib/routes/twitch/video.ts +3 -2
  84. package/lib/routes/twitter/api/mobile-api/login.ts +1 -1
  85. package/lib/routes/twitter/api/web-api/constants.ts +15 -14
  86. package/lib/routes/twitter/api/web-api/login.ts +7 -5
  87. package/lib/routes/twitter/api/web-api/utils.ts +1 -2
  88. package/lib/routes/twitter/list.ts +5 -2
  89. package/lib/routes/twitter/tweet.ts +1 -0
  90. package/lib/routes/weibo/namespace.ts +1 -0
  91. package/lib/routes/weibo/oasis/user.ts +1 -1
  92. package/lib/routes/weibo/super-index.ts +23 -11
  93. package/lib/routes/weibo/user.ts +12 -1
  94. package/lib/routes/whu/cs.ts +11 -3
  95. package/lib/routes/whu/gs/index.ts +2 -1
  96. package/lib/routes/whu/news.ts +27 -2
  97. package/lib/routes/withgoogle/explorables.ts +54 -0
  98. package/lib/routes/withgoogle/namespace.ts +6 -0
  99. package/lib/routes/zaobao/util.ts +1 -1
  100. package/lib/routes/zhihu/zhuanlan.ts +8 -7
  101. package/lib/utils/otel/metric.ts +3 -2
  102. package/lib/views/rss.tsx +7 -0
  103. package/package.json +14 -14
@@ -0,0 +1,8 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: '美食天下',
5
+ url: 'meishichina.com',
6
+ categories: ['new-media'],
7
+ description: '',
8
+ };
@@ -0,0 +1,10 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Oct0pu5 blog',
5
+ url: 'Oct0pu5.cn',
6
+
7
+ zh: {
8
+ name: 'Oct0pu5的小破站',
9
+ },
10
+ };
@@ -0,0 +1,48 @@
1
+ import { Route } from '@/types';
2
+ import buildData from '@/utils/common-config';
3
+
4
+ const baseUrl = 'https://oct0pu5.cn/';
5
+
6
+ export const route: Route = {
7
+ path: '/',
8
+ categories: ['blog'],
9
+ example: '/oct0pu5',
10
+ features: {
11
+ requireConfig: false,
12
+ requirePuppeteer: false,
13
+ antiCrawler: false,
14
+ supportBT: false,
15
+ supportPodcast: false,
16
+ supportScihub: false,
17
+ },
18
+ radar: [
19
+ {
20
+ source: ['oct0pu5.cn'],
21
+ target: '/',
22
+ },
23
+ ],
24
+ name: 'Oct的小破站',
25
+ maintainers: ['octopus058', 'wiketool'],
26
+ handler,
27
+ };
28
+
29
+ async function handler() {
30
+ const link = baseUrl;
31
+ return await buildData({
32
+ link,
33
+ url: link,
34
+ title: `%title%`,
35
+ description: `%description%`,
36
+ params: {
37
+ title: '博客',
38
+ description: 'Oct0pu5的博客',
39
+ },
40
+ item: {
41
+ item: '.recent-posts > .recent-post-item',
42
+ title: `$('.recent-post-info > a').text()`,
43
+ link: `$('.recent-post-info > a').attr('href')`,
44
+ description: `$('.recent-post-info > .content').text()`,
45
+ pubDate: `Date.parse($('div.recent-post-info > div.article-meta-wrap > span.post-meta-date > time').text().trim())`,
46
+ },
47
+ });
48
+ }
@@ -0,0 +1,143 @@
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
+
7
+ const rootUrl = 'https://www.pconline.com.cn';
8
+ interface Item {
9
+ id: string;
10
+ title: string;
11
+ channelName: string;
12
+ wap_3g_url: string;
13
+ bigImage: string;
14
+ cover: string;
15
+ largeImage: string;
16
+ authorname: string;
17
+ authorImg: string;
18
+ pc_pubDate: string;
19
+ artType: string;
20
+ summary: string;
21
+ url: string;
22
+ }
23
+
24
+ const categories = {
25
+ all: {
26
+ title: '全部',
27
+ path: '',
28
+ },
29
+ tech: {
30
+ title: '科技',
31
+ path: 'tech/',
32
+ },
33
+ finance: {
34
+ title: '财经',
35
+ path: 'finance/',
36
+ },
37
+ life: {
38
+ title: '生活',
39
+ path: 'life/',
40
+ },
41
+ company: {
42
+ title: '公司',
43
+ path: 'company/',
44
+ },
45
+ character: {
46
+ title: '人物',
47
+ path: 'character/',
48
+ },
49
+ };
50
+
51
+ const getContent = (item) =>
52
+ cache.tryGet(item.link, async () => {
53
+ const detailResponse = await got({
54
+ method: 'get',
55
+ url: `https:${item.link}`,
56
+ responseType: 'arrayBuffer',
57
+ });
58
+
59
+ const utf8decoder = new TextDecoder('GBK');
60
+ const html = utf8decoder.decode(detailResponse.data);
61
+ const $ = load(html);
62
+ item.description = $('.context-box .context-table tbody td').html();
63
+ return item;
64
+ });
65
+
66
+ export const handler = async (ctx) => {
67
+ const { category = 'all' } = ctx.req.param();
68
+ const cate = categories[category] || categories.all;
69
+ const currentUrl = `${rootUrl}/3g/other/focus/${cate.path}index.html`;
70
+
71
+ const response = await got({
72
+ method: 'get',
73
+ url: currentUrl,
74
+ });
75
+
76
+ const resString = response.data
77
+ .replace(/Module\.callback\((.*)\)/s, '$1')
78
+ .split('\n')
79
+ .filter((e) => e.indexOf('"tags":') !== 0)
80
+ .join('\n')
81
+ .replaceAll("'", '"');
82
+ const tinyData = resString.replaceAll(/[\n\r]/g, '');
83
+ const dataString = tinyData.replaceAll(',}', '}');
84
+ const data = JSON.parse(dataString || '');
85
+ const { articleList } = data;
86
+ const list = articleList.map((item: Item) => ({
87
+ id: item.id,
88
+ title: item.title,
89
+ author: [
90
+ {
91
+ name: item.authorname,
92
+ avatar: item.authorImg,
93
+ },
94
+ ],
95
+ pubDate: parseDate(item.pc_pubDate),
96
+ link: item.url,
97
+ description: item.summary,
98
+ category: item.channelName,
99
+ image: item.cover,
100
+ }));
101
+
102
+ const items = await Promise.all(list.map((item) => getContent(item)));
103
+
104
+ return {
105
+ title: `太平洋科技-${cate.title}`,
106
+ link: currentUrl,
107
+ item: items,
108
+ };
109
+ };
110
+
111
+ export const route: Route = {
112
+ path: '/focus/:category?',
113
+ categories: ['new-media'],
114
+ example: '/pconline/focus',
115
+ parameters: {
116
+ category: {
117
+ description: '科技新闻的类别,获取最新的一页,分别:all, tech, finance, life, company, character',
118
+ default: 'all',
119
+ },
120
+ },
121
+ features: {
122
+ requireConfig: false,
123
+ requirePuppeteer: false,
124
+ antiCrawler: false,
125
+ supportBT: false,
126
+ supportPodcast: false,
127
+ supportScihub: false,
128
+ },
129
+ radar: [
130
+ {
131
+ source: ['pconline.com.cn/focus/', 'pconline.com.cn/'],
132
+ target: '/focus',
133
+ },
134
+ ],
135
+ name: '科技新闻',
136
+ maintainers: ['CH563'],
137
+ handler,
138
+ description: `::: tip
139
+ | 全部 | 科技 | 财经 | 生活 | 公司 | 人物 |
140
+ | --- | --- | --- | --- | --- | --- |
141
+ | all | tech | finance | life | company | character |
142
+ :::`,
143
+ };
@@ -0,0 +1,10 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: '太平洋科技',
5
+ url: 'pconline.com.cn',
6
+ description: `
7
+ :::tip
8
+ 太平洋科技是专业IT门户网站,为用户和经销商提供IT资讯和行情报价,涉及电脑,手机,数码产品,软件等.
9
+ :::`,
10
+ };
@@ -32,8 +32,12 @@ async function handler(ctx) {
32
32
  responseType: 'buffer',
33
33
  });
34
34
 
35
- const encoding = site === 'www' ? 'gbk' : 'utf-8';
36
- const decodedResponse = iconv.decode(response, encoding);
35
+ // not seen Content-Type in response headers
36
+ // try to parse charset from meta tag
37
+ let decodedResponse = iconv.decode(response, 'utf-8');
38
+ const parsedCharset = decodedResponse.match(/<meta.*?charset=["']?([^"'>]+)["']?/i);
39
+ const encoding = parsedCharset ? parsedCharset[1].toLowerCase() : 'utf-8';
40
+ decodedResponse = encoding === 'utf-8' ? decodedResponse : iconv.decode(response, encoding);
37
41
  const $ = load(decodedResponse);
38
42
 
39
43
  $('em').remove();
@@ -0,0 +1,84 @@
1
+ import { Route, DataItem, Data } 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 { processContent } from './utils';
7
+
8
+ export const route: Route = {
9
+ path: '/:lang/:category?',
10
+ categories: ['anime'],
11
+ example: '/pixivision/zh-tw',
12
+ parameters: { lang: 'Language', category: 'Category' },
13
+ features: {
14
+ requireConfig: false,
15
+ requirePuppeteer: false,
16
+ antiCrawler: false,
17
+ supportBT: false,
18
+ supportPodcast: false,
19
+ supportScihub: false,
20
+ },
21
+ name: 'Category',
22
+ maintainers: ['SnowAgar25'],
23
+ description: `:::tip
24
+ \`https://www.pixivision.net/zh-tw/c/interview\` → \`/pixivision/zh-tw/interview\`
25
+ :::`,
26
+ radar: [
27
+ {
28
+ source: ['www.pixivision.net/:lang'],
29
+ target: '/:lang',
30
+ },
31
+ {
32
+ source: ['www.pixivision.net/:lang/c/:category'],
33
+ target: '/:lang/:category',
34
+ },
35
+ ],
36
+ handler,
37
+ };
38
+
39
+ async function handler(ctx): Promise<Data> {
40
+ const { lang, category } = ctx.req.param();
41
+ const baseUrl = 'https://www.pixivision.net';
42
+ const url = category ? `${baseUrl}/${lang}/c/${category}` : `${baseUrl}/${lang}`;
43
+
44
+ const headers = {
45
+ headers: {
46
+ Cookie: `user_lang=${lang.replace('-', '_')}`, // zh-tw → zh_tw
47
+ },
48
+ };
49
+
50
+ const { data: response } = await got(url, headers);
51
+ const $ = load(response);
52
+
53
+ const list = $('li.article-card-container a[data-gtm-action="ClickTitle"]')
54
+ .map((_, elem) => ({
55
+ title: $(elem).text(),
56
+ link: new URL($(elem).attr('href') ?? '', baseUrl).href,
57
+ }))
58
+ .toArray();
59
+
60
+ const items = await Promise.all(
61
+ list.map(async (item) => {
62
+ const result = await cache.tryGet(item.link, async () => {
63
+ const { data: articleData } = await got(item.link, headers);
64
+ const $article = load(articleData);
65
+
66
+ const processedDescription = processContent($article, lang);
67
+
68
+ return {
69
+ title: item.title,
70
+ description: processedDescription,
71
+ link: item.link,
72
+ pubDate: parseDate($article('time').attr('datetime') ?? ''),
73
+ } as DataItem;
74
+ });
75
+ return result;
76
+ })
77
+ );
78
+
79
+ return {
80
+ title: `${$('.ssc__header').length ? $('.ssc__header').text() : 'New'} - pixivision`,
81
+ link: url,
82
+ item: items.filter((item): item is DataItem => !!item),
83
+ };
84
+ }
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'pixivision',
5
+ url: 'www.pixivision.net',
6
+ };
@@ -0,0 +1,86 @@
1
+ import { CheerioAPI } from 'cheerio';
2
+ import { config } from '@/config';
3
+
4
+ const multiImagePrompt = {
5
+ en: (count) => `${count} images in total`,
6
+ zh: (count) => `共${count}张图`,
7
+ 'zh-tw': (count) => `共${count}張圖`,
8
+ ko: (count) => `총 ${count}개의 이미지`,
9
+ ja: (count) => `計${count}枚の画像`,
10
+ };
11
+
12
+ export function processContent($: CheerioAPI, lang: string): string {
13
+ // 移除作者頭像
14
+ $('.am__work__user-icon-container').remove();
15
+
16
+ // 插畫標題&作者
17
+ $('.am__work__title').attr('style', 'display: inline;');
18
+ $('.am__work__user-name').attr('style', 'display: inline; margin-left: 10px;');
19
+
20
+ // 處理多張圖片的提示
21
+ $('.mic__label').each((_, elem) => {
22
+ const $label = $(elem);
23
+ const count = $label.text();
24
+ const $workContainer = $label.parentsUntil('.am__work').last().parent();
25
+ const $titleContainer = $workContainer.find('.am__work__title-container');
26
+
27
+ $titleContainer.append(`<p style="float: right; margin: 0;">${multiImagePrompt[lang](count)}</p>`);
28
+ $label.remove();
29
+ });
30
+
31
+ // 插畫間隔
32
+ $('.article-item, ._feature-article-body__pixiv_illust').after('<br>');
33
+
34
+ // Remove Label & Tags
35
+ $('.arc__thumbnail-label').remove();
36
+ $('.arc__footer-container').remove();
37
+
38
+ // pixivision card
39
+ $('article._article-card').each((_, article) => {
40
+ const $article = $(article);
41
+
42
+ const $thumbnail = $article.find('._thumbnail');
43
+ const thumbnailStyle = $thumbnail.attr('style');
44
+ const bgImageMatch = thumbnailStyle?.match(/url\((.*?)\)/);
45
+ const imageUrl = bgImageMatch ? bgImageMatch[1] : '';
46
+
47
+ $thumbnail.remove();
48
+
49
+ if (imageUrl) {
50
+ $article.prepend(`<img src="${imageUrl}" alt="Article thumbnail">`);
51
+ }
52
+ });
53
+
54
+ // 處理 tweet
55
+ $('.fab__script').each((_, elem) => {
56
+ const $elem = $(elem);
57
+ const $link = $elem.find('blockquote > a');
58
+ const href = $link.attr('href');
59
+
60
+ if (href) {
61
+ const match = href.match(/\/status\/(\d+)/);
62
+ if (match) {
63
+ const tweetId = match[1];
64
+ $elem.html(`
65
+ <iframe
66
+ scrolling="no"
67
+ frameborder="0"
68
+ allowtransparency="true"
69
+ allowfullscreen="true"
70
+ class=""
71
+ style="position: static; visibility: visible; display: block; width: 550px; height: 1000px; flex-grow: 1;"
72
+ title="X Post"
73
+ src="https://platform.twitter.com/embed/Tweet.html?id=${tweetId}"
74
+ ></iframe>
75
+ `);
76
+ $elem.find('blockquote').remove();
77
+ }
78
+ }
79
+ });
80
+
81
+ return (
82
+ $('.am__body')
83
+ .html()
84
+ ?.replace(/https:\/\/i\.pximg\.net/g, config.pixiv.imgProxy || '') || ''
85
+ );
86
+ }
@@ -44,7 +44,7 @@ async function handler() {
44
44
  const listItems = $('#list-content .list-item')
45
45
  .map(function () {
46
46
  return {
47
- url: new URL($(this).find('> a.link').attr('href'), r.url).href,
47
+ url: new URL($(this).find('> a.link').attr('href'), 'https://bbs.pku.edu.cn/v2').href,
48
48
  title: $(this).find('.title').text(),
49
49
  };
50
50
  })
@@ -1,4 +1,4 @@
1
- import { Route } from '@/types';
1
+ import { Route, ViewType } from '@/types';
2
2
  import cache from '@/utils/cache';
3
3
  import got from '@/utils/got';
4
4
  import { parseDate } from '@/utils/parse-date';
@@ -7,7 +7,8 @@ import { config } from '@/config';
7
7
 
8
8
  export const route: Route = {
9
9
  path: '/category/:caty',
10
- categories: ['multimedia'],
10
+ categories: ['multimedia', 'popular'],
11
+ view: ViewType.Videos,
11
12
  example: '/pornhub/category/popular-with-women',
12
13
  parameters: { caty: 'category, see [categories](https://www.pornhub.com/webmasters/categories)' },
13
14
  features: {
@@ -1,4 +1,4 @@
1
- import { Route } from '@/types';
1
+ import { Route, ViewType } from '@/types';
2
2
  import got from '@/utils/got';
3
3
  import { load } from 'cheerio';
4
4
  import { isValidHost } from '@/utils/valid-host';
@@ -7,7 +7,8 @@ import InvalidParameterError from '@/errors/types/invalid-parameter';
7
7
 
8
8
  export const route: Route = {
9
9
  path: '/model/:username/:language?/:sort?',
10
- categories: ['multimedia'],
10
+ categories: ['multimedia', 'popular'],
11
+ view: ViewType.Videos,
11
12
  example: '/pornhub/model/stacy-starando',
12
13
  parameters: { language: 'language, see below', username: 'username, part of the url e.g. `pornhub.com/model/stacy-starando`', sort: 'sorting method, see below' },
13
14
  features: {
@@ -24,7 +25,7 @@ export const route: Route = {
24
25
  target: '/model/:username',
25
26
  },
26
27
  ],
27
- name: 'Verified amateur / Model',
28
+ name: 'Model',
28
29
  maintainers: ['I2IMk', 'queensferryme'],
29
30
  handler,
30
31
  };
@@ -1,4 +1,4 @@
1
- import { Route } from '@/types';
1
+ import { Route, ViewType } from '@/types';
2
2
  import got from '@/utils/got';
3
3
  import { load } from 'cheerio';
4
4
  import { isValidHost } from '@/utils/valid-host';
@@ -7,7 +7,8 @@ import InvalidParameterError from '@/errors/types/invalid-parameter';
7
7
 
8
8
  export const route: Route = {
9
9
  path: '/pornstar/:username/:language?/:sort?',
10
- categories: ['multimedia'],
10
+ categories: ['multimedia', 'popular'],
11
+ view: ViewType.Videos,
11
12
  example: '/pornhub/pornstar/june-liu',
12
13
  parameters: { language: 'language, see below', username: 'username, part of the url e.g. `pornhub.com/pornstar/june-liu`', sort: 'sorting method, see below' },
13
14
  features: {
@@ -24,7 +25,7 @@ export const route: Route = {
24
25
  target: '/pornstar/:username',
25
26
  },
26
27
  ],
27
- name: 'Verified model / Pornstar',
28
+ name: 'Pornstar',
28
29
  maintainers: ['I2IMk', 'queensferryme'],
29
30
  handler,
30
31
  description: `**\`sort\`**
@@ -1,11 +1,12 @@
1
- import { Route } from '@/types';
1
+ import { Route, ViewType } from '@/types';
2
2
  import got from '@/utils/got';
3
3
  import { parseDate } from '@/utils/parse-date';
4
4
  import { defaultDomain, renderDescription } from './utils';
5
5
 
6
6
  export const route: Route = {
7
7
  path: '/search/:keyword',
8
- categories: ['multimedia'],
8
+ categories: ['multimedia', 'popular'],
9
+ view: ViewType.Videos,
9
10
  example: '/pornhub/search/stepsister',
10
11
  parameters: { keyword: 'keyword' },
11
12
  features: {
@@ -0,0 +1,5 @@
1
+ import type { Namespace } from '@/types';
2
+ export const namespace: Namespace = {
3
+ name: '汽车召回网',
4
+ url: 'qiche365.org.cn',
5
+ };
@@ -0,0 +1,53 @@
1
+ import { Route, Data, DataItem } from '@/types';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { load } from 'cheerio';
4
+ import { parseDate } from '@/utils/parse-date';
5
+ import timezone from '@/utils/timezone';
6
+
7
+ const baseUrl = 'https://www.qiche365.org.cn';
8
+
9
+ export const route: Route = {
10
+ path: '/recall/:channel',
11
+ name: '汽车召回',
12
+ example: '/qiche365/recall/1',
13
+ parameters: { channel: '频道,见下表' },
14
+ description: `| 国内召回新闻 | 国内召回公告 | 国外召回新闻 | 国外召回公告 |
15
+ | ------------ | ------------ | ------------ | ------------ |
16
+ | 1 | 2 | 3 | 4 |`,
17
+ categories: ['government'],
18
+ maintainers: ['huanfe1'],
19
+ handler,
20
+ url: 'qiche365.org.cn/index/recall/index.html',
21
+ };
22
+
23
+ async function handler(ctx): Promise<Data> {
24
+ const { channel } = ctx.req.param();
25
+
26
+ const { html } = await ofetch(`${baseUrl}/index/recall/index/item/${channel}.html?loadmore=1`, {
27
+ method: 'get',
28
+ headers: {
29
+ 'Accept-Language': 'zh-CN,zh;q=0.9',
30
+ },
31
+ });
32
+
33
+ const $ = load(<string>html);
34
+ const items: DataItem[] = $('li')
35
+ .toArray()
36
+ .map((item) => {
37
+ const cheerioItem = $(item);
38
+ return {
39
+ title: cheerioItem.find('h1').text(),
40
+ link: `${baseUrl}${cheerioItem.find('a').attr('href')}`,
41
+ pubDate: timezone(parseDate(cheerioItem.find('h2').html()!.match('</i>(.*?)<b>')![1]), +8),
42
+ description: cheerioItem.find('p').text().trim(),
43
+ author: cheerioItem.find('h3 span').text(),
44
+ image: cheerioItem.find('img').attr('src') && `${baseUrl}${cheerioItem.find('img').attr('src')}`,
45
+ };
46
+ });
47
+ return {
48
+ title: ['国内召回公告', '国内召回新闻', '国外召回公告', '国外召回新闻'][channel - 1],
49
+ link: `${baseUrl}/index/recall/index.html`,
50
+ item: items,
51
+ language: 'zh-CN',
52
+ };
53
+ }
@@ -6,14 +6,26 @@ import { parseDate } from '@/utils/parse-date';
6
6
  import { finishArticleItem } from '@/utils/wechat-mp';
7
7
 
8
8
  const host = 'https://www.cs.sdu.edu.cn/';
9
- const typelist = ['学院公告', '学术报告', '科技简讯'];
10
- const urlList = ['xygg.htm', 'xsbg.htm', 'kjjx.htm'];
9
+ const urlMap = {
10
+ announcement: 'xygg.htm',
11
+ academic: 'xsbg.htm',
12
+ technology: 'kjjx.htm',
13
+ undergraduate: 'bkjy.htm',
14
+ postgraduate: 'yjsjy.htm',
15
+ };
16
+ const titleMap = {
17
+ announcement: '学院公告',
18
+ academic: '学术报告',
19
+ technology: '科技简讯',
20
+ undergraduate: '本科教育',
21
+ postgraduate: '研究生教育',
22
+ };
11
23
 
12
24
  export const route: Route = {
13
- path: '/cs/:type?',
25
+ path: '/cs/index/:type?',
14
26
  categories: ['university'],
15
- example: '/sdu/cs/0',
16
- parameters: { type: '默认为 `0`' },
27
+ example: '/sdu/cs/index/announcement',
28
+ parameters: { type: '默认为 `announcement`' },
17
29
  features: {
18
30
  requireConfig: false,
19
31
  requirePuppeteer: false,
@@ -22,17 +34,39 @@ export const route: Route = {
22
34
  supportPodcast: false,
23
35
  supportScihub: false,
24
36
  },
37
+ radar: [
38
+ {
39
+ source: ['www.cs.sdu.edu.cn/', 'www.cs.sdu.edu.cn/xygg.htm'],
40
+ target: '/cs/index/announcement',
41
+ },
42
+ {
43
+ source: ['www.cs.sdu.edu.cn/xsbg.htm'],
44
+ target: '/cs/index/academic',
45
+ },
46
+ {
47
+ source: ['www.cs.sdu.edu.cn/kjjx.htm'],
48
+ target: '/cs/index/technology',
49
+ },
50
+ {
51
+ source: ['www.cs.sdu.edu.cn/bkjy.htm'],
52
+ target: '/cs/index/undergraduate',
53
+ },
54
+ {
55
+ source: ['www.cs.sdu.edu.cn/yjsjy.htm'],
56
+ target: '/cs/index/postgraduate',
57
+ },
58
+ ],
25
59
  name: '计算机科学与技术学院通知',
26
- maintainers: ['Ji4n1ng'],
60
+ maintainers: ['Ji4n1ng', 'wiketool'],
27
61
  handler,
28
- description: `| 学院公告 | 学术报告 | 科技简讯 |
29
- | -------- | -------- | -------- |
30
- | 0 | 1 | 2 |`,
62
+ description: `| 学院公告 | 学术报告 | 科技简讯 | 本科教育 | 研究生教育 |
63
+ | -------- | -------- | -------- | -------- | -------- |
64
+ | announcement | academic | technology | undergraduate | postgraduate |`,
31
65
  };
32
66
 
33
67
  async function handler(ctx) {
34
- const type = ctx.req.param('type') ? Number.parseInt(ctx.req.param('type')) : 0;
35
- const link = new URL(urlList[type], host).href;
68
+ const type = ctx.req.param('type') ?? 'announcement';
69
+ const link = new URL(urlMap[type], host).href;
36
70
 
37
71
  const response = await got(link);
38
72
 
@@ -72,7 +106,7 @@ async function handler(ctx) {
72
106
  );
73
107
 
74
108
  return {
75
- title: `山东大学计算机科学与技术学院${typelist[type]}通知`,
109
+ title: `山东大学计算机科学与技术学院${titleMap[type]}`,
76
110
  description: $('title').text(),
77
111
  link,
78
112
  item,
@@ -1,6 +1,6 @@
1
1
  import type { Namespace } from '@/types';
2
2
 
3
3
  export const namespace: Namespace = {
4
- name: '山东大学(威海)',
5
- url: 'xinwen.wh.sdu.edu.cn',
4
+ name: '山东大学',
5
+ url: 'www.sdu.edu.cn',
6
6
  };
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'SoundOn',
5
+ url: 'player.soundon.fm',
6
+ };