style: fix eslint issues (#20862)

* style: fix n/no-deprecated-api

* style: fix no-useless-escape

* style: fix default-case

* style: fix unicorn/prefer-string-slice

* feat!: remove informedainews

the site is gone
This commit is contained in:
Tony 2026-01-13 03:25:37 +08:00 committed by GitHub
parent 242bba6713
commit 6dba3aa744
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
100 changed files with 211 additions and 250 deletions

View File

@ -32,7 +32,7 @@ export const route: Route = {
2.
3. Network
4.
5. results?ps=15\&pg=1 POST
5. results?ps=15&pg=1 POST
6. Request Payload \`filters: {planyr: "13", planmajor: "1", outname_w: "ACADIAU"}\` ,则三个 id 分别为: 13,1,ACADIAU
:::`,
};

View File

@ -31,7 +31,7 @@ export const route: Route = {
handler,
description: `| 新闻推荐 | 游戏新闻 | 动漫影视 | 智能数码 | 时事焦点 |
| -------- | -------- | -------- | -------- | ----------- |
| | game | acg | next | news\_36\_1 |`,
| | game | acg | next | news_36_1 |`,
};
async function handler(ctx) {

View File

@ -21,11 +21,11 @@ export const route: Route = {
handler,
description: `| [玄幻魔法](https://www.56kog.com/class/1_1.html) | [武侠修真](https://www.56kog.com/class/2_1.html) | [历史军事](https://www.56kog.com/class/4_1.html) | [侦探推理](https://www.56kog.com/class/5_1.html) | [网游动漫](https://www.56kog.com/class/6_1.html) |
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| 1\_1 | 2\_1 | 4\_1 | 5\_1 | 6\_1 |
| 1_1 | 2_1 | 4_1 | 5_1 | 6_1 |
| [](https://www.56kog.com/class/8_1.html) | [都市言情](https://www.56kog.com/class/3_1.html) | [科幻](https://www.56kog.com/class/7_1.html) | [女生小说](https://www.56kog.com/class/9_1.html) | [其他](https://www.56kog.com/class/10_1.html) |
| ------------------------------------------------ | ------------------------------------------------ | -------------------------------------------- | ------------------------------------------------ | --------------------------------------------- |
| 8\_1 | 3\_1 | 7\_1 | 9\_1 | 10\_1 |`,
| 8_1 | 3_1 | 7_1 | 9_1 | 10_1 |`,
};
async function handler(ctx) {

View File

@ -34,11 +34,11 @@ export const route: Route = {
| Chinese subtitles AV | Censored | Amateur | Uncensored | Asian self-timer | H comics |
| -------------------- | -------------- | ---------------- | ---------------- | ---------------- | ------------ |
| chinese\_list | censored\_list | amateurjav\_list | uncensored\_list | amateur\_list | hcomic\_list |
| chinese_list | censored_list | amateurjav_list | uncensored_list | amateur_list | hcomic_list |
| Chinese subtitles AV random | Censored random | Amateur random | Uncensored random | Asian self-timer random | H comics random |
| --------------------------- | ---------------- | ------------------ | ------------------ | ----------------------- | --------------- |
| chinese\_random | censored\_random | amateurjav\_random | uncensored\_random | amateur\_random | hcomic\_random |
| chinese_random | censored_random | amateurjav_random | uncensored_random | amateur_random | hcomic_random |
**Server**

View File

@ -34,7 +34,7 @@ export const route: Route = {
url: '91porn.com/index.php',
description: `| English | 简体中文 | 繁體中文 |
| ------- | -------- | -------- |
| en\_US | cn\_CN | zh\_ZH |`,
| en_US | cn_CN | zh_ZH |`,
};
async function handler(ctx) {

View File

@ -23,7 +23,7 @@ export const route: Route = {
handler,
description: `Rated Range
| ABC Class (Rated for \~1999) | ARC Class (Rated for \~2799) | AGC Class (Rated for \~9999) |
| ABC Class (Rated for ~1999) | ARC Class (Rated for ~2799) | AGC Class (Rated for ~9999) |
| ---------------------------- | ---------------------------- | ---------------------------- |
| 1 | 2 | 3 |

View File

@ -27,7 +27,7 @@ export const route: Route = {
handler,
description: `| 安卓版 | iPhone 版 | iPad HD 版 | UWP 版 | TV 版 |
| ------- | --------- | ---------- | ------ | ---------------- |
| android | iphone | ipad | win | android\_tv\_yst |`,
| android | iphone | ipad | win | android_tv_yst |`,
};
async function handler(ctx) {

View File

@ -91,7 +91,7 @@ const getWbiVerifyString = () => {
});
const imgUrl = navResponse.data.wbi_img.img_url;
const subUrl = navResponse.data.wbi_img.sub_url;
const r = imgUrl.substring(imgUrl.lastIndexOf('/') + 1, imgUrl.length).split('.')[0] + subUrl.substring(subUrl.lastIndexOf('/') + 1, subUrl.length).split('.')[0];
const r = imgUrl.slice(imgUrl.lastIndexOf('/') + 1).split('.')[0] + subUrl.slice(subUrl.lastIndexOf('/') + 1).split('.')[0];
// const { body: spaceResponse } = await got('https://space.bilibili.com/1', {
// headers: {
// Referer: 'https://www.bilibili.com/',

View File

@ -34,6 +34,8 @@ async function handler(ctx) {
case 'wh':
productTitle = '相簿';
break;
default:
throw new Error(`Unknown product: ${product}`);
}
const response = await got({

View File

@ -34,6 +34,8 @@ async function handler(ctx) {
case 'online':
orderTitle = '人气直播';
break;
default:
throw new Error(`Unknown order: ${order}`);
}
const nameResponse = await got({

View File

@ -36,6 +36,8 @@ async function handler(ctx) {
case 'online':
orderTitle = '人气直播';
break;
default:
throw new Error(`Unknown order: ${order}`);
}
const wbiVerifyString = await cache.getWbiVerifyString();
let params = `__refresh__=true&_extra=&context=&page=1&page_size=42&order=${order}&duration=&from_source=&from_spmid=333.337&platform=pc&highlight=1&single_column=0&keyword=${urlEncodedKey}&ad_resource=&source_tag=3&gaia_vtoken=&category_id=&search_type=live&dynamic_offset=0&web_location=1430654`;

View File

@ -21,7 +21,7 @@ export const route: Route = {
handler,
description: `| Boss 笔记 | 电脑日志 | 素材资源 | 设计师神器 | 设计教程 | 设计资讯 |
| --------- | --------------- | ---------------- | --------------- | --------------- | ------------------- |
| note | computer-skills | design-resources | design-software | design-tutorial | design\_information |`,
| note | computer-skills | design-resources | design-software | design-tutorial | design_information |`,
};
async function handler(ctx) {

View File

@ -144,23 +144,23 @@ export const route: Route = {
url: 'bse.cn/',
description: `| 本所要闻 | 人才招聘 | 采购信息 | 业务通知 |
| --------------- | -------- | -------- | ---------- |
| important\_news | recruit | purchase | news\_list |
| important_news | recruit | purchase | news_list |
| | | | |
| --------- | --------------- | ---------------- | ---------- |
| law\_list | public\_opinion | regulation\_list | fxrz\_list |
| law_list | public_opinion | regulation_list | fxrz_list |
| | | | |
| ---------- | ---------- | ---------- | --------------- |
| cxjg\_list | jygl\_list | scgl\_list | meeting\_notice |
| cxjg_list | jygl_list | scgl_list | meeting_notice |
| | | |
| ------------------ | ------------------ | ------------------ |
| meeting\_result | meeting\_change | bgcz\_notice |
| meeting_result | meeting_change | bgcz_notice |
| | | | |
| ---------------------- | ---------------------- | ------------------ | ------------- |
| bgcz\_result | bgcz\_change | termination\_audit | audit\_result |`,
| bgcz_result | bgcz_change | termination_audit | audit_result |`,
};
async function handler(ctx) {
@ -187,7 +187,7 @@ async function handler(ctx) {
let items = [];
switch (nodes[category].type) {
switch (type) {
case '/info/listse':
items = data.data.content.map((item) => ({
title: item.title,
@ -205,6 +205,9 @@ async function handler(ctx) {
pubDate: parseDate(item.pubDate.time),
}));
break;
default:
throw new Error(`Unknown type: ${type}`);
}
return {

View File

@ -36,13 +36,13 @@ export const route: Route = {
| | | | | | | |
| ---------- | ---- | -------- | ---------------- | ---------- | ---------- | ------ |
| regulation | bank | stock | insurance\_trust | investment | innovation | market |
| regulation | bank | stock | insurance_trust | investment | innovation | market |
Category
| | | | | | | | | | | |
| ---------- | ----- | --------- | ---------------- | ------------ | ------- | ------- | -------- | ----------------------- | ------- | ------ |
| coverstory | first | editorial | current\_affairs | editor\_desk | economy | finance | business | environment\_technology | cwcivil | column |`,
| coverstory | first | editorial | current_affairs | editor_desk | economy | finance | business | environment_technology | cwcivil | column |`,
};
async function handler(ctx) {

View File

@ -29,7 +29,7 @@ export const route: Route = {
handler,
description: `| CCF 新闻 | CCF 聚焦 | ACM 信息 |
| ----------- | -------- | --------- |
| Media\_list | Focus | ACM\_News |`,
| Media_list | Focus | ACM_News |`,
};
async function handler(ctx) {

View File

@ -25,7 +25,7 @@ export const route: Route = {
description: `::: tip
[](http://qk.chaoxing.com/space/index) 找到,你也可以从 [学科分类](https://qikan.chaoxing.com/jourclassify) 和 [期刊导航](https://qikan.chaoxing.com/search/openmag) 中发现更多期刊。
[****](http://m.chaoxing.com/mqk/list?sw=\&mags=6b5c39b3dd84352be512e29df0297437\&isort=20\&from=space),其 URL 为 \`http://m.chaoxing.com/mqk/list?mags=6b5c39b3dd84352be512e29df0297437\`。\`6b5c39b3dd84352be512e29df0297437\` 即为期刊 id所得路由为 [\`/chaoxing/qk/6b5c39b3dd84352be512e29df0297437\`](https://rsshub.app/chaoxing/qk/6b5c39b3dd84352be512e29df0297437)
[****](http://m.chaoxing.com/mqk/list?sw=&mags=6b5c39b3dd84352be512e29df0297437&isort=20&from=space),其 URL 为 \`http://m.chaoxing.com/mqk/list?mags=6b5c39b3dd84352be512e29df0297437\`。\`6b5c39b3dd84352be512e29df0297437\` 即为期刊 id所得路由为 [\`/chaoxing/qk/6b5c39b3dd84352be512e29df0297437\`](https://rsshub.app/chaoxing/qk/6b5c39b3dd84352be512e29df0297437)
:::
::: warning

View File

@ -9,7 +9,7 @@ const dynamicTpye = { 0: '基本动态', 8: '酷图', 9: '评论', 10: '提问',
const getRandomDEVICE_ID = () => {
let id = [10, 6, 6, 6, 14];
id = id.map((i) => Math.random().toString(36).substring(2, i));
id = id.map((i) => Math.random().toString(36).slice(2, i));
return id.join('-');
};

View File

@ -60,6 +60,8 @@ async function handler(ctx) {
case '3':
nav_name = '唱片';
break;
default:
throw new Error(`Unknown nav: ${nav}`);
}
return {

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import { load } from 'cheerio';
import type { Route } from '@/types';
@ -15,7 +13,7 @@ export const route: Route = {
async function handler(ctx) {
const id = ctx.req.param('id');
const link = url.resolve(host, id);
const link = new URL(id, host).href;
const response = await got.get(link);
const $ = load(response.data);
const title = $('div.h1').text();

View File

@ -28,24 +28,24 @@ export const route: Route = {
handler,
description: `| 榜单 / 集合 | 路由 |
| ------------------ | ----------------------------- |
| | subject\_real\_time\_hotest |
| | movie\_showing |
| | movie\_real\_time\_hotest |
| | tv\_real\_time\_hotest |
| | movie\_weekly\_best |
| | tv\_chinese\_best\_weekly |
| | tv\_global\_best\_weekly |
| | show\_chinese\_best\_weekly |
| | show\_global\_best\_weekly |
| | tv\_domestic |
| | tv\_american |
| | tv\_japanese |
| | tv\_korean |
| | tv\_animation |
| | book\_fiction\_hot\_weekly |
| | book\_nonfiction\_hot\_weekly |
| | music\_single |
| | music\_chinese |
| | subject_real_time_hotest |
| | movie_showing |
| | movie_real_time_hotest |
| | tv_real_time_hotest |
| | movie_weekly_best |
| | tv_chinese_best_weekly |
| | tv_global_best_weekly |
| | show_chinese_best_weekly |
| | show_global_best_weekly |
| | tv_domestic |
| | tv_american |
| | tv_japanese |
| | tv_korean |
| | tv_animation |
| | book_fiction_hot_weekly |
| | book_nonfiction_hot_weekly |
| | music_single |
| | music_chinese |
| ... | ... |
| | | | |

View File

@ -21,7 +21,7 @@ export const route: Route = {
handler,
description: `| 一周口碑电影榜 | 华语口碑剧集榜 |
| ------------------- | ------------------------- |
| movie\_weekly\_best | tv\_chinese\_best\_weekly |`,
| movie_weekly_best | tv_chinese_best_weekly |`,
};
async function handler(ctx) {

View File

@ -77,7 +77,7 @@ async function handler(ctx) {
const response = await got(api);
const data = response.data.replace(/,"page":"(.*?)","num":/, ',"num":');
let json = JSON.parse(data.substring(1, data.length - 1)).shuju;
let json = JSON.parse(data.slice(1, -1)).shuju;
if (json.length > 20) {
json = json.slice(0, 20);
}

View File

@ -7,6 +7,6 @@ export const namespace: Namespace = {
| Key | Meaning | Accepted keys | Default value |
| ------------ | ------------------------------------------------------------------------------- | -------------- | ------------- |
| bittorrent | Whether include a link to the latest torrent | 0/1/true/false | false |
| embed\_thumb | Whether the cover image is embedded in the RSS feed rather than given as a link | 0/1/true/false | false |`,
| embed_thumb | Whether the cover image is embedded in the RSS feed rather than given as a link | 0/1/true/false | false |`,
lang: 'en',
};

View File

@ -31,7 +31,7 @@ export const route: Route = {
| | / ि | ि | | | | ि | ि | ि | |
| ---- | -------- | ------- | ------ | -------- | ------------- | -------------- | ------- | ----- | ---- |
| news | business | opinion | sports | national | entertainment | photo\_feature | feature | world | blog |`,
| news | business | opinion | sports | national | entertainment | photo_feature | feature | world | blog |`,
};
async function handler(ctx) {

View File

@ -134,7 +134,7 @@ export const route: Route = {
| | | 稿 | 稿 | |
| -------------- | ------------ | -------------- | ------------ | -------------- |
| updater | update\_old | newer | create\_old | popular |
| updater | update_old | newer | create_old | popular |
Rating
@ -201,6 +201,9 @@ async function handler(ctx) {
description: `${item.buyable_lowest_plan.description ? `<p>${item.buyable_lowest_plan.description}</p>` : ''}<img src="${item.thumb ? item.thumb.main : item.thumb_micro}">`,
}));
break;
default:
throw new Error(`Unknown type: ${type}`);
}
return {

View File

@ -117,6 +117,9 @@ async function handler(ctx) {
break;
case 'intcreditcard':
bankname = '境外信用卡';
break;
default:
throw new Error(`Unknown bank: ${bank}`);
}
const response = await got.get(target, {

View File

@ -196,9 +196,9 @@ const parseBlock = (block: Block, entityMap: Readonly<Record<string, Entity>>):
let lastOffset = 0;
for (const range of groupedRanges) {
resultParts.push(text.substring(lastOffset, range.offset));
resultParts.push(text.slice(lastOffset, range.offset));
let styledText = text.substring(range.offset, range.offset + range.length);
let styledText = text.slice(range.offset, range.offset + range.length);
if (range.styles.length > 0) {
const combinedStyle: Style = {};

View File

@ -36,7 +36,7 @@ export const route: Route = {
handler,
description: `| 推荐 | 股票 | 基金 | 新股 | 研报 |
| --------------- | ----- | ---- | ---------- | -------- |
| web\_home\_page | stock | fund | new\_stock | research |`,
| web_home_page | stock | fund | new_stock | research |`,
};
async function handler(ctx) {

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import type { DataItem, Route } from '@/types';
import ofetch from '@/utils/ofetch';
@ -39,7 +37,7 @@ async function handler(ctx) {
}
const suffix = 'search?o='.concat(order, '&q=', encodeURIComponent(query), '&s=', sort, '&type=Repositories');
const link = url.resolve(host, suffix);
const link = new URL(suffix, host).href;
const response = await ofetch(link, {
headers: {
accept: 'application/json',

View File

@ -32,7 +32,7 @@ export const route: Route = {
| \`o\` | Sorting Order | \`asc\`, \`desc\` |
| \`s\` | Sorting Criteria | \`stars\`, \`forks\`, \`updated\` |
For instance, the \`/github/topics/framework/l=php&o=desc&s=stars\` route will generate the RSS feed corresponding to this [page](https://github.com/topics/framework?l=php\&o=desc\&s=stars).`,
For instance, the \`/github/topics/framework/l=php&o=desc&s=stars\` route will generate the RSS feed corresponding to this [page](https://github.com/topics/framework?l=php&o=desc&s=stars).`,
};
async function handler(ctx) {

View File

@ -25,7 +25,7 @@ export const route: Route = {
1. Basic mode, sample query is the keywords desired, eg.data visualization, [https://rsshub.app/google/scholar/data+visualization](https://rsshub.app/google/scholar/data+visualization).
2. Advanced mode, visit [Google Scholar](https://scholar.google.com/schhp?hl=en\&as_sdt=0,5), click the top left corner and select「Advanced Search」, fill in your conditions and submit the search. The URL should look like this: [https://scholar.google.com/scholar?as\_q=data+visualization\&as\_epq=\&as\_oq=\&as\_eq=\&as\_occt=any\&as\_sauthors=\&as\_publication=\&as\_ylo=2018\&as\_yhi=\&hl=en\&as\_sdt=0%2C5](https://scholar.google.com/scholar?as_q=data+visualization\&as_epq=\&as_oq=\&as_eq=\&as_occt=any\&as_sauthors=\&as_publication=\&as_ylo=2018\&as_yhi=\&hl=en\&as_sdt=0%2C5), copy everything after \`https://scholar.google.com/scholar?\` from the URL and use it as the query for this route. The complete URL for the above example should look like this: [https://rsshub.app/google/scholar/as\_q=data+visualization\&as\_epq=\&as\_oq=\&as\_eq=\&as\_occt=any\&as\_sauthors=\&as\_publication=\&as\_ylo=2018\&as\_yhi=\&hl=en\&as\_sdt=0%2C5](https://rsshub.app/google/scholar/as_q=data+visualization\&as_epq=\&as_oq=\&as_eq=\&as_occt=any\&as_sauthors=\&as_publication=\&as_ylo=2018\&as_yhi=\&hl=en\&as_sdt=0%2C5).`,
2. Advanced mode, visit [Google Scholar](https://scholar.google.com/schhp?hl=en&as_sdt=0,5), click the top left corner and select「Advanced Search」, fill in your conditions and submit the search. The URL should look like this: [https://scholar.google.com/scholar?as_q=data+visualization&as_epq=&as_oq=&as_eq=&as_occt=any&as_sauthors=&as_publication=&as_ylo=2018&as_yhi=&hl=en&as_sdt=0%2C5](https://scholar.google.com/scholar?as_q=data+visualization&as_epq=&as_oq=&as_eq=&as_occt=any&as_sauthors=&as_publication=&as_ylo=2018&as_yhi=&hl=en&as_sdt=0%2C5), copy everything after \`https://scholar.google.com/scholar?\` from the URL and use it as the query for this route. The complete URL for the above example should look like this: [https://rsshub.app/google/scholar/as_q=data+visualization&as_epq=&as_oq=&as_eq=&as_occt=any&as_sauthors=&as_publication=&as_ylo=2018&as_yhi=&hl=en&as_sdt=0%2C5](https://rsshub.app/google/scholar/as_q=data+visualization&as_epq=&as_oq=&as_eq=&as_occt=any&as_sauthors=&as_publication=&as_ylo=2018&as_yhi=&hl=en&as_sdt=0%2C5).`,
};
async function handler(ctx) {

View File

@ -23,7 +23,7 @@ export const route: Route = {
],
description: `| 通知公告 | 国企资讯 | 国企简介 | 国企招聘 |
| --------- | -------- | -------- | -------- |
| tzgg\_191 | gqdj | gqjj | gqzp |`,
| tzgg_191 | gqdj | gqjj | gqzp |`,
};
async function handler(ctx) {

View File

@ -98,6 +98,8 @@ async function handler(ctx) {
case undefined:
list_element = '#d11_li ul a[href*="content"], .two-o ul a[href*="content"]';
break;
default:
break;
}
break;
case 'zwgk':
@ -110,10 +112,16 @@ async function handler(ctx) {
case undefined:
list_element = '.swiper-slide a, .bt a, .zcjdlist a';
break;
default:
break;
}
break;
default:
break;
}
break;
default:
break;
}
title_element = '#ScDetailTitle';
description_element = '#zoomcon';
@ -143,8 +151,12 @@ async function handler(ctx) {
case undefined:
list_element = '.zw-news-list a';
break;
default:
break;
}
break;
default:
break;
}
title_element = '.title';
description_element = '.content';
@ -170,6 +182,8 @@ async function handler(ctx) {
case 'xwzx':
list_element = '.news_title li a, .news_title_ li a';
break;
default:
break;
}
}
title_element = '.article_title';
@ -233,6 +247,8 @@ async function handler(ctx) {
case 'zwxx':
list_element = '.marqueetop a, .gud-file ul li a, .dyn-box ul li a, .org-list a';
break;
default:
break;
}
}
title_element = '.pre-box h3';
@ -287,6 +303,8 @@ async function handler(ctx) {
list_element = '.img a';
}
break;
default:
break;
}
title_element = '.bt';
title_match = '(.*)\n';
@ -365,6 +383,8 @@ async function handler(ctx) {
pubDate_element = '.HTime';
pubDate_match = '发布日期:(.*)   点击率';
break;
default:
throw new Error(`Unknown path[1]: ${path[1]}`);
}
const info = {
pathstartat,

View File

@ -62,6 +62,8 @@ async function handler(ctx) {
id = 'zwgk/zcjd';
name = '政策解读';
break;
default:
throw new Error(`Unknown category: ${ctx.req.param('category')}`);
}
const res = await got(`${host}/${id}/`);
@ -111,6 +113,8 @@ async function handler(ctx) {
author: content('.author').text().trim() === '本网' ? '茂名市茂南区人民政府网' : content('.author').text().trim(),
};
}
default:
throw new Error(`Unknown host: ${url.host}`);
}
});
})

View File

@ -33,7 +33,7 @@ export const route: Route = {
handler,
description: `| 政策解读 | 最新文件 | 公告公示 | 教育部简报 | 教育要闻 |
| :----------: | :----------: | :------: | :-----------------: | :--------------: |
| policy\_anal | newest\_file | notice | edu\_ministry\_news | edu\_focus\_news |`,
| policy_anal | newest_file | notice | edu_ministry_news | edu_focus_news |`,
};
async function handler(ctx) {

View File

@ -1,5 +1,3 @@
import { URL } from 'node:url';
import { load } from 'cheerio';
import type { DataItem, Route } from '@/types';

View File

@ -28,7 +28,7 @@ export const route: Route = {
description: `| Sort | Description |
| --------------- | -------------- |
| today | Daily installs |
| total\_installs | Total installs |
| total_installs | Total installs |
| ratings | Ratings |
| created | Created date |
| updated | Updated date |

View File

@ -24,7 +24,7 @@ export const route: Route = {
maintainers: ['Fatpandac'],
handler,
description: `::: tip
: [\`/guangdiu/k=daily&c=us\`](https://rsshub.app/guangdiu/k=daily\&c=us)
: [\`/guangdiu/k=daily&c=us\`](https://rsshub.app/guangdiu/k=daily&c=us)
:::`,
};

View File

@ -104,7 +104,7 @@ async function ggtzParse(ctx, $) {
author = header.slice(0, index - 2) || '';
const date = header.substring(index + 3, index + 19);
const date = header.slice(index + 3, index + 19);
pubDate = parseDate(date, 'YYYY-MM-DD HH:mm');
} else {
const date = $(item).find('a[class=c269582_date]').text();

View File

@ -46,7 +46,7 @@ export const route: Route = {
name: '科普',
maintainers: ['Fatpandac'],
handler,
description: `| latest | bitcoin | ethereum | defi | inter\_blockchain | mining | safety | satoshi\_nakomoto | public\_blockchain |
description: `| latest | bitcoin | ethereum | defi | inter_blockchain | mining | safety | satoshi_nakomoto | public_blockchain |
| ------ | ------- | -------- | ---- | ----------------- | ------ | ------ | ----------------- | ------------------ |
| | | | DeFi | | | | | |`,
};

View File

@ -31,7 +31,7 @@ export const route: Route = {
| English | | |
| ------- | -------- | -------- |
| english | chs | tc\_chi |`,
| english | chs | tc_chi |`,
};
async function handler(ctx) {

View File

@ -27,7 +27,7 @@ export const route: Route = {
url: 'xky.hunau.edu.cn/',
description: `| 分类 | 通知公告 | 学院新闻 | 其他分类通知... |
| ---- | ---------- | -------- | --------------- |
| | tzgg\_8472 | xyxw | URL |`,
| | tzgg_8472 | xyxw | URL |`,
};
async function handler(ctx) {

View File

@ -1,79 +0,0 @@
import { load } from 'cheerio'; // 类似 jQuery 的 API HTML 解析器
import type { Route } from '@/types';
import cache from '@/utils/cache';
import ofetch from '@/utils/ofetch'; // 统一使用的请求库
import { parseDate } from '@/utils/parse-date';
export const route: Route = {
path: '/zh-Hans/docs/:type',
categories: ['new-media'],
example: '/informedainews/zh-Hans/docs/world-news-daily',
parameters: { type: 'world-news-daily|tech-enthusiast-weekly|ai-enthusiast-daily' },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['informedainews.com', 'informedainews.com/zh-Hans/docs/:type', 'informedainews.com/docs/:type'],
target: '/zh-Hans/docs/:type',
},
],
name: '知闻AI',
maintainers: ['guicaiyue'],
handler,
};
async function handler(ctx) {
const { type } = ctx.req.param();
const response = await ofetch(`https://informedainews.com/zh-Hans/docs/${type}`);
const $ = load(response);
const list = $('li.theme-doc-sidebar-item-category ul li')
.toArray()
.map((item) => {
item = $(item);
const a = item.find('a').first();
const text = a.text();
// 找到第一个'('字符的位置
const start = text.indexOf('(');
// 找到第一个')'字符的位置
const end = text.indexOf(')');
// 从第一个'('到第一个')'之间的子字符串就是日期
const date = text.substring(start + 1, end);
return {
title: text,
link: `https://informedainews.com${a.attr('href')}`,
pubDate: parseDate(date),
author: 'AI',
};
});
const items = await Promise.all(
list.map((item) =>
cache.tryGet(item.link, async () => {
const response = await ofetch(item.link);
const $ = load(response);
// 选择类名为“comment-body”的第一个元素
item.description = $('.theme-doc-markdown.markdown').first().html();
// 上面每个列表项的每个属性都在此重用,
// 并增加了一个新属性“description”
return item;
})
)
);
return {
// 源标题
title: `${type} docs`,
// 源链接
link: `https://informedainews.com/zh-Hans/docs/${type}`,
// 源文章
item: items,
};
}

View File

@ -1,19 +0,0 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: 'Informed AI News',
url: 'informedainews.com',
description: `
::: tip
informed AI RSS feeds:
- World News Daily: 'https://rsshub.app/informedainews/zh-Hans/docs/world-news-daily'
- Tech Enthusiast Weekly: 'https://rsshub.app/informedainews/zh-Hans/docs/tech-enthusiast-weekly'
- AI Enthusiast Weekly: 'https://rsshub.app/informedainews/zh-Hans/docs/ai-enthusiast-daily'
:::`,
zh: {
name: '知闻AI',
},
lang: 'en',
};

View File

@ -63,6 +63,8 @@ const utils = {
case 'en':
customFormat = dayjs(t, formatEnDate, true).isValid() ? formatEnDate : dayjs(t, formatEnDateTime, true).isValid() ? formatEnDateTime : undefined;
break;
default:
// empty
}
if (o) {

View File

@ -6,7 +6,7 @@ export const namespace: Namespace = {
description: `::: tip
JavDB 使 \`https://javdb.com\` ,若该域名无法访问,可以通过在路由最后加上 \`?domain=<域名>\` 指定路由访问的域名。如指定备用域名为 \`https://javdb36.com\`,则在所有 JavDB 路由最后加上 \`?domain=javdb36.com\` 即可,此时路由为 [\`/javdb?domain=javdb36.com\`](https://rsshub.app/javdb?domain=javdb36.com)
**** \`?domain=<域名>\` 即可。如指定分類 URL 为 \`https://javdb.com/tags?c2=5&c10=1\` 并指定备用域名为 \`https://javdb36.com\`,即在 \`/javdb/tags/c2=5&c10=1\` 最后加上 \`?domain=javdb36.com\`,此时路由为 [\`/javdb/tags/c2=5&c10=1?domain=javdb36.com\`](https://rsshub.app/javdb/tags/c2=5\&c10=1?domain=javdb36.com)
**** \`?domain=<域名>\` 即可。如指定分類 URL 为 \`https://javdb.com/tags?c2=5&c10=1\` 并指定备用域名为 \`https://javdb36.com\`,即在 \`/javdb/tags/c2=5&c10=1\` 最后加上 \`?domain=javdb36.com\`,此时路由为 [\`/javdb/tags/c2=5&c10=1?domain=javdb36.com\`](https://rsshub.app/javdb/tags/c2=5&c10=1?domain=javdb36.com)
**************** ****
:::

View File

@ -87,7 +87,7 @@ export const route: Route = {
| [](https://www.jiemian.com/lists/53.html) | [箭厂](https://www.jiemian.com/video/lists/195_1.html) |
| --------------------------------------------- | ------------------------------------------------------ |
| 53 | video/lists/195\_1 |
| 53 | video/lists/195_1 |
#### [](https://www.jiemian.com/lists/4.html)

View File

@ -11,9 +11,9 @@ export const route: Route = {
handler,
description: `| [界面 Vnews](https://www.jiemian.com/video/lists/258_1.html) | [直播](https://www.jiemian.com/videoLive/lists_1.html) | [箭厂](https://www.jiemian.com/video/lists/195_1.html) | [面谈](https://www.jiemian.com/video/lists/111_1.html) | [品牌创酷](https://www.jiemian.com/video/lists/226_1.html) | [番 茄社](https://www.jiemian.com/video/lists/567_1.html) |
| ------------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ---------------------------------------------------------- | --------------------------------------------------------- |
| 258\_1 | videoLive/lists\_1 | 195\_1 | 111\_1 | 226\_1 | 567\_1 |
| 258_1 | videoLive/lists_1 | 195_1 | 111_1 | 226_1 | 567_1 |
| [](https://www.jiemian.com/video/lists/882_1.html) |
| ------------------------------------------------------------ |
| 882\_1 |`,
| 882_1 |`,
};

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import { load } from 'cheerio';
import got from '@/utils/got';
@ -10,7 +8,7 @@ const ProcessFeed = async (list, cache) => {
const items = await Promise.all(
list.map(async (e) => {
const link = url.resolve(host, e);
const link = new URL(e, host).href;
const single = await cache.tryGet(link, async () => {
const response = await got.get(link);

View File

@ -31,7 +31,7 @@ export const route: Route = {
| \`period\` | 发布时间 | \`1/7/30\` | 空 |
[\`/linkedin/cn/jobs/Software?location=shanghai&period=1\`](https://rsshub.app/linkedin/cn/jobs/Software?location=shanghai\&period=1): 查找所有在上海的今日发布的所有 Software 工作
[\`/linkedin/cn/jobs/Software?location=shanghai&period=1\`](https://rsshub.app/linkedin/cn/jobs/Software?location=shanghai&period=1): 查找所有在上海的今日发布的所有 Software 工作
**便 [LinkedIn.cn](https://www.linkedin.cn/incareer/jobs/search) 上进行搜索,并使用 [RSSHub Radar](https://github.com/DIYgod/RSSHub-Radar) 加载特定的 feed。**`,
};

View File

@ -2,7 +2,7 @@ function parseJSONP(jsonpData) {
try {
const startPos = jsonpData.indexOf('({');
const endPos = jsonpData.lastIndexOf('})');
let jsonString = jsonpData.substring(startPos + 1, endPos + 1);
let jsonString = jsonpData.slice(startPos + 1, endPos + 1);
// remove escaped single quotes since they are not valid json
jsonString = jsonString.replaceAll(String.raw`\'`, "'");

View File

@ -39,7 +39,7 @@ export const route: Route = {
url: 'www.mhgui.com/user/book/shelf',
description: `::: tip
MHGUI\_COOKIE
MHGUI_COOKIE
:::`,
};

View File

@ -24,7 +24,7 @@ export const route: Route = {
description: `::: tip
sid tid URL \`t_id\` 字段的值,下面是一个例子:
[ - NSCLC](https://www.medsci.cn/department/details?s_id=5\&t_id=277) 的 URL 为 \`https://www.medsci.cn/department/details?s_id=5&t_id=277\`,可以看到此时 \`s_id\` 对应 \`sid\` 的值为 5 \`t_id\` 对应 \`tid\` 的值为 277所以可以得到路由 [\`/medsci/5/277\`](https://rsshub.app/medsci/5/277)
[ - NSCLC](https://www.medsci.cn/department/details?s_id=5&t_id=277) 的 URL 为 \`https://www.medsci.cn/department/details?s_id=5&t_id=277\`,可以看到此时 \`s_id\` 对应 \`sid\` 的值为 5 \`t_id\` 对应 \`tid\` 的值为 277所以可以得到路由 [\`/medsci/5/277\`](https://rsshub.app/medsci/5/277)
:::
| | | | | |

View File

@ -18,6 +18,9 @@ const handler = async (ctx) => {
type = 'available';
title = 'All Releases';
break;
default:
// defaults to 'new-releases'
break;
}
const url = `https://www.metacritic.com/browse/games/release-date/${type}/${ctx.req.param('platform')}/${sort}`;

View File

@ -33,7 +33,7 @@ export const route: Route = {
| 线 | | |
| --------- | ---------- | ------------ |
| top\_time | top\_money | top\_comment |
| top_time | top_money | top_comment |

View File

@ -23,7 +23,7 @@ export const route: Route = {
handler,
description: `| 交易通知 | 政策规定 | 业务通知 |
| ------------ | -------------------- | ----------------- |
| zonghezixun3 | zhengceguiding\_list | yewutongzhi\_list |`,
| zonghezixun3 | zhengceguiding_list | yewutongzhi_list |`,
};
async function handler(ctx) {

View File

@ -127,19 +127,19 @@ export const route: Route = {
| 10 | 20 | 30 | 90 | 30 |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [glbtmeana10\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana10_) | [glbtmeana20\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana20_) | [glbtmeana30\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana30_) | [glbtmeana90\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana90_) | [glbtmina30\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmina30_) |
| [glbtmeana10_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana10_) | [glbtmeana20_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana20_) | [glbtmeana30_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana30_) | [glbtmeana90_](https://rsshub.app/ncc-cma/cmdp/image/glbtmeana90_) | [glbtmina30_](https://rsshub.app/ncc-cma/cmdp/image/glbtmina30_) |
| 90 | 30 | 90 |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| [glbtmina90\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmina90_) | [glbtmaxa30\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmaxa30_) | [glbtmaxa90\_](https://rsshub.app/ncc-cma/cmdp/image/glbtmaxa90_) |
| [glbtmina90_](https://rsshub.app/ncc-cma/cmdp/image/glbtmina90_) | [glbtmaxa30_](https://rsshub.app/ncc-cma/cmdp/image/glbtmaxa30_) | [glbtmaxa90_](https://rsshub.app/ncc-cma/cmdp/image/glbtmaxa90_) |
| 10 | 20 | 30 | 90 | 10 |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------ |
| [glbrain10\_](https://rsshub.app/ncc-cma/cmdp/image/glbrain10_) | [glbrain20\_](https://rsshub.app/ncc-cma/cmdp/image/glbrain20_) | [glbrain30\_](https://rsshub.app/ncc-cma/cmdp/image/glbrain30_) | [glbrain90\_](https://rsshub.app/ncc-cma/cmdp/image/glbrain90_) | [glbraina10\_](https://rsshub.app/ncc-cma/cmdp/image/glbraina10_) |
| [glbrain10_](https://rsshub.app/ncc-cma/cmdp/image/glbrain10_) | [glbrain20_](https://rsshub.app/ncc-cma/cmdp/image/glbrain20_) | [glbrain30_](https://rsshub.app/ncc-cma/cmdp/image/glbrain30_) | [glbrain90_](https://rsshub.app/ncc-cma/cmdp/image/glbrain90_) | [glbraina10_](https://rsshub.app/ncc-cma/cmdp/image/glbraina10_) |
| 20 | 30 | 90 |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| [glbraina20\_](https://rsshub.app/ncc-cma/cmdp/image/glbraina20_) | [glbraina30\_](https://rsshub.app/ncc-cma/cmdp/image/glbraina30_) | [glbraina90\_](https://rsshub.app/ncc-cma/cmdp/image/glbraina90_) |
| [glbraina20_](https://rsshub.app/ncc-cma/cmdp/image/glbraina20_) | [glbraina30_](https://rsshub.app/ncc-cma/cmdp/image/glbraina30_) | [glbraina90_](https://rsshub.app/ncc-cma/cmdp/image/glbraina90_) |
`,
categories: ['forecast'],

View File

@ -45,19 +45,19 @@ export const route: Route = {
| ----------------------- | ---------- |
| news | |
| academic | |
| talent\_development | |
| international\_exchange | |
| talent_development | |
| international_exchange | |
| announcement | |
| undergraduate\_dev | |
| postgraduate\_dev | |
| undergraduate\_recruit | |
| postgraduate\_recruit | |
| CPC\_build | |
| CPC\_work | |
| union\_work | |
| CYL\_work | |
| security\_management | |
| alumni\_style | |`,
| undergraduate_dev | |
| postgraduate_dev | |
| undergraduate_recruit | |
| postgraduate_recruit | |
| CPC_build | |
| CPC_work | |
| union_work | |
| CYL_work | |
| security_management | |
| alumni_style | |`,
};
async function handler(ctx) {
@ -84,11 +84,11 @@ async function handler(ctx) {
const info = $($('.ny_con p')[1]).text();
const s = info.search(/\d{4}-\d{2}-\d{2}/);
const date = info.substring(s, s + 10);
const date = info.slice(s, s + 10);
const au_start = info.indexOf('作者:') + 3;
const au_end = info.lastIndexOf('|');
const auhor = info.substring(au_start, au_end).trim();
const auhor = info.slice(au_start, au_end).trim();
$('.entry')
.find('span')
.each(function () {

View File

@ -4,7 +4,7 @@ export const namespace: Namespace = {
name: '新榜',
url: 'newrank.cn',
description: `::: warning
NEWRANK\_COOKIE
NEWRANK_COOKIE
token
:::`,
lang: 'zh-CN',

View File

@ -1,5 +1,3 @@
import { URLSearchParams } from 'node:url';
import type { Route } from '@/types';
import ofetch from '@/utils/ofetch';
import { parseDate } from '@/utils/parse-date';

View File

@ -43,6 +43,8 @@ async function handler(ctx) {
title = '学生资讯';
path = '1659';
break;
default:
throw new Error(`Unknown type: ${type}`);
}
const base = 'http://ceai.njnu.edu.cn/Item/List.asp?ID=' + path;

View File

@ -42,6 +42,9 @@ async function handler(ctx) {
case 'xstz':
title = '学生通知';
path = 'xstz.htm';
break;
default:
throw new Error(`Unknown type: ${type}`);
}
const base = 'http://jwc.njnu.edu.cn/index/' + path;

View File

@ -44,7 +44,7 @@ async function handler() {
const start = script.indexOf('[');
const end = script.lastIndexOf(']');
const t = JSON.parse(script.substring(start, end + 1));
const t = JSON.parse(script.slice(start, end + 1));
// only read first page
return t[0].infolist.map((item) => ({

View File

@ -44,7 +44,7 @@ async function handler() {
const start = script.indexOf('[');
const end = script.lastIndexOf(']');
const t = JSON.parse(script.substring(start, end + 1));
const t = JSON.parse(script.slice(start, end + 1));
// only read first page
return t[0].infolist.map((item) => ({

View File

@ -44,7 +44,7 @@ async function handler() {
const start = script.indexOf('[');
const end = script.lastIndexOf(']');
const t = JSON.parse(script.substring(start, end + 1));
const t = JSON.parse(script.slice(start, end + 1));
// only read first page
return t[0].infolist.map((item) => ({

View File

@ -32,7 +32,7 @@ export const route: Route = {
handler,
description: `| 首页通知公告 | 首页新闻动态 | 最新通知 | 招生信息 | 培养信息 | 学术活动 |
| ------------ | ------------ | -------- | -------- | -------- | -------- |
| sytzgg\_4568 | sytzgg | 14686 | 14687 | 14688 | xshdggl |`,
| sytzgg_4568 | sytzgg | 14686 | 14687 | 14688 | xshdggl |`,
};
async function handler(ctx) {

View File

@ -202,6 +202,9 @@ async function handler(ctx) {
case 'three-month':
startTime = dayjs().subtract(90, 'd').startOf('d').format('YYYY-MM-DDTHH:mm:ss.SSS');
break;
default:
throw new Error(`Unknown time: ${time}`);
}
searchUrl += `&publishedAt=${startTime}Z&publishedAt=${endTime}Z`;
}

View File

@ -46,7 +46,7 @@ export const route: Route = {
description: `::: tip
****
[](https://news.now.com/home/tracker) 中的 [塔利班奪權](https://news.now.com/home/tracker/detail?catCode=123\&topicId=1056) 话题,其网址为 \`https://news.now.com/home/tracker/detail?catCode=123&topicId=1056\`,其中 \`topicId\` 为 1056则对应路由为 [\`/now/news/tracker/1056\`](https://rsshub.app/now/news/tracker/1056)
[](https://news.now.com/home/tracker) 中的 [塔利班奪權](https://news.now.com/home/tracker/detail?catCode=123&topicId=1056) 话题,其网址为 \`https://news.now.com/home/tracker/detail?catCode=123&topicId=1056\`,其中 \`topicId\` 为 1056则对应路由为 [\`/now/news/tracker/1056\`](https://rsshub.app/now/news/tracker/1056)
:::
| | | | |

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import { load } from 'cheerio';
import type { Route } from '@/types';
@ -78,7 +76,7 @@ async function handler(ctx) {
}
return {
title: `${company.text()} | ${title.text()}`,
link: url.resolve(rootUrl, title.attr('href')),
link: new URL(title.attr('href'), rootUrl).href,
pubDate: date.toUTCString(),
};
});

View File

@ -10,7 +10,7 @@ export const namespace: Namespace = {
[](https://bulletin.nuist.edu.cn)为例,点开任意一个栏目
URL ********https\://\`bulletin\`.nuist.edu.cn/\`791\`/list.htm
URL ********https://\`bulletin\`.nuist.edu.cn/\`791\`/list.htm
RSS

View File

@ -22,10 +22,10 @@ export const route: Route = {
handler,
description: `| Software | Id |
| --------------- | ----------- |
| O\&O ShutUp10++ | shutup10 |
| O\&O AppBuster | ooappbuster |
| O\&O Lanytix | oolanytix |
| O\&O DeskInfo | oodeskinfo |`,
| O&O ShutUp10++ | shutup10 |
| O&O AppBuster | ooappbuster |
| O&O Lanytix | oolanytix |
| O&O DeskInfo | oodeskinfo |`,
};
async function handler(ctx) {

View File

@ -22,7 +22,7 @@ export const route: Route = {
name: "Thailand Parliament Draft of Law's public hearing system",
maintainers: ['itpcc'],
handler,
description: `| Presented by MP \* | Presented by People \* | Hearing Ongoing | Hearing ended | Hearing result reported | Waiting for PM approval | Assigned into the session | Processed | PM Rejected |
description: `| Presented by MP * | Presented by People * | Hearing Ongoing | Hearing ended | Hearing result reported | Waiting for PM approval | Assigned into the session | Processed | PM Rejected |
| ------------------------ | ---------------------- | ------------------- | --------------- | ------------------------ | ----------------------- | ------------------------- | ---------- | ------------- |
| presentbymp | presentbyperson | openwsu | closewsu | reportwsu | substatus1 | substatus2 | substatus3 | closewsubypm |
| | | | | | | | | |

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import { load } from 'cheerio';
import type { Route } from '@/types';
@ -68,7 +66,7 @@ async function handler(ctx) {
const out = await Promise.all(
list.map(async (info) => {
const title = info.title;
const itemUrl = url.resolve(host, info.link);
const itemUrl = new URL(info.link, host).href;
const cacheIn = await cache.get(itemUrl);
if (cacheIn) {

View File

@ -80,6 +80,8 @@ async function handler(ctx) {
case 'state':
item = utils.statusListParser($);
break;
default:
throw new Error(`Unknown type: ${type}`);
}
const typeToLabel = {

View File

@ -71,9 +71,11 @@ async function handler(ctx) {
const items = data.hits.map((item) => {
const { pageURL, tags, user } = item;
const lastSlashIndex = pageURL.lastIndexOf('/');
const secondLastSlashIndex = pageURL.lastIndexOf('/', lastSlashIndex - 1);
return {
title: pageURL
.substring(pageURL.lastIndexOf('/', pageURL.lastIndexOf('/') - 1) + 1, pageURL.lastIndexOf('/'))
.slice(secondLastSlashIndex + 1, lastSlashIndex)
.replace(/(-\d+)$/, '')
.replaceAll('-', ' '),
description: renderToString(<PixabayImage item={item} />),

View File

@ -26,7 +26,7 @@ export const route: Route = {
handler,
description: `| 热门话题 | 科技动态 | 医疗产业 | 财经快讯 |
| -------- | -------- | -------- | ------------------ |
| | news | medical | financial\_express |`,
| | news | medical | financial_express |`,
};
async function handler(ctx) {

View File

@ -1,5 +1,4 @@
import querystring from 'node:querystring';
import * as url from 'node:url';
import type { Route } from '@/types';
import cache from '@/utils/cache';
@ -34,7 +33,7 @@ const generateArticlePubDate = (createDateStr) => {
const isRedirectPage = (data) => !!data.link;
const resolveRelativeUrl = (html) => html.replaceAll('src="/', `src="${url.resolve(baseUrl, '.')}`).replaceAll('href="/', `href="${url.resolve(baseUrl, '.')}`);
const resolveRelativeUrl = (html) => html.replaceAll('src="/', `src="${new URL('.', baseUrl).href}`).replaceAll('href="/', `href="${new URL('.', baseUrl).href}`);
const apiSuccessAssert = (data) => {
if (!data.success) {

View File

@ -1,5 +1,4 @@
import querystring from 'node:querystring';
import * as url from 'node:url';
import type { Route } from '@/types';
import cache from '@/utils/cache';
@ -44,7 +43,7 @@ const generateArticlePubDate = (createDateStr) => {
const isRedirectPage = (data) => !!data.link;
const resolveRelativeUrl = (html) => html.replaceAll('src="/', `src="${url.resolve(baseUrl, '.')}`).replaceAll('href="/', `href="${url.resolve(baseUrl, '.')}`);
const resolveRelativeUrl = (html) => html.replaceAll('src="/', `src="${new URL('.', baseUrl).href}`).replaceAll('href="/', `href="${new URL('.', baseUrl).href}`);
const apiSuccessAssert = (data) => {
if (!data.success) {

View File

@ -1,5 +1,4 @@
import querystring from 'node:querystring';
import * as url from 'node:url';
import type { Route } from '@/types';
import cache from '@/utils/cache';
@ -41,7 +40,7 @@ const generateArticlePubDate = (createDateStr) => {
const isRedirectPage = (data) => !!data.link;
const resolveRelativeUrl = (html) => html.replaceAll('src="/', `src="${url.resolve(baseUrl, '.')}`).replaceAll('href="/', `href="${url.resolve(baseUrl, '.')}`);
const resolveRelativeUrl = (html) => html.replaceAll('src="/', `src="${new URL('.', baseUrl).href}`).replaceAll('href="/', `href="${new URL('.', baseUrl).href}`);
const apiSuccessAssert = (data) => {
if (!data.success) {

View File

@ -24,7 +24,7 @@ export const route: Route = {
description: `::: tip
[](https://www.sdzk.cn/NewsList.aspx?BCID=1),网址为 \`https://www.sdzk.cn/NewsList.aspx?BCID=1\`。截取 \`BCID=1\` 作为参数,此时路由为 [\`/sdzk/1\`](https://rsshub.app/sdzk/1)。
[](https://www.sdzk.cn/NewsList.aspx?BCID=1\&CID=16),网址为 \`https://www.sdzk.cn/NewsList.aspx?BCID=1&CID=16\`。截取 \`BCID=1\` 与 \`CID=16\` 作为参数,此时路由为 [\`/sdzk/1/16\`](https://rsshub.app/sdzk/1/16)。
[](https://www.sdzk.cn/NewsList.aspx?BCID=1&CID=16),网址为 \`https://www.sdzk.cn/NewsList.aspx?BCID=1&CID=16\`。截取 \`BCID=1\` 与 \`CID=16\` 作为参数,此时路由为 [\`/sdzk/1/16\`](https://rsshub.app/sdzk/1/16)。
:::`,
};

View File

@ -20,7 +20,7 @@ export const route: Route = {
name: 'Software',
maintainers: ['JimenezLi'],
handler,
description: `For some URL like [https://sourceforge.net/directory/artificial-intelligence/windows/](https://sourceforge.net/directory/artificial-intelligence/windows/), it is equal to [https://sourceforge.net/directory/?topic=artificial-intelligence\&os=windows"](https://sourceforge.net/directory/?topic=artificial-intelligence\&os=windows), thus subscribing to \`/sourceforge/topic=artificial-intelligence&os=windows\`.
description: `For some URL like [https://sourceforge.net/directory/artificial-intelligence/windows/](https://sourceforge.net/directory/artificial-intelligence/windows/), it is equal to [https://sourceforge.net/directory/?topic=artificial-intelligence&os=windows"](https://sourceforge.net/directory/?topic=artificial-intelligence&os=windows), thus subscribing to \`/sourceforge/topic=artificial-intelligence&os=windows\`.
URL params can duplicate, such as \`/sourceforge/topic=artificial-intelligence&os=windows&os=linux\`.`,
};

View File

@ -64,7 +64,7 @@ export const route: Route = {
| | | | | | |
| ---- | ----- | ------ | --------------- | ------------------------ | ------- |
| news | china | russia | category\_guoji | russia\_china\_relations | opinion |
| news | china | russia | category_guoji | russia_china_relations | opinion |
Language

View File

@ -95,6 +95,8 @@ async function handler(ctx) {
item_desc = content_data.comment;
item_url = content_data.comment;
break;
default:
throw new Error(`Unknown action key: ${item.key}`);
}
return {

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import { load } from 'cheerio';
import type { Route } from '@/types';
@ -72,7 +70,7 @@ async function handler() {
list.map(async (info) => {
const title = info.title;
const date = info.date;
const itemUrl = url.resolve(host, info.link);
const itemUrl = new URL(info.link, host).href;
const cacheIn = await cache.get(itemUrl);
if (cacheIn) {
return JSON.parse(cacheIn);

View File

@ -1,12 +1,10 @@
import URL from 'node:url';
import { TwitterApi } from 'twitter-api-v2';
import { config } from '@/config';
import { parseDate } from '@/utils/parse-date';
import { fallback, queryToBoolean, queryToInteger } from '@/utils/readable-social';
const getQueryParams = (url) => URL.parse(url, true).query;
const getQueryParams = (url) => Object.fromEntries(new URL(url).searchParams.entries());
const getOriginalImg = (url) => {
// https://greasyfork.org/zh-CN/scripts/2312-resize-image-on-open-image-in-new-tab/code#n150
let m = null;
@ -519,4 +517,10 @@ export const keepOnlyMedia = function (tweets) {
return excluded;
};
export default { ProcessFeed, getAppClient, parseRouteParams, excludeRetweet, keepOnlyMedia };
export default {
ProcessFeed,
getAppClient,
parseRouteParams,
excludeRetweet,
keepOnlyMedia,
};

View File

@ -42,7 +42,7 @@ export const route: Route = {
handler,
description: `| 个股研报 | 行业研报 | 策略研报 | 宏观研报 | 新股研报 | 券商晨报(今日晨报) |
| :-------------: | :----------------: | :----------------: | :-------------: | :-----------: | :------------------: |
| stock\_research | industry\_research | strategy\_research | macro\_research | ipo\_research | brokerage\_news |`,
| stock_research | industry_research | strategy_research | macro_research | ipo_research | brokerage_news |`,
};
async function handler(ctx) {

View File

@ -56,6 +56,8 @@ async function handler(ctx) {
return 'get';
case 'Doublechoice':
return 'post';
default:
throw new Error(`Unknown category: ${category}`);
}
})(),
@ -69,6 +71,8 @@ async function handler(ctx) {
return `${apiRootUrl}/API/Web/index10358.ashx?rd=${rand}&pagesize=20&pageindex=1&action=bookinglist2&kind=2`;
case 'joblist2':
return `${apiRootUrl}/API/Web/index10358.ashx?action=joblist2&pagesize=50&pageindex=1&rand=${rand}&keyword=`;
default:
throw new Error(`Unknown category: ${category}`);
}
})(),
@ -85,6 +89,8 @@ async function handler(ctx) {
action: 'recruitlist',
rand,
};
default:
throw new Error(`Unknown category: ${category}`);
}
})(),
@ -135,6 +141,8 @@ async function handler(ctx) {
return 'get';
case 'Doublechoice':
return 'post';
default:
throw new Error(`Unknown category: ${category}`);
}
})(),
@ -148,6 +156,8 @@ async function handler(ctx) {
return `${apiRootUrl}/API/Web/index10358.ashx?rd=${rand}&action=binfo&rid=${item.title}&rand=${rand}`;
case 'joblist2':
return `${apiRootUrl}/API/Web/index10358.ashx?rd=${rand}&action=jobinfo2&jid=${item.title}&rand=${rand}`;
default:
throw new Error(`Unknown category: ${category}`);
}
})(),
@ -165,6 +175,8 @@ async function handler(ctx) {
rid: item.ID,
rand,
};
default:
throw new Error(`Unknown category: ${category}`);
}
})(),
@ -180,6 +192,8 @@ async function handler(ctx) {
return item.title;
case 'joblist2':
return detailResponse.data.JobName;
default:
throw new Error(`Unknown category: ${category}`);
}
})();
@ -207,6 +221,8 @@ async function handler(ctx) {
case 'joblist2':
return detailResponse.data.PostionDesc;
default:
throw new Error(`Unknown category: ${category}`);
}
})();

View File

@ -50,6 +50,8 @@ async function handler(ctx) {
feedTitle += 'In The News';
listSelector += 'div.news-wrapper > section.news-list > article';
break;
default:
throw new Error(`Unknown category: ${category}`);
}
const response = await got(newsURL);

View File

@ -32,7 +32,7 @@ export const route: Route = {
description: `::: tip
Subscribe pages starting with \`https://wallhaven.cc/search\`, fill the text after \`?\` as \`filter\` in the route. The following is an example:
The text after \`?\` is \`q=id%3A711&sorting=random&ref=fp&seed=8g0dgd\` for [Wallpaper Search: #landscape - wallhaven.cc](https://wallhaven.cc/search?q=id%3A711\&sorting=random\&ref=fp\&seed=8g0dgd), so the route is [/wallhaven/q=id%3A711\&sorting=random\&ref=fp\&seed=8g0dgd](https://rsshub.app/wallhaven/q=id%3A711\&sorting=random\&ref=fp\&seed=8g0dgd)
The text after \`?\` is \`q=id%3A711&sorting=random&ref=fp&seed=8g0dgd\` for [Wallpaper Search: #landscape - wallhaven.cc](https://wallhaven.cc/search?q=id%3A711&sorting=random&ref=fp&seed=8g0dgd), so the route is [/wallhaven/q=id%3A711&sorting=random&ref=fp&seed=8g0dgd](https://rsshub.app/wallhaven/q=id%3A711&sorting=random&ref=fp&seed=8g0dgd)
:::`,
};

View File

@ -23,7 +23,7 @@ export const route: Route = {
handler,
description: `只适用拥有首页模板 (分享链接带有 homepage) 的公众号。例如从公众号分享出来的链接为 \`https://mp.weixin.qq.com/mp/homepage?__biz=MzA3MDM3NjE5NQ==&hid=4\`\`biz\`\`MzA3MDM3NjE5NQ==\`\`hid\`\`4\`
\`cid\` 可以通过元素选择器选中栏目查看\`data-index\`。如[链接](https://mp.weixin.qq.com/mp/homepage?__biz=MzA3MDM3NjE5NQ==\&hid=4)里的 \`京都职人\` 栏目的 \`cid\`\`0\`\`文艺时光\` 栏目的 \`cid\`\`2\`。如果不清楚的话最左边的栏目为\`0\`,其右方栏目依次递增 \`1\``,
\`cid\` 可以通过元素选择器选中栏目查看\`data-index\`。如[链接](https://mp.weixin.qq.com/mp/homepage?__biz=MzA3MDM3NjE5NQ==&hid=4)里的 \`京都职人\` 栏目的 \`cid\`\`0\`\`文艺时光\` 栏目的 \`cid\`\`2\`。如果不清楚的话最左边的栏目为\`0\`,其右方栏目依次递增 \`1\``,
};
async function handler(ctx) {

View File

@ -39,7 +39,7 @@ export const namespace: Namespace = {
RSS
[https://rsshub.app/weibo/user/1642909335/readable=1\&authorNameBold=1\&showAuthorInTitle=1\&showAuthorInDesc=1\&showAuthorAvatarInDesc=1\&showEmojiForRetweet=1\&showRetweetTextInTitle=0\&addLinkForPics=1\&showTimestampInDescription=1\&showTimestampInDescription=1\&heightOfPics=150](https://rsshub.app/weibo/user/1642909335/readable=1\&authorNameBold=1\&showAuthorInTitle=1\&showAuthorInDesc=1\&showAuthorAvatarInDesc=1\&showEmojiForRetweet=1\&showRetweetTextInTitle=0\&addLinkForPics=1\&showTimestampInDescription=1\&showTimestampInDescription=1\&heightOfPics=150)
[https://rsshub.app/weibo/user/1642909335/readable=1&authorNameBold=1&showAuthorInTitle=1&showAuthorInDesc=1&showAuthorAvatarInDesc=1&showEmojiForRetweet=1&showRetweetTextInTitle=0&addLinkForPics=1&showTimestampInDescription=1&showTimestampInDescription=1&heightOfPics=150](https://rsshub.app/weibo/user/1642909335/readable=1&authorNameBold=1&showAuthorInTitle=1&showAuthorInDesc=1&showAuthorAvatarInDesc=1&showEmojiForRetweet=1&showRetweetTextInTitle=0&addLinkForPics=1&showTimestampInDescription=1&showTimestampInDescription=1&heightOfPics=150)

View File

@ -40,8 +40,8 @@ export const route: Route = {
| soul | |
| video | |
| album | |
| hot\_sort | |
| sort\_time | |
| hot_sort | |
| sort_time | |
| feed | |`,
};

View File

@ -27,7 +27,7 @@ export const route: Route = {
name: 'News',
maintainers: ['oppilate'],
handler,
description: `en\_us
description: `en_us
| World | U.S. | Politics | Economy | Business | Tech | Markets | Opinion | Books & Arts | Real Estate | Life & Work | Sytle | Sports |
| ----- | ---- | -------- | ------- | -------- | ---------- | ------- | ------- | ------------ | ----------- | ----------- | ------------------- | ------ |

View File

@ -1,5 +1,3 @@
import * as url from 'node:url';
import { load } from 'cheerio';
import type { Route } from '@/types';
@ -73,7 +71,7 @@ async function handler(ctx) {
const out = await Promise.all(
urlList.map(async (itemUrl, index) => {
itemUrl = url.resolve(baseUrl, itemUrl);
itemUrl = new URL(itemUrl, baseUrl).href;
if (itemUrl.includes('.htm')) {
const cacheIn = await cache.get(itemUrl);
if (cacheIn) {

View File

@ -1,5 +1,3 @@
import { URL } from 'node:url';
import { load } from 'cheerio';
import type { Route } from '@/types';

View File

@ -42,7 +42,7 @@ export const route: Route = {
| books | |
| loushi | |
| automobile | |
| china\_financial\_herald | |
| china_financial_herald | |
| fashion | |
| ad | |
| info | |

View File

@ -2,7 +2,7 @@ function parseJSONP(jsonpData) {
try {
const startPos = jsonpData.indexOf('({');
const endPos = jsonpData.lastIndexOf('})');
let jsonString = jsonpData.substring(startPos + 1, endPos + 1);
let jsonString = jsonpData.slice(startPos + 1, endPos + 1);
// remove escaped single quotes since they are not valid json
jsonString = jsonString.replaceAll(String.raw`\'`, "'");

View File

@ -30,7 +30,7 @@ export const route: Route = {
:::
::: tip
YouTube provides official RSS feeds for channels, for instance [https://www.youtube.com/feeds/videos.xml?channel\_id=UCDwDMPOZfxVV0x\_dz0eQ8KQ](https://www.youtube.com/feeds/videos.xml?channel_id=UCDwDMPOZfxVV0x_dz0eQ8KQ).
YouTube provides official RSS feeds for channels, for instance [https://www.youtube.com/feeds/videos.xml?channel_id=UCDwDMPOZfxVV0x_dz0eQ8KQ](https://www.youtube.com/feeds/videos.xml?channel_id=UCDwDMPOZfxVV0x_dz0eQ8KQ).
:::`,
features: {
requireConfig: [

View File

@ -39,7 +39,7 @@ export const route: Route = {
url: 'yxdzqb.com/',
description: `| Steam 最新折扣 | Steam 热门游戏折扣 | Steam 热门中文游戏折扣 | Steam 历史低价 | Steam 中文游戏历史低价 |
| -------------- | ------------------ | ---------------------- | -------------- | ---------------------- |
| discount | popular | popular\_cn | low | low\_cn |`,
| discount | popular | popular_cn | low | low_cn |`,
};
async function handler(ctx) {

View File

@ -42,7 +42,7 @@ export const route: Route = {
handler,
description: `| 全部 | 影视资讯 | 收视快报 | 人人影评 | 人人剧评 | 新剧评测 | 片单推荐 |
| ---- | -------- | -------- | --------- | --------- | ----------- | -------- |
| | news | report | m\_review | t\_review | new\_review | recom |`,
| | news | report | m_review | t_review | new_review | recom |`,
};
async function handler(ctx) {