hash
stringlengths
40
40
date
stringdate
2018-04-19 20:42:56
2025-03-25 18:01:26
author
stringlengths
1
23
commit_message
stringlengths
9
121
is_merge
bool
1 class
masked_commit_message
stringlengths
3
111
type
stringclasses
10 values
git_diff
stringlengths
108
2.8M
d9e2bcd4d9f1f96e8284a5d28ac5d13c10197795
2019-06-11 08:58:17
Henry Wang
feat: add Metacritic game releases (#2366)
false
add Metacritic game releases (#2366)
feat
diff --git a/docs/en/README.md b/docs/en/README.md index 1e3615f087280b..2b5475916ec7a5 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -343,6 +343,32 @@ Compatible with lists with an URL like <https://store.playstation.com/zh-hans-hk </RouteEn> +## Metacritic + +### Game Releases + +<RouteEn author="HenryQW" example="/metacritic/release/switch/coming" path="/metacritic/release/:platform/:type?/:sort?" :paramsDesc="['console platform', 'release type, default to `new`', 'sorting type, default to `date`']"> + +Platforms supported: + +| PS 4 | Xbox One | Switch | PC | Wii U | 3DS | PS Vita | iOS | +| ---- | -------- | ------ | --- | ----- | --- | ------- | --- | +| ps4 | xboxone | switch | pc | wii-u | 3ds | vita | ios | + +Release types, default to `new`: + +| New | Coming Soon | All | +| --- | ----------- | --- | +| new | coming | all | + +Sorting types, default to `date`: + +| Date | Metacritic Score | User Score | +| ---- | ---------------- | ---------- | +| date | metascore | userscore | + +</RouteEn> + ## ACG ### Vol.moe diff --git a/docs/game.md b/docs/game.md index e7b5e4f35b6284..8f01cb01a43ff8 100644 --- a/docs/game.md +++ b/docs/game.md @@ -44,6 +44,32 @@ pageClass: routes <Route author="dearrrfish" example="/maxnews/dota2" path="maxnews/dota2" /> +## Metacritic + +### 新游发行 + +<Route author="HenryQW" example="/metacritic/release/switch/coming" path="/metacritic/release/:platform/:type?/:sort?" :paramsDesc="['主机平台', '发行类型,默认为 `new`', '排序类型,默认为`date`']"> + +支持的主机平台: + +| PS 4 | Xbox One | Switch | PC | Wii U | 3DS | PS Vita | iOS | +| ---- | -------- | ------ | --- | ----- | --- | ------- | --- | +| ps4 | xboxone | switch | pc | wii-u | 3ds | vita | ios | + +发行类型,默认为 `new`: + +| 新游发行 | 即将发行 | 全部 | +| -------- | -------- | ---- | +| new | coming | all | + +排序类型,默认为`date`: + +| 日期 | Metacritic 评分 | 用户评分 | +| ---- | --------------- | --------- | +| date | metascore | userscore | + +</Route> + ## Nintendo ### eShop 新发售游戏 diff --git a/lib/router.js b/lib/router.js index e86b19739b01e7..46055a1678f6dc 100644 --- a/lib/router.js +++ b/lib/router.js @@ -319,9 +319,6 @@ router.get('/tingshuitz/xian', require('./routes/tingshuitz/xian')); router.get('/tingshuitz/yangjiang', require('./routes/tingshuitz/yangjiang')); router.get('/tingshuitz/nanjing', require('./routes/tingshuitz/nanjing')); -// MIUI 更新 -router.get('/miui/:device/:type?/:region?', require('./routes/miui/index')); - // 米哈游 router.get('/mihoyo/bh3/:type', require('./routes/mihoyo/bh3')); router.get('/mihoyo/bh2/:type', require('./routes/mihoyo/bh2')); @@ -368,6 +365,8 @@ router.get('/hexo/yilia/:url', require('./routes/hexo/yilia')); router.get('/mi/crowdfunding', require('./routes/mi/crowdfunding')); router.get('/mi/youpin/crowdfunding', require('./routes/mi/youpin/crowdfunding')); router.get('/mi/youpin/new', require('./routes/mi/youpin/new')); +// MIUI 更新 +router.get('/miui/:device/:type?/:region?', require('./routes/mi/miui/index')); // Keep router.get('/keep/user/:id', require('./routes/keep/user')); @@ -953,6 +952,9 @@ router.get('/huxiu/author/:id', require('./routes/huxiu/author')); router.get('/steam/search/:params', require('./routes/steam/search')); router.get('/steam/news/:appids', require('./routes/steam/news')); +// Steamgifts +router.get('/steamgifts/discussions/:category?', require('./routes/steam/steamgifts/discussions')); + // 扇贝 router.get('/shanbay/checkin/:id', require('./routes/shanbay/checkin')); @@ -1351,16 +1353,13 @@ router.get('/digitaling/projects/:category', require('./routes/digitaling/projec // Bing壁纸 router.get('/bing', require('./routes/bing/index')); -// MaxNews - DotA 2 +// Maxjia News - DotA 2 router.get('/maxnews/dota2', require('./routes/maxnews/dota2')); // 柠檬 - 私房歌 router.get('/ningmeng/song', require('./routes/ningmeng/song')); -// Steamgifts -router.get('/steamgifts/discussions/:category?', require('./routes/steamgifts/discussions')); - -// Steamgifts +// 紫竹张 router.get('/zzz', require('./routes/zzz/index')); // AlgoCasts @@ -1398,4 +1397,7 @@ router.get('/polimi/news/:language?', require('./routes/polimi/news')); // 东方网-上海 router.get('/eastday/sh', require('./routes/eastday/sh')); +// Metacritic +router.get('/metacritic/release/:platform/:type/:sort?', require('./routes/metacritic/release')); + module.exports = router; diff --git a/lib/routes/metacritic/release.js b/lib/routes/metacritic/release.js new file mode 100644 index 00000000000000..f9aeba8661e469 --- /dev/null +++ b/lib/routes/metacritic/release.js @@ -0,0 +1,54 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + let type = 'new-releases'; + let title = 'New Releases'; + + const sort = ctx.params.sort || 'date'; + + switch (ctx.params.type) { + case 'coming': + type = 'coming-soon'; + title = 'Coming Soon'; + break; + case 'all': + type = 'available'; + title = 'All Releases'; + break; + } + + const url = `https://www.metacritic.com/browse/games/release-date/${type}/${ctx.params.platform}/${sort}`; + + const response = await got({ + method: 'get', + url, + }); + const data = response.body; + + const $ = cheerio.load(data); + const list = $('.list_products > li') + .get() + .slice(0, 10); + + const result = list.map((item) => { + const $ = cheerio.load(item); + return { + title: $('.product_title').text(), + url: 'https://www.metacritic.com' + $('.product_title > a').attr('href'), + metascore: $('.brief_metascore').text(), + userscore: $('.textscore').text(), + date: $('.release_date > .data').text(), + }; + }); + + ctx.state.data = { + title: `Metacritic ${ctx.params.platform} ${title}`, + link: url, + item: result.map((item) => ({ + title: `${item.metascore === 'tbd' ? '' : [item.metascore]} ${item.title}`, + description: `Release Date: ${item.date} <br> Metacritic Score: ${item.metascore} <br> User Score: ${item.userscore} <br>`, + link: item.url, + })), + }; +}; diff --git a/lib/routes/miui/index.js b/lib/routes/mi/miui/index.js similarity index 100% rename from lib/routes/miui/index.js rename to lib/routes/mi/miui/index.js diff --git a/lib/routes/steamgifts/discussions.js b/lib/routes/steam/steamgifts/discussions.js similarity index 100% rename from lib/routes/steamgifts/discussions.js rename to lib/routes/steam/steamgifts/discussions.js
e930552ddf1ae5fac3965e96c0d617568a992498
2024-04-03 07:41:10
dependabot[bot]
chore(deps): bump hono from 4.1.7 to 4.2.0 (#15067)
false
bump hono from 4.1.7 to 4.2.0 (#15067)
chore
diff --git a/package.json b/package.json index 20e411c3f739d9..17a08ccf2ad42c 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "fanfou-sdk": "5.0.0", "form-data": "4.0.0", "googleapis": "134.0.0", - "hono": "4.1.7", + "hono": "4.2.0", "html-to-text": "9.0.5", "https-proxy-agent": "7.0.4", "iconv-lite": "0.6.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69ae48a6768fed..2bf9c6914c0cb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,10 +10,10 @@ dependencies: version: 1.9.1 '@hono/swagger-ui': specifier: 0.2.1 - version: 0.2.1([email protected]) + version: 0.2.1([email protected]) '@hono/zod-openapi': specifier: 0.9.10 - version: 0.9.10([email protected])([email protected]) + version: 0.9.10([email protected])([email protected]) '@notionhq/client': specifier: 2.2.14 version: 2.2.14 @@ -81,8 +81,8 @@ dependencies: specifier: 134.0.0 version: 134.0.0 hono: - specifier: 4.1.7 - version: 4.1.7 + specifier: 4.2.0 + version: 4.2.0 html-to-text: specifier: 9.0.5 version: 9.0.5 @@ -1908,15 +1908,15 @@ packages: engines: {node: '>=18.14.1'} dev: false - /@hono/[email protected]([email protected]): + /@hono/[email protected]([email protected]): resolution: {integrity: sha512-wBxVMRe3/v8xH4o6icmwztiIq0DG0s7+jHVMHVUAoFFCWEQNL2iskMmQtrhSDtsFmBZUeUFQUaaJ6Ir6DOmHLA==} peerDependencies: hono: '*' dependencies: - hono: 4.1.7 + hono: 4.2.0 dev: false - /@hono/[email protected]([email protected])([email protected]): + /@hono/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-v/b/z0qPxDo952gjRyhJ0n9ifbPoIluR2KmXDL20np0hj99+XvakoIHK5/T/3+hUmXlTj1Kn3TiGsSV6hwZesg==} engines: {node: '>=16.0.0'} peerDependencies: @@ -1924,18 +1924,18 @@ packages: zod: 3.* dependencies: '@asteasolutions/zod-to-openapi': 5.5.0([email protected]) - '@hono/zod-validator': 0.2.1([email protected])([email protected]) - hono: 4.1.7 + '@hono/zod-validator': 0.2.1([email protected])([email protected]) + hono: 4.2.0 zod: 3.22.4 dev: false - /@hono/[email protected]([email protected])([email protected]): + /@hono/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-HFoxln7Q6JsE64qz2WBS28SD33UB2alp3aRKmcWnNLDzEL1BLsWfbdX6e1HIiUprHYTIXf5y7ax8eYidKUwyaA==} peerDependencies: hono: '>=3.9.0' zod: ^3.19.1 dependencies: - hono: 4.1.7 + hono: 4.2.0 zod: 3.22.4 dev: false @@ -5531,8 +5531,8 @@ packages: resolution: {integrity: sha512-4FP6J0oI8jqb6gLLl9tSwVdosWJ/AKSGJ+HwYf6Ixe4MUcEkst4uWzpVQrNOCin0fzTRQbXV8ePheU8WiiDYBw==} dev: false - /[email protected]: - resolution: {integrity: sha512-Qa9/OM64d3we/COpxpJNT8p2IEvXbvRzp2eX4wf48eDvqoU3pBrnbY6zAF2rK878GxkkfCo6yipZXNsPiTrBMQ==} + /[email protected]: + resolution: {integrity: sha512-4A9WSwQW1V1Bby07Ida1FZwvYceSkByd8uoxvcmYSPaEWIZqutn/s5jE3CJOci8Jt//vb9VDn+5B3xobIzvA6A==} engines: {node: '>=16.0.0'} dev: false
59316c09f21f7e17437f37e9a7303cd1b254743b
2018-11-21 21:43:56
DIYgod
rss: add pixiv search
false
add pixiv search
rss
diff --git a/docs/README.md b/docs/README.md index 596ab2edfac414..a150073c0d2714 100644 --- a/docs/README.md +++ b/docs/README.md @@ -445,6 +445,8 @@ RSSHub 提供下列 API 接口: </route> +<route name="关键词" author="DIYgod" example="/pixiv/search/麻衣/popular" path="/pixiv/search/:keyword/:order?" :paramsDesc="['关键词', '排序方式,popular 按热门度排序,空或其他任意值按时间排序']"/> + ### 豆瓣 <route name="正在上映的电影" author="DIYgod" example="/douban/movie/playing" path="/douban/movie/playing"/> diff --git a/router.js b/router.js index 0c7172dac96478..dd74fb7e2b9391 100644 --- a/router.js +++ b/router.js @@ -184,6 +184,7 @@ if (config.pixiv && config.pixiv.client_id && config.pixiv.client_secret && conf router.get('/pixiv/user/bookmarks/:id', require('./routes/pixiv/bookmarks')); router.get('/pixiv/user/:id/', require('./routes/pixiv/user')); router.get('/pixiv/ranking/:mode/:date?', require('./routes/pixiv/ranking')); + router.get('/pixiv/search/:keyword/:order?', require('./routes/pixiv/search')); } else { logger.warn('pixiv RSS is disabled for lacking config.'); } diff --git a/routes/pixiv/api/searchIllust.js b/routes/pixiv/api/searchIllust.js new file mode 100644 index 00000000000000..b55b0824584f83 --- /dev/null +++ b/routes/pixiv/api/searchIllust.js @@ -0,0 +1,25 @@ +const axios = require('../../../utils/axios'); +const maskHeader = require('../constants').maskHeader; + +/** + * 按时间排序搜索内容 + * @param {string} keyword 关键词 + * @param {string} token pixiv oauth token + * @returns {Promise<axios.AxiosResponse<{illusts: illust[]}>>} + */ +module.exports = async function searchIllust(keyword, token) { + return await axios({ + method: 'get', + url: 'https://app-api.pixiv.net/v1/search/illust', + headers: { + ...maskHeader, + Authorization: 'Bearer ' + token, + }, + params: { + word: keyword, + search_target: 'partial_match_for_tags', + sort: 'date_desc', + filter: 'for_ios', + }, + }); +}; diff --git a/routes/pixiv/api/searchPopularIllust.js b/routes/pixiv/api/searchPopularIllust.js new file mode 100644 index 00000000000000..af952f61992056 --- /dev/null +++ b/routes/pixiv/api/searchPopularIllust.js @@ -0,0 +1,24 @@ +const axios = require('../../../utils/axios'); +const maskHeader = require('../constants').maskHeader; + +/** + * 按热门排序搜索内容 + * @param {string} keyword 关键词 + * @param {string} token pixiv oauth token + * @returns {Promise<axios.AxiosResponse<{illusts: illust[]}>>} + */ +module.exports = async function searchPopularIllust(keyword, token) { + return await axios({ + method: 'get', + url: 'https://app-api.pixiv.net/v1/search/popular-preview/illust', + headers: { + ...maskHeader, + Authorization: 'Bearer ' + token, + }, + params: { + word: keyword, + search_target: 'partial_match_for_tags', + filter: 'for_ios', + }, + }); +}; diff --git a/routes/pixiv/search.js b/routes/pixiv/search.js new file mode 100644 index 00000000000000..1e123446db9d31 --- /dev/null +++ b/routes/pixiv/search.js @@ -0,0 +1,44 @@ +const getToken = require('./token'); +const searchPopularIllust = require('./api/searchPopularIllust'); +const searchIllust = require('./api/searchIllust'); + +module.exports = async (ctx) => { + const keyword = ctx.params.keyword; + const order = ctx.params.order || 'date'; + + if (!getToken()) { + throw 'pixiv not login'; + } + + let response; + if (order === 'popular') { + response = await searchPopularIllust(keyword, getToken()); + } else { + response = await searchIllust(keyword, getToken()); + } + + const illusts = response.data.illusts; + const username = illusts[0].user.name; + + ctx.state.data = { + title: `${keyword} 的 pixiv ${order === 'popular' ? '热门' : ''}内容`, + link: `https://www.pixiv.net/search.php?word=${keyword}`, + item: illusts.map((illust) => { + const images = []; + if (illust.page_count === 1) { + images.push(`<p><img referrerpolicy="no-referrer" src="https://pixiv.cat/${illust.id}.jpg"/></p>`); + } else { + for (let i = 0; i < illust.page_count; i++) { + images.push(`<p><img referrerpolicy="no-referrer" src="https://pixiv.cat/${illust.id}-${i + 1}.jpg"/></p>`); + } + } + return { + title: illust.title, + author: username, + pubDate: new Date(illust.create_date).toUTCString(), + description: `<p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p>${images.join('')}`, + link: `https://www.pixiv.net/member_illust.php?mode=medium&illust_id=${illust.id}`, + }; + }), + }; +};
36eb48d7302b1cb31abd598e9a0489146309456d
2020-11-19 15:43:23
DIYgod
docs: recover instagram radar
false
recover instagram radar
docs
diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 43c761d358e450..58b7eb54bfc950 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2377,4 +2377,19 @@ }, ], }, + 'instagram.com': { + _name: 'Instagram', + www: [ + { + title: '用户', + docs: 'https://docs.rsshub.app/social-media.html#instagram', + source: '/:id', + target: (params) => { + if (params.id !== 'explore' && params.id !== 'developer') { + return '/instagram/user/:id'; + } + }, + }, + ], + }, }); diff --git a/docs/en/social-media.md b/docs/en/social-media.md index 5040c305b7259c..fe64739a3415f7 100644 --- a/docs/en/social-media.md +++ b/docs/en/social-media.md @@ -46,7 +46,7 @@ If you don't want to setup credentials, use Picuki. ### User Profile -<RouteEn author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['Feed category. Only user category is supported for now.','Key for such category. E.g. username/ID for user feed']"/> +<RouteEn author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['Feed category. Only user category is supported for now.','Key for such category. E.g. username/ID for user feed']" radar="1"/> ## Lofter diff --git a/docs/social-media.md b/docs/social-media.md index 292757bc707f75..efbc3f9a30bfbe 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -338,7 +338,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 ### 用户 -<Route author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['时间线类别,目前仅支持用户时间线','针对该类别的索引,例如用户时间线里是用户名或用户 ID']"/> +<Route author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['时间线类别,目前仅支持用户时间线','针对该类别的索引,例如用户时间线里是用户名或用户 ID']" radar="1"/> ## Keep
fcc52173b30881c9ccd1072e2944dfa6d28421f6
2024-12-30 13:35:23
dependabot[bot]
chore(deps): bump hono from 4.6.14 to 4.6.15 (#18006)
false
bump hono from 4.6.14 to 4.6.15 (#18006)
chore
diff --git a/package.json b/package.json index 2e6818febdc132..1d379eec30b678 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "fanfou-sdk": "5.0.0", "form-data": "4.0.1", "googleapis": "144.0.0", - "hono": "4.6.14", + "hono": "4.6.15", "html-to-text": "9.0.5", "http-cookie-agent": "6.0.8", "https-proxy-agent": "7.0.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dca75811baaab5..019a66dfed409f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,10 +23,10 @@ importers: version: 4.2.0 '@hono/node-server': specifier: 1.13.7 - version: 1.13.7([email protected]) + version: 1.13.7([email protected]) '@hono/zod-openapi': specifier: 0.18.3 - version: 0.18.3([email protected])([email protected]) + version: 0.18.3([email protected])([email protected]) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -59,7 +59,7 @@ importers: version: 0.0.23 '@scalar/hono-api-reference': specifier: 0.5.165 - version: 0.5.165([email protected]) + version: 0.5.165([email protected]) '@sentry/node': specifier: 7.119.1 version: 7.119.1 @@ -118,8 +118,8 @@ importers: specifier: 144.0.0 version: 144.0.0 hono: - specifier: 4.6.14 - version: 4.6.14 + specifier: 4.6.15 + version: 4.6.15 html-to-text: specifier: 9.0.5 version: 9.0.5 @@ -3414,8 +3414,8 @@ packages: [email protected]: resolution: {integrity: sha512-4FP6J0oI8jqb6gLLl9tSwVdosWJ/AKSGJ+HwYf6Ixe4MUcEkst4uWzpVQrNOCin0fzTRQbXV8ePheU8WiiDYBw==} - [email protected]: - resolution: {integrity: sha512-j4VkyUp2xazGJ8eCCLN1Vm/bxdvm/j5ZuU9AIjLu9vapn2M44p9L3Ktr9Vnb2RN2QtcR/wVjZVMlT5k7GJQgPw==} + [email protected]: + resolution: {integrity: sha512-OiQwvAOAaI2JrABBH69z5rsctHDzFzIKJge0nYXgtzGJ0KftwLWcBXm1upJC23/omNRtnqM0gjRMbtXshPdqhQ==} engines: {node: '>=16.9.0'} [email protected]: @@ -6702,20 +6702,20 @@ snapshots: dependencies: levn: 0.4.1 - '@hono/[email protected]([email protected])': + '@hono/[email protected]([email protected])': dependencies: - hono: 4.6.14 + hono: 4.6.15 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: '@asteasolutions/zod-to-openapi': 7.2.0([email protected]) - '@hono/zod-validator': 0.4.1([email protected])([email protected]) - hono: 4.6.14 + '@hono/zod-validator': 0.4.1([email protected])([email protected]) + hono: 4.6.15 zod: 3.24.1 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: - hono: 4.6.14 + hono: 4.6.15 zod: 3.24.1 '@humanfs/[email protected]': {} @@ -7139,10 +7139,10 @@ snapshots: '@rss3/api-core': 0.0.23 '@rss3/api-utils': 0.0.23 - '@scalar/[email protected]([email protected])': + '@scalar/[email protected]([email protected])': dependencies: '@scalar/types': 0.0.25 - hono: 4.6.14 + hono: 4.6.15 '@scalar/[email protected]': {} @@ -9048,7 +9048,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: {}
8862d3c3571e5f0e3b049051d558f2b1de553e16
2023-02-07 03:18:49
dependabot[bot]
chore(deps-dev): bump meilisearch from 0.30.0 to 0.31.1 (#11794)
false
bump meilisearch from 0.30.0 to 0.31.1 (#11794)
chore
diff --git a/package.json b/package.json index cd647d7a75f3c5..1497f74917f228 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "fs-extra": "11.1.0", "jest": "29.4.1", "jest-junit": "15.0.0", - "meilisearch": "0.30.0", + "meilisearch": "0.31.1", "mockdate": "3.0.5", "nock": "13.3.0", "nodemon": "2.0.20", diff --git a/yarn.lock b/yarn.lock index 7a2c7d37755871..d6472d4736e249 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9525,7 +9525,14 @@ [email protected]: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== [email protected], meilisearch@^0.30.0: [email protected]: + version "0.31.1" + resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.31.1.tgz#c526274c3cda844e8ee8d9562cbd3febbe1b9508" + integrity sha512-ajMieU0e25lLkT+05J0snX0Ycow1UofxIy5sag03flERUbjXq8ouVwkrJkW27JsKftIeDeffRRRr89LasU9+0w== + dependencies: + cross-fetch "^3.1.5" + +meilisearch@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.30.0.tgz#707f9a6b07440c496b965379616e084f112160ae" integrity sha512-3y1hALOwTDpquYar+gDREqRasFPWKxkWAhk6h+RF+nKObPVf9N77wcTNvukGwOKbxRyJnKge0OPgAB1BkB9VVw==
3d907e5a09e11a7d161282e7fa4ca32318c0e102
2020-02-05 19:36:35
dependabot-preview[bot]
chore(deps): bump puppeteer from 2.1.0 to 2.1.1
false
bump puppeteer from 2.1.0 to 2.1.1
chore
diff --git a/package.json b/package.json index 1a4c4264bb78f8..a7550ea89462d2 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "module-alias": "2.2.2", "pidusage": "2.0.17", "plist": "3.0.1", - "puppeteer": "2.1.0", + "puppeteer": "2.1.1", "query-string": "6.10.1", "redis": "2.8.0", "require-all": "3.0.0", diff --git a/yarn.lock b/yarn.lock index eb70d1390f069a..63b1b00fc1f0b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7831,12 +7831,7 @@ [email protected], mime@^1.3.4, mime@^1.4.1: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.0.3, mime@^2.4.2: - version "2.4.3" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.3.tgz#229687331e86f68924e6cb59e1cdd937f18275fe" - integrity sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw== - -mime@^2.2.0: +mime@^2.0.3, mime@^2.2.0, mime@^2.4.2: version "2.4.4" resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== @@ -9551,10 +9546,10 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== [email protected]: - version "2.1.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-2.1.0.tgz#c10cabc5525f57c6766eed4f3006b6e10afcafc1" - integrity sha512-PC4oKMtwAElo8YtS/cYnk2/dew/3TonsGKKzjpFLWwkhBCteFsOZCVOXTt2QlP6w53mH0YsJE+fPLPzOW+DCug== [email protected]: + version "2.1.1" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-2.1.1.tgz#ccde47c2a688f131883b50f2d697bd25189da27e" + integrity sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg== dependencies: "@types/mime-types" "^2.1.0" debug "^4.1.0"
54ac3a22edea650ca5793c32ef6d92cf61ca207a
2019-01-20 19:23:57
renovate[bot]
chore(deps): update dependency eslint to v5.12.1 (#1434)
false
update dependency eslint to v5.12.1 (#1434)
chore
diff --git a/package.json b/package.json index 4999604c99de45..d276839e20334e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/DIYgod/RSSHub#readme", "devDependencies": { - "eslint": "5.12.0", + "eslint": "5.12.1", "eslint-config-prettier": "3.5.0", "eslint-plugin-prettier": "3.0.1", "jest": "23.6.0", diff --git a/yarn.lock b/yarn.lock index 8470af07d08359..2a59e08b997fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3409,10 +3409,10 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== [email protected]: - version "5.12.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.0.tgz#fab3b908f60c52671fb14e996a450b96c743c859" - integrity sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g== [email protected]: + version "5.12.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.1.tgz#5ca9931fb9029d04e7be92b03ce3b58edfac7e3b" + integrity sha512-54NV+JkTpTu0d8+UYSA8mMKAG4XAsaOrozA9rCW7tgneg1mevcL7wIotPC+fZ0SkWwdhNqoXoxnQCTBp7UvTsg== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.5.3"
9ec5d8f72eac23ea60d24553aec89a301457e59f
2022-12-16 17:44:52
Devin
fix: Use puppeteer for picuki (#11458)
false
Use puppeteer for picuki (#11458)
fix
diff --git a/lib/v2/picuki/maintainer.js b/lib/v2/picuki/maintainer.js index 116545d5aef5aa..02a60ac26d8dfa 100644 --- a/lib/v2/picuki/maintainer.js +++ b/lib/v2/picuki/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/profile/:id/:functionalFlag?': ['hoilc', 'Rongronggg9'], + '/profile/:id/:functionalFlag?': ['hoilc', 'Rongronggg9', 'devinmugen'], }; diff --git a/lib/v2/picuki/profile.js b/lib/v2/picuki/profile.js index 269f9cbc323d26..ef3da4cfa7892a 100644 --- a/lib/v2/picuki/profile.js +++ b/lib/v2/picuki/profile.js @@ -4,8 +4,13 @@ const chrono = require('chrono-node'); const { art } = require('@/utils/render'); const path = require('path'); const config = require('@/config').value; +const { puppeteerGet } = require('./utils'); + module.exports = async (ctx) => { + // use Puppeteer due to the obstacle by cloudflare challenge + const browser = await require('@/utils/puppeteer')(); + const id = ctx.params.id; const displayVideo = ctx.params.functionalFlag !== '0'; const includeStories = ctx.params.functionalFlag === '10'; @@ -15,8 +20,8 @@ module.exports = async (ctx) => { const data = await ctx.cache.tryGet( profileUrl, async () => { - const _r = await got(profileUrl); - return _r.data; + const _r = await puppeteerGet(profileUrl, browser); + return _r; }, config.cache.routeExpire, false @@ -31,12 +36,8 @@ module.exports = async (ctx) => { async function getMedia(url) { const getPost = async () => { - const response = await got(url, { - headers: { - Referer: profileUrl, - }, - }); - return response.data; + const response = await puppeteerGet(url, browser); + return response; }; let data = await ctx.cache.tryGet(url, getPost); if (Object.prototype.toString.call(data) === '[object Object]') { @@ -178,6 +179,8 @@ module.exports = async (ctx) => { } } + await browser.close(); + ctx.state.data = { title: `${profileName} (@${id}) - Picuki`, link: profileUrl, diff --git a/lib/v2/picuki/utils.js b/lib/v2/picuki/utils.js new file mode 100644 index 00000000000000..c86ca37ef202ee --- /dev/null +++ b/lib/v2/picuki/utils.js @@ -0,0 +1,21 @@ +const puppeteerGet = async (url, browser) => { + const page = await browser.newPage(); + // await page.setExtraHTTPHeaders({ referer: host }); + await page.setRequestInterception(true); + page.on('request', (request) => { + request.resourceType() === 'document' ? request.continue() : request.abort(); + }); + await page.goto(url, { + waitUntil: 'domcontentloaded', + }); + + await page.waitForSelector('.wrapper'); + + const html = await page.evaluate(() => document.documentElement.innerHTML); + await page.close(); + return html; +}; + +module.exports = { + puppeteerGet, +};
14fc4af1ef5b053f4a17ab91704feb8f6e2d7f2a
2020-12-14 17:17:06
oppilate
fix: try to fix instagram account suspension (#6434)
false
try to fix instagram account suspension (#6434)
fix
diff --git a/lib/routes/instagram/utils.js b/lib/routes/instagram/utils.js index f14dbdf73ebdb1..b49acf8efb9e85 100644 --- a/lib/routes/instagram/utils.js +++ b/lib/routes/instagram/utils.js @@ -10,6 +10,7 @@ async function login(ig) { ig.state.generateDevice(process.env.IG_USERNAME); await ig.simulate.preLoginFlow(); await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD); + process.nextTick(async () => await ig.simulate.postLoginFlow()); logger.info('Instagram login success.'); } catch (error) { logger.error('Instagram login fail: ' + error);
b0253d09d8b3ff6596599c251f7c90f2b99e8dd2
2023-01-13 17:55:28
Joshua Peek
feat(route): bloomberg by author (#11615)
false
bloomberg by author (#11615)
feat
diff --git a/docs/en/finance.md b/docs/en/finance.md index 2ebc25d453ffbd..d60061b65bbeb4 100644 --- a/docs/en/finance.md +++ b/docs/en/finance.md @@ -27,6 +27,10 @@ pageClass: routes </RouteEn> +### Authors + +<RouteEn author="josh" example="/bloomberg/authors/ARbTQlRLRjE/matthew-s-levine" path="/bloomberg/authors/:id/:slug" :paramsDesc="['Author ID, can be found in URL', 'Author Slug, can be found in URL']" anticrawler="1" radar="1"/> + ## CFD ### Indices Dividend Adjustment (GBP) diff --git a/lib/v2/bloomberg/authors.js b/lib/v2/bloomberg/authors.js new file mode 100644 index 00000000000000..e2261444613eb9 --- /dev/null +++ b/lib/v2/bloomberg/authors.js @@ -0,0 +1,14 @@ +const { asyncPoolAll, parseArticle } = require('./utils'); +const parser = require('@/utils/rss-parser'); + +module.exports = async (ctx) => { + const { id, slug } = ctx.params; + const feed = await parser.parseURL(`https://www.bloomberg.com/authors/${id}/${slug}.rss`); + const item = await asyncPoolAll(1, feed.items, (item) => parseArticle(item, ctx)); + ctx.state.data = { + title: `Bloomberg - ${feed.title.split(' - ', 2)[0]}`, + link: feed.link, + language: feed.language, + item, + }; +}; diff --git a/lib/v2/bloomberg/index.js b/lib/v2/bloomberg/index.js index 4ac3c0889f8280..9ab1056856ff47 100644 --- a/lib/v2/bloomberg/index.js +++ b/lib/v2/bloomberg/index.js @@ -1,5 +1,4 @@ -const { rootUrl, parseNewsList, parseArticle } = require('./utils'); -const asyncPool = require('tiny-async-pool'); +const { rootUrl, asyncPoolAll, parseNewsList, parseArticle } = require('./utils'); const site_title_mapping = { '/': 'News', bpol: 'Politics', @@ -15,14 +14,6 @@ const site_title_mapping = { citylab: 'CityLab', }; -const asyncPoolAll = async (...args) => { - const results = []; - for await (const result of asyncPool(...args)) { - results.push(result); - } - return results; -}; - module.exports = async (ctx) => { const { site } = ctx.params; const currentUrl = site ? `${rootUrl}/${site}/sitemap_news.xml` : `${rootUrl}/sitemap_news.xml`; diff --git a/lib/v2/bloomberg/maintainer.js b/lib/v2/bloomberg/maintainer.js index b0f1e5315e2615..17c8230dcc7dec 100644 --- a/lib/v2/bloomberg/maintainer.js +++ b/lib/v2/bloomberg/maintainer.js @@ -1,4 +1,5 @@ module.exports = { + '/authors/:id/:slug': ['josh'], '/:site?': ['bigfei'], '/': ['bigfei'], }; diff --git a/lib/v2/bloomberg/radar.js b/lib/v2/bloomberg/radar.js index f91cca2a1149f3..5e302bd11d5fb4 100644 --- a/lib/v2/bloomberg/radar.js +++ b/lib/v2/bloomberg/radar.js @@ -1,13 +1,19 @@ module.exports = { 'bloomberg.com': { - _name: 'bloomberg', + _name: 'Bloomberg', www: [ { - title: 'Bloomberg', - docs: 'https://docs.rsshub.app/finance.html##bloomberg-news', + title: 'News', + docs: 'https://docs.rsshub.app/finance.html#bloomberg-news', source: ['/:site', '/'], target: '/bloomberg/:site?', }, + { + title: 'Authors', + docs: 'https://docs.rsshub.app/finance.html#bloomberg', + source: ['/*/authors/:id/:slug', '/authors/:id/:slug'], + target: '/bloomberg/authors/:id/:slug', + }, ], }, }; diff --git a/lib/v2/bloomberg/router.js b/lib/v2/bloomberg/router.js index 12005eff60c149..a310c8fd5bcf1f 100644 --- a/lib/v2/bloomberg/router.js +++ b/lib/v2/bloomberg/router.js @@ -1,4 +1,5 @@ module.exports = function (router) { + router.get('/authors/:id/:slug', require('./authors')); router.get('/:site', require('./index')); router.get('/', require('./index')); }; diff --git a/lib/v2/bloomberg/utils.js b/lib/v2/bloomberg/utils.js index e8ce1f4f338495..7526910324af52 100644 --- a/lib/v2/bloomberg/utils.js +++ b/lib/v2/bloomberg/utils.js @@ -1,5 +1,6 @@ const cheerio = require('cheerio'); const path = require('path'); +const asyncPool = require('tiny-async-pool'); const { parseDate } = require('@/utils/parse-date'); const got = require('@/utils/got'); @@ -388,8 +389,17 @@ const processBody = async (body_html, story_json) => { return $.html(); }; +const asyncPoolAll = async (...args) => { + const results = []; + for await (const result of asyncPool(...args)) { + results.push(result); + } + return results; +}; + module.exports = { rootUrl, + asyncPoolAll, parseNewsList, parseArticle, };
ad205013864a85de76e59e37ded35d0729b6ce34
2020-02-09 18:59:16
hoilc
feat: add 2048 (#3917)
false
add 2048 (#3917)
feat
diff --git a/docs/multimedia.md b/docs/multimedia.md index 6f8c04b6e2a934..2c5a98dc7e098f 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -4,6 +4,12 @@ pageClass: routes # 音视频 +## 2048 核基地 + +### 论坛更新 + +<Route author="hoilc" example="/2048/bbs/16" path="/2048/bbs/:fid" :paramsDesc="['板块 ID, 可在 URL 中找到, 例如, `thread.php?fid-16.html`中, 板块 ID 为`16`']"/> + ## 60-Second Science - Scientific American ### Transcript diff --git a/lib/router.js b/lib/router.js index 7b891de0250f55..fb93f180f163f6 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2219,4 +2219,7 @@ router.get('/hackerone/hacktivity', require('./routes/hackerone/hacktivity')); // 奶牛关 router.get('/cowlevel/element/:id', require('./routes/cowlevel/element')); +// 2048 +router.get('/2048/bbs/:fid', require('./routes/2048/bbs')); + module.exports = router; diff --git a/lib/routes/2048/bbs.js b/lib/routes/2048/bbs.js new file mode 100644 index 00000000000000..35e9fe439e313a --- /dev/null +++ b/lib/routes/2048/bbs.js @@ -0,0 +1,106 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +async function getAvailableHosts(ctx) { + const fby_url = 'https://hjd.tw/'; + const cache_key = `2048gkd-${new Date().toLocaleDateString()}`; + + const cache = await ctx.cache.get(cache_key); + if (cache) { + return JSON.parse(cache); + } + + const response = await got.get(fby_url); + const $ = cheerio.load(response.data); + const hosts = $('ul a') + .map(function() { + return $(this).attr('href'); + }) + .get(); + + ctx.cache.set(cache_key, JSON.stringify(hosts)); + return hosts; +} + +module.exports = async (ctx) => { + const fid = ctx.params.fid; + const base_hosts = await getAvailableHosts(ctx); + + const url = `${base_hosts[0]}/2048/thread.php?fid-${fid}-page-1.html`; + + const list_response = await got.get(url); + const $ = cheerio.load(list_response.data); + + const list = $('.tr3.t_one').toArray(); + $('#breadCrumb span.fr').remove(); + const forum_name = $('#breadCrumb') + .text() + .replace(/»/g, '-'); + + const parseContent = (htmlString) => { + const $ = cheerio.load(htmlString); + + const time = $('.tiptop.cc > .fl.gray').attr('title'); + const content = $('.tpc_content'); + + return { + description: content.html(), + pubDate: time ? new Date(time) : new Date(), + }; + }; + + const out = await Promise.all( + list.slice(0, 30).map(async (item) => { + const $ = cheerio.load(item); + + if ( + !$('td > a') + .first() + .attr('title') + ) { + return Promise.resolve(''); + } + + if ($("img[title='置顶帖标志']").length !== 0) { + return Promise.resolve(''); + } + + const title = $('a.subject'); + const author = $('a.bl'); + const path = title.attr('href'); + + const key = `/2048/${path}`; + const link = `${base_hosts[0]}/2048/${path}`; + + const cache = await ctx.cache.get(key); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + + const rssitem = { + title: title.text().trim(), + author: author.text().trim(), + link: link, + guid: key, + }; + + try { + const response = await got.get(link); + const result = parseContent(response.data); + + rssitem.description = result.description; + rssitem.pubDate = result.pubDate; + } catch (err) { + return Promise.resolve(''); + } + ctx.cache.set(key, JSON.stringify(rssitem)); + return Promise.resolve(rssitem); + }) + ); + + ctx.state.data = { + title: forum_name, + link: url, + item: out.filter((item) => item !== ''), + }; +};
ba496a625c6be43a34a425ba3a61af39044170d1
2022-04-28 18:31:45
neilnaveen
chore: Set permissions for GitHub actions (#9644)
false
Set permissions for GitHub actions (#9644)
chore
diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 3f32daca50c1b3..cbcd02ec7c128a 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -17,6 +17,8 @@ on: jobs: check-env: + permissions: + contents: none runs-on: ubuntu-latest outputs: check-docker: ${{ steps.check-docker.outputs.defined }} diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index b40c6205c8dcea..0b5fd39e771b54 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -11,6 +11,9 @@ on: - 'yarn.lock' # Please, always create a pull request instead of push to master. +permissions: + contents: read + jobs: test: name: Docker build & tests diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 5e53a46f5e745e..1810a17734aef8 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -5,8 +5,13 @@ on: branches: - master +permissions: + contents: read + jobs: format: + permissions: + contents: write # for Git to git push name: Auto format runs-on: ubuntu-latest diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index ffe1ceebd4e83f..ca1fd128375223 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -7,6 +7,9 @@ on: paths: - 'lib/**' +permissions: + contents: read + jobs: build: name: npm publish diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 2515bb5eb82459..f990ae5e26a88e 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -4,6 +4,9 @@ on: issue_comment: types: [created] +permissions: + contents: read + jobs: rebase: if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'COLLABORATOR' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d1229a9a308ec..168cb0d3b229b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: test on: [push, pull_request] +permissions: + contents: read + jobs: jest: runs-on: ubuntu-latest
9018fad3d1eacd269dfd09992d9b77da91aa9e8f
2025-02-28 02:56:46
Tony
fix(route): theverge (#18471)
false
theverge (#18471)
fix
diff --git a/lib/routes/theverge/index.ts b/lib/routes/theverge/index.ts index 607949f7fe47b0..6d9a6b725ed6d1 100644 --- a/lib/routes/theverge/index.ts +++ b/lib/routes/theverge/index.ts @@ -1,8 +1,13 @@ import { Route } from '@/types'; import cache from '@/utils/cache'; -import got from '@/utils/got'; +import ofetch from '@/utils/ofetch'; import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; +import path from 'node:path'; +import { art } from '@/utils/render'; +import { getCurrentPath } from '@/utils/helpers'; + +const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/:hub?', @@ -22,7 +27,7 @@ export const route: Route = { source: ['theverge.com/:hub', 'theverge.com/'], }, ], - name: 'The Verge', + name: 'Category', maintainers: ['HenryQW', 'vbali'], handler, description: `| Hub | Hub name | @@ -43,6 +48,37 @@ export const route: Route = { Provides a better reading experience (full text articles) over the official one.`, }; +const renderBlock = (b) => { + switch (b.__typename) { + case 'CoreEmbedBlockType': + return b.embedHtml; + case 'CoreGalleryBlockType': + return b.images.map((i) => `<figure><img src="${i.image.thumbnails.horizontal.url.split('?')[0]}" alt="${i.alt}" /><figcaption>${i.caption.html}</figcaption></figure>`).join(''); + case 'CoreHeadingBlockType': + return `<h${b.level}>${b.contents.html}</h${b.level}>`; + case 'CoreHTMLBlockType': + return b.markup; + case 'CoreImageBlockType': + return `<figure><img src="${b.thumbnail.url.split('?')[0]}" alt="${b.alt}" /><figcaption>${b.caption.html}</figcaption></figure>`; + case 'CoreListBlockType': + return `${b.ordered ? '<ol>' : '<ul>'}${b.items.map((i) => `<li>${i.contents.html}</li>`).join('')}${b.ordered ? '</ol>' : '</ul>'}`; + case 'CoreParagraphBlockType': + return b.contents.html; + case 'CorePullquoteBlockType': + return `<blockquote>${b.contents.html}</blockquote>`; + case 'CoreQuoteBlockType': + return `<blockquote>${b.children.map((child) => renderBlock(child)).join('')}</blockquote>`; + case 'CoreSeparatorBlockType': + return '<hr>'; + case 'HighlightBlockType': + return b.children.map((c) => renderBlock(c)).join(''); + case 'MethodologyAccordionBlockType': + return `<h2>${b.heading.html}</h2>${b.sections.map((s) => `<h3>${s.heading.html}</h3>${s.content.html}`).join('')}`; + default: + throw new Error(`Unsupported block type: ${b.__typename}`); + } +}; + async function handler(ctx) { const link = ctx.req.param('hub') ? `https://www.theverge.com/${ctx.req.param('hub')}/rss/index.xml` : 'https://www.theverge.com/rss/index.xml'; @@ -51,73 +87,48 @@ async function handler(ctx) { const items = await Promise.all( feed.items.map((item) => cache.tryGet(item.link, async () => { - const response = await got(item.link); - - const $ = load(response.data); - - const content = $('#content'); - const body = $('.duet--article--article-body-component-container'); - - // 处理封面图片 - - const cover = $('meta[property="og:image"]'); - - if (cover.length > 0) { - $(`<img src=${cover[0].attribs.content}>`).insertBefore(body[0].childNodes[0]); - } + const response = await ofetch(item.link); - // 处理封面视频 - $('div.l-col__main > div.c-video-embed, div.c-entry-hero > div.c-video-embed').each((i, e) => { - const src = `https://volume.vox-cdn.com/embed/${e.attribs['data-volume-uuid']}?autoplay=false`; + const $ = load(response); - $(`<iframe src="${src}" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" allowfullscreen scrolling="no"></iframe>`).insertBefore(body[0].childNodes[0]); - }); + const nextData = JSON.parse($('script#__NEXT_DATA__').text()); + const node = nextData.props.pageProps.hydration.responses.find((x) => x.operationName === 'PostLayoutQuery' || x.operationName === 'StreamLayoutQuery').data.node; - // 处理封面视频 - $('div.l-col__main > div.c-video-embed--media iframe').each((i, e) => { - $(e).insertBefore(body[0].childNodes[0]); + let description = art(path.join(__dirname, 'templates/header.art'), { + featuredImage: node.featuredImage, + ledeMediaData: node.ledeMediaData, }); - // 处理文章图片 - content.find('figure.e-image').each((i, e) => { - let src, caption; - - // 处理 jpeg, png - if ($(e).find('picture > source').length > 0) { - src = $(e) - .find('picture > img')[0] - .attribs.srcset.match(/(?<=320w,).*?(?=520w)/g)[0] - .trim(); - } else if ($(e).find('img.c-dynamic-image').length > 0) { - // 处理 gif - src = $(e).find('span.e-image__image')[0].attribs['data-original']; - } - - // 处理 caption - if ($(e).find('span.e-image__meta').length > 0) { - caption = $(e).find('span.e-image__meta').text(); - } - - const figure = `<figure><img src=${src}>${caption ? `<br><figcaption>${caption}</figcaption>` : ''}</figure>`; - - $(figure).insertBefore(e); - - $(e).remove(); - }); - - const lede = $('.duet--article--lede h2:first'); - if (lede[0]) { - lede.insertBefore(body[0].childNodes[0]); + description += node.blocks + .filter((b) => b.__typename !== 'NewsletterBlockType' && b.__typename !== 'RelatedPostsBlockType' && b.__typename !== 'ProductBlockType' && b.__typename !== 'TableOfContentsBlockType') + .map((b) => renderBlock(b)) + .join('<br><br>'); + + if (node.__typename === 'StreamResourceType') { + description += node.posts.edges + .map(({ node: n }) => { + let d = + `<h2><a href="${n.permalink}">${n.promo.headline || n.title}</a></h2>` + + art(path.join(__dirname, 'templates/header.art'), { + ledeMediaData: n.ledeMediaData, + }); + switch (n.__typename) { + case 'PostResourceType': + d += n.excerpt.map((e) => e.contents.html).join('<br>'); + break; + case 'QuickPostResourceType': + d += n.blocks.map((b) => renderBlock(b)).join('<br>'); + break; + default: + break; + } + return d; + }) + .join('<br>'); } - // 移除无用 DOM - content.find('.duet--article--comments-join-the-conversation').remove(); - content.find('.duet--recirculation--related-list').remove(); - delete item.content; - delete item.contentSnippet; - delete item.isoDate; - - item.description = body.html(); + item.description = description; + item.category = node.categories; return item; }) diff --git a/lib/routes/theverge/templates/header.art b/lib/routes/theverge/templates/header.art new file mode 100644 index 00000000000000..e57a1dbf595134 --- /dev/null +++ b/lib/routes/theverge/templates/header.art @@ -0,0 +1,19 @@ +{{ if featuredImage }} + <figure> + <img src="{{ featuredImage.image.originalUrl.split('?')[0] }}" alt="{{ featuredImage.image.originalUrl.alt }}"> + <figcaption>{{ featuredImage.image.title }}</figcaption> + </figure> +{{ /if }} + +{{ if ledeMediaData }} + {{ if ledeMediaData.__typename === 'LedeMediaEmbedType'}} + {{@ ledeMediaData.embedHtml }} + {{ else if ledeMediaData.__typename === 'LedeMediaImageType' && !featuredImage }} + <figure> + <img src="{{ ledeMediaData.image.thumbnails.horizontal.url.split('?')[0] }}" alt="{{ ledeMediaData.image.title }}"> + <figcaption>{{ ledeMediaData.image.credit.plaintext || ledeMediaData.image.title }}</figcaption> + </figure> + {{ else if ledeMediaData.__typename === 'LedeMediaVideoType'}} + <iframe src="https://volume.vox-cdn.com/embed/{{ ledeMediaData.video.volumeUuid }}" allowfullscreen></iframe> + {{ /if }} +{{ /if }}
2d626f3a1978f18245f44948c8d875c3c3016704
2024-09-13 06:05:39
Liu Yuhe
feat(route/bilibili): 哔哩哔哩入站必刷 (#16711)
false
哔哩哔哩入站必刷 (#16711)
feat
diff --git a/lib/routes/bilibili/bilibili-recommend.ts b/lib/routes/bilibili/bilibili-recommend.ts new file mode 100644 index 00000000000000..0943741fc08a9c --- /dev/null +++ b/lib/routes/bilibili/bilibili-recommend.ts @@ -0,0 +1,42 @@ +import { Route } from '@/types'; +import got from '@/utils/got'; +import utils from './utils'; + +export const route: Route = { + path: '/precious/:disableEmbed?', + categories: ['social-media'], + example: '/bilibili/precious', + parameters: { disableEmbed: '默认为开启内嵌视频, 任意值为关闭' }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: '入站必刷', + maintainers: ['liuyuhe666'], + handler, +}; + +async function handler(ctx) { + const disableEmbed = ctx.req.param('disableEmbed'); + const response = await got({ + method: 'get', + url: 'https://api.bilibili.com/x/web-interface/popular/precious', + headers: { + Referer: 'https://www.bilibili.com/v/popular/history', + }, + }); + const data = response.data.data.list; + return { + title: '哔哩哔哩入站必刷', + link: 'https://www.bilibili.com/v/popular/history', + item: data.map((item) => ({ + title: item.title, + description: `${item.desc || item.title}${disableEmbed ? '' : `<br><br>${utils.iframe(item.aid, null, item.bvid)}`}<br><img src="${item.pic}">`, + link: item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.aid}`, + })), + }; +}
54ed4e190529be9b33aa8d0c5a610ef532da8263
2025-03-13 23:16:31
dependabot[bot]
chore(deps): bump @scalar/hono-api-reference from 0.5.184 to 0.6.0 (#18589)
false
bump @scalar/hono-api-reference from 0.5.184 to 0.6.0 (#18589)
chore
diff --git a/lib/api/index.ts b/lib/api/index.ts index 064852019b7244..a6eb4629589cf3 100644 --- a/lib/api/index.ts +++ b/lib/api/index.ts @@ -29,11 +29,6 @@ for (const path in docs.paths) { delete docs.paths[path]; } app.get('/openapi.json', (ctx) => ctx.json(docs)); -app.get( - '/reference', - apiReference({ - spec: { content: docs }, - }) -); +app.get('/reference', apiReference({ content: docs })); export default app; diff --git a/package.json b/package.json index bd84dbb4b16da4..c4a4f00a96aa16 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@opentelemetry/semantic-conventions": "1.30.0", "@postlight/parser": "2.2.3", "@rss3/sdk": "0.0.25", - "@scalar/hono-api-reference": "0.5.184", + "@scalar/hono-api-reference": "0.6.0", "@sentry/node": "9.5.0", "@tonyrl/rand-user-agent": "2.0.83", "aes-js": "3.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45671e79bcd4c1..a8d423dbeb394e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,8 +59,8 @@ importers: specifier: 0.0.25 version: 0.0.25 '@scalar/hono-api-reference': - specifier: 0.5.184 - version: 0.5.184([email protected]) + specifier: 0.6.0 + version: 0.6.0([email protected]) '@sentry/node': specifier: 9.5.0 version: 9.5.0 @@ -2025,12 +2025,12 @@ packages: '@rss3/[email protected]': resolution: {integrity: sha512-jyXT4YTwefxxRZ0tt5xjbnw8e7zPg2OGdo/0xb+h/7qWnMNhLtWpc95DsYs/1C/I0rIyiDpZBhLI2DieQ9y+tw==} - '@scalar/[email protected]': - resolution: {integrity: sha512-7qnZp8ykrXoKScFIZcwt638CuFFyj7G3SsgVfD5liNgb533K8/lhWqdmp1vK2u4BKKJ9GBAPKMlWZE/+yA8WTw==} + '@scalar/[email protected]': + resolution: {integrity: sha512-tCSCZWyzAviHfIHwWVpUU5tKugkGbvneoh5UeHvDXlnIOM/cThUm5woDPf6D4YnCDTlPIZ6ymrYwDn6XpqNG4g==} engines: {node: '>=18'} - '@scalar/[email protected]': - resolution: {integrity: sha512-vRSRwJkN1Xo5dW9KYQJlGpKZ+Nh9qH+x1sn0qf6/Lx8QLPyyEpNm1EEddKaIN6qd5wrtVjDN6adQhfAfcYGHzw==} + '@scalar/[email protected]': + resolution: {integrity: sha512-tNd4quOzFpvidkHskOde0jYzTdANjRlrLwZxoJM1v4Y1xilfHj06tC6DS62Kx6qSuVwvGi1/8KTODUxhJp3KxQ==} engines: {node: '>=18'} peerDependencies: hono: ^4.0.0 @@ -2039,8 +2039,8 @@ packages: resolution: {integrity: sha512-HQQudOSQBU7ewzfnBW9LhDmBE2XOJgSfwrh5PlUB7zJup/kaRkBGNgV2wMjNz9Af/uztiU/xNrO179FysmUT+g==} engines: {node: '>=18'} - '@scalar/[email protected]': - resolution: {integrity: sha512-0J6o+yZzgZEvl3KhvLTAGiXXyrCeEPKvs9gUWQDf1Rb5NfFxF0lA10ougCQCwVJIguWNEzZfOUiSoAFzGy2EqQ==} + '@scalar/[email protected]': + resolution: {integrity: sha512-6yYwc7+PSY3bAWkQVCYxp7qPOgqaWDHmp2ceZhXaXGYbwGK7jLqwG+YAMZfl9qqo0NzoBoClUVkb8aTER1LX2A==} engines: {node: '>=18'} '@sec-ant/[email protected]': @@ -7819,18 +7819,18 @@ snapshots: '@rss3/api-core': 0.0.25 '@rss3/api-utils': 0.0.25 - '@scalar/[email protected]': + '@scalar/[email protected]': dependencies: - '@scalar/types': 0.0.40 + '@scalar/types': 0.1.0 - '@scalar/[email protected]([email protected])': + '@scalar/[email protected]([email protected])': dependencies: - '@scalar/core': 0.1.1 + '@scalar/core': 0.1.3 hono: 4.7.4 '@scalar/[email protected]': {} - '@scalar/[email protected]': + '@scalar/[email protected]': dependencies: '@scalar/openapi-types': 0.1.9 '@unhead/schema': 1.11.20
bab100a4876e2ae5873c2ea6555262d5feb4d442
2022-05-15 19:47:23
Rongrong
feat(route/twitter): allow force using Web API (#9760)
false
allow force using Web API (#9760)
feat
diff --git a/docs/en/social-media.md b/docs/en/social-media.md index 2f724b2ae72807..0462d71757c82d 100644 --- a/docs/en/social-media.md +++ b/docs/en/social-media.md @@ -304,34 +304,38 @@ Due to Telegram restrictions, some channels involving pornography, copyright, an ::: warning -Due to Twitter API restrictions, the Twitter Routes currently supports tweets within 7 days +Due to restrictions from Twitter, currently only tweets within 7 days are available in some routes. + +Some routes rely on the Twitter Developer API, which requires to be specially configured to enable.\ +There are two routes (`/twitter/user` and `/twitter/keyword`) comes with Web API implementation which does not require to be specially configured to enable along with the Developer API implementation. By default, the Developer API is prioritized, but if it is not configured or errors, the Web API will be used. However, there are some differences between the two APIs, e.g. `excludeReplies` in the Developer API will treat [threads](https://blog.twitter.com/official/en_us/topics/product/2017/nicethreads.html) (self-replied tweets) as replies and exclude them, while in the Web API it will not. If you would like to exclude replies but include threads, enable `forceWebApi` in the `/twitter/user` route. ::: -Specify options (in query string's format) in parameter `routeParams` to control some extra features for Tweets - -| Key | Description | Accepts | Defaults to | -| ------ | ----------- | ------- | ------------ | -| readable | Enable readable layout | 0/1/true/false | false | -| authorNameBold | Display author name in bold | 0/1/true/false | false | -| showAuthorInTitle | Show author name in title | 0/1/true/false | false (true in `/twitter/followings`) | -| showAuthorInDesc | Show author name in description (RSS body) | 0/1/true/false | false (true in `/twitter/followings`) | -| showQuotedAuthorAvatarInDesc | Show avatar of quoted Tweet's author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | 0/1/true/false | false | -| showAuthorAvatarInDesc | Show avatar of author in description (RSS body) (Not recommended if your RSS reader extracts images from description)| 0/1/true/false | false | -| showEmojiForRetweetAndReply | Use "🔁" instead of "Rt", "↩️" & "💬" instead of "Re" | 0/1/true/false | false | -| showRetweetTextInTitle | Show quote comments in title | 0/1/true/false | true | -| addLinkForPics | Add clickable links for Tweet pictures | 0/1/true/false | false | -| showTimestampInDescription| Show timestamp in description | 0/1/true/false | false | -| showQuotedInTitle | Show quoted tweet in title | 0/1/true/false | false | -| widthOfPics | Width of Tweet pictures | Unspecified/Integer | Unspecified | -| heightOfPics | Height of Tweet pictures | Unspecified/Integer | Unspecified | -| sizeOfAuthorAvatar | Size of author's avatar | Integer | 48 | -| sizeOfQuotedAuthorAvatar | Size of quoted tweet's author's avatar | Integer | 24 | -| excludeReplies | Exclude replies, only available in "User timeline" | 0/1/true/false | false | -| includeRts | Include retweets, only available in "User timeline" | 0/1/true/false | true | -| count | `count` parameter passed to Twitter API, only available in "User timeline" | Unspecified/Integer | Unspecified | - -Specify different option values than default values to improve readablility. The URL +Specify options (in the format of query string) in parameter `routeParams` to control some extra features for Tweets + +| Key | Description | Accepts | Defaults to | +|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|------------------------|-------------------------------------------| +| `readable` | Enable readable layout | `0`/`1`/`true`/`false` | `false` | +| `authorNameBold` | Display author name in bold | `0`/`1`/`true`/`false` | `false` | +| `showAuthorInTitle` | Show author name in title | `0`/`1`/`true`/`false` | `false` (`true` in `/twitter/followings`) | +| `showAuthorInDesc` | Show author name in description (RSS body) | `0`/`1`/`true`/`false` | `false` (`true` in `/twitter/followings`) | +| `showQuotedAuthorAvatarInDesc` | Show avatar of quoted Tweet's author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | `0`/`1`/`true`/`false` | `false` | +| `showAuthorAvatarInDesc` | Show avatar of author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | `0`/`1`/`true`/`false` | `false` | +| `showEmojiForRetweetAndReply` | Use "🔁" instead of "Rt", "↩️" & "💬" instead of "Re" | `0`/`1`/`true`/`false` | `false` | +| `showRetweetTextInTitle` | Show quote comments in title (if `false`, only the retweeted tweet will be shown in the title) | `0`/`1`/`true`/`false` | `true` | +| `addLinkForPics` | Add clickable links for Tweet pictures | `0`/`1`/`true`/`false` | `false` | +| `showTimestampInDescription` | Show timestamp in description | `0`/`1`/`true`/`false` | `false` | +| `showQuotedInTitle` | Show quoted tweet in title | `0`/`1`/`true`/`false` | `false` | +| `widthOfPics` | Width of Tweet pictures | Unspecified/Integer | Unspecified | +| `heightOfPics` | Height of Tweet pictures | Unspecified/Integer | Unspecified | +| `sizeOfAuthorAvatar` | Size of author's avatar | Integer | `48` | +| `sizeOfQuotedAuthorAvatar` | Size of quoted tweet's author's avatar | Integer | `24` | +| `excludeReplies` | Exclude replies, only available in `/twitter/user` | `0`/`1`/`true`/`false` | `false` | +| `includeRts` | Include retweets, only available in `/twitter/user` | `0`/`1`/`true`/`false` | `true` | +| `forceWebApi` | Force using Web API even if Developer API is configured, only available in `/twitter/user` and `/twitter/keyword` | `0`/`1`/`true`/`false` | `false` | +| `count` | `count` parameter passed to Twitter API, only available in `/twitter/user` | Unspecified/Integer | Unspecified | + +Specify different option values than default values to improve readability. The URL ``` https://rsshub.app/twitter/user/durov/readable=1&authorNameBold=1&showAuthorInTitle=1&showAuthorInDesc=1&showQuotedAuthorAvatarInDesc=1&showAuthorAvatarInDesc=1&showEmojiForRetweetAndReply=1&showRetweetTextInTitle=0&addLinkForPics=1&showTimestampInDescription=1&showQuotedInTitle=1&heightOfPics=150 @@ -343,11 +347,11 @@ generates ### User timeline -<RouteEn path="/twitter/user/:id/:routeParams?" example="/twitter/user/DIYgod" :paramsDesc="['user id', 'extra parameters, see the table above; particularly when `routeParams=exclude_replies`, replies are excluded; `routeParams=exclude_rts` excludes retweets,`routeParams=exclude_rts_replies` exclude replies and retweets; for default include all.']" radar="1" rssbud="1"/> +<RouteEn author="DIYgod yindaheng98 Rongronggg9" path="/twitter/user/:id/:routeParams?" example="/twitter/user/DIYgod" :paramsDesc="['user id', 'extra parameters, see the table above; particularly when `routeParams=exclude_replies`, replies are excluded; `routeParams=exclude_rts` excludes retweets,`routeParams=exclude_rts_replies` exclude replies and retweets; for default include all.']" radar="1" rssbud="1"/> ### User media -<RouteEn author="yindaheng98" path="/twitter/media/:id/:routeParams?" example="/twitter/media/DIYgod" :paramsDesc="['user id', 'extra parameters, see the table above.']" radar="1" rssbud="1"/> +<RouteEn author="yindaheng98 Rongronggg9" path="/twitter/media/:id/:routeParams?" example="/twitter/media/DIYgod" :paramsDesc="['user id', 'extra parameters, see the table above.']" radar="1" rssbud="1"/> ## User following timeline @@ -371,7 +375,7 @@ This route requires Twitter token's corresponding id, therefore it's only availa ### Keyword -<RouteEn author="DIYgod" example="/twitter/keyword/RSSHub" path="/twitter/keyword/:keyword/:routeParams?" :paramsDesc="['keyword', 'extra parameters, see the table above']" radar="1" rssbud="1"/> +<RouteEn author="DIYgod yindaheng98 Rongronggg9" example="/twitter/keyword/RSSHub" path="/twitter/keyword/:keyword/:routeParams?" :paramsDesc="['keyword', 'extra parameters, see the table above']" radar="1" rssbud="1"/> ### Trends diff --git a/docs/social-media.md b/docs/social-media.md index 9e470dd73f3726..235487a1ca8fd0 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -667,32 +667,36 @@ Instagram Stories 没有可靠的 guid,你的 RSS 阅读器可能将同一条 ::: warning 注意 -由于 Twitter Api 限制,关于 Twitter 相关的 RSS 接口目前仅支持 7 天内推文检索 +由于 Twitter 的限制,部分路由目前仅支持 7 天内推文检索。 + +部分路由的实现依赖 Twitter Developer API,需要特别配置以启用。\ +`/twitter/user` 及 `/twitter/keyword` 两个路由除 Developer API 外,尚有不需特别配置以启用的 Web API 实现。默认情况下,Developer API 优先级更高,只有当其未配置或出错时才会使用 Web API。然而,两个 API 在某些方面存在不同特性,如,`excludeReplies` 在 Developer API 中会将推文串([Thread](https://blog.twitter.com/official/en_us/topics/product/2017/nicethreads.html),回复自己推文的推文)视作回复一并排除,而在 Web API 中则不会。如有需要在 `/twitter/user` 中排除回复但包含推文串,请启用 `forceWebApi`。 ::: 对于推文内容,在 `routeParams` 参数中以 query string 格式指定选项,可以控制额外的功能 -| 键 | 含义 | 接受的值 | 默认值 | -| ---------------------------- | -------------------------------------- | -------------- | ------------------------------------ | -| readable | 是否开启细节排版可读性优化 | 0/1/true/false | false | -| authorNameBold | 是否加粗作者名字 | 0/1/true/false | false | -| showAuthorInTitle | 是否在标题处显示作者 | 0/1/true/false | false(`/twitter/followings` 中为 true) | -| showAuthorInDesc | 是否在正文处显示作者 | 0/1/true/false | false(`/twitter/followings` 中为 true) | -| showQuotedAuthorAvatarInDesc | 是否在正文处显示被转推的推文的作者头像(若阅读器会提取正文图片,不建议开启) | 0/1/true/false | false | -| showAuthorAvatarInDesc | 是否在正文处显示作者头像(若阅读器会提取正文图片,不建议开启) | 0/1/true/false | false | -| showEmojiForRetweetAndReply | 显示 “🔁” 取代 “Rt”、“↩️” 取代 “Re” | 0/1/true/false | false | -| showRetweetTextInTitle | 在标题处显示转推评论(置为 false 则在标题只显示被转推推文) | 0/1/true/false | true | -| addLinkForPics | 为图片添加可点击的链接 | 0/1/true/false | false | -| showTimestampInDescription | 在正文处显示推特的时间戳 | 0/1/true/false | false | -| showQuotedInTitle | 在标题处显示被引用的推文 | 0/1/true/false | false | -| widthOfPics | 推文配图宽(生效取决于阅读器) | 不指定 / 数字 | 不指定 | -| heightOfPics | 推文配图高(生效取决于阅读器) | 不指定 / 数字 | 不指定 | -| sizeOfAuthorAvatar | 作者头像大小 | 数字 | 48 | -| sizeOfQuotedAuthorAvatar | 被转推推文作者头像大小 | 数字 | 24 | -| excludeReplies | 排除回复,只在用户时间线有效 | 0/1/true/false | false | -| includeRts | 包括转推,只在用户时间线有效 | 0/1/true/false | true | -| count | 传递给 Twitter API 的 `count` 参数,只在用户时间线有效 | 不指定 / 数字 | 不指定 | +| 键 | 含义 | 接受的值 | 默认值 | +| ------------------------------ | ----------------------------------------------------------------------------- | ---------------------- | ----------------------------------------- | +| `readable` | 是否开启细节排版可读性优化 | `0`/`1`/`true`/`false` | `false` | +| `authorNameBold` | 是否加粗作者名字 | `0`/`1`/`true`/`false` | `false` | +| `showAuthorInTitle` | 是否在标题处显示作者 | `0`/`1`/`true`/`false` | `false` (`/twitter/followings` 中为 `true`) | +| `showAuthorInDesc` | 是否在正文处显示作者 | `0`/`1`/`true`/`false` | `false` (`/twitter/followings` 中为 `true`) | +| `showQuotedAuthorAvatarInDesc` | 是否在正文处显示被转推的推文的作者头像(若阅读器会提取正文图片,不建议开启) | `0`/`1`/`true`/`false` | `false` | +| `showAuthorAvatarInDesc` | 是否在正文处显示作者头像(若阅读器会提取正文图片,不建议开启) | `0`/`1`/`true`/`false` | `false` | +| `showEmojiForRetweetAndReply` | 显示 “🔁” 取代 “Rt”、“↩️” 取代 “Re” | `0`/`1`/`true`/`false` | `false` | +| `showRetweetTextInTitle` | 在标题处显示转推评论(置为 `false` 则在标题只显示被转推推文) | `0`/`1`/`true`/`false` | `true` | +| `addLinkForPics` | 为图片添加可点击的链接 | `0`/`1`/`true`/`false` | `false` | +| `showTimestampInDescription` | 在正文处显示推特的时间戳 | `0`/`1`/`true`/`false` | `false` | +| `showQuotedInTitle` | 在标题处显示被引用的推文 | `0`/`1`/`true`/`false` | `false` | +| `widthOfPics` | 推文配图宽(生效取决于阅读器) | 不指定 / 数字 | 不指定 | +| `heightOfPics` | 推文配图高(生效取决于阅读器) | 不指定 / 数字 | 不指定 | +| `sizeOfAuthorAvatar` | 作者头像大小 | 数字 | `48` | +| `sizeOfQuotedAuthorAvatar` | 被转推推文作者头像大小 | 数字 | `24` | +| `excludeReplies` | 排除回复,只在 `/twitter/user` 中有效 | `0`/`1`/`true`/`false` | `false` | +| `includeRts` | 包括转推,只在 `/twitter/user` 中有效 | `0`/`1`/`true`/`false` | `true` | +| `forceWebApi` | 强制使用 Web API,即使 Developer API 已配置,只在 `/twitter/user` 和 `/twitter/keyword` 中有效 | `0`/`1`/`true`/`false` | `false` | +| `count` | 传递给 Twitter API 的 `count` 参数,只在 `/twitter/user` 中有效 | 不指定 / 数字 | 不指定 | 指定更多与默认值不同的参数选项可以改善 RSS 的可读性,如 @@ -704,11 +708,11 @@ Instagram Stories 没有可靠的 guid,你的 RSS 阅读器可能将同一条 ### 用户时间线 -<Route author="DIYgod" example="/twitter/user/DIYgod" path="/twitter/user/:id/:routeParams?" :paramsDesc="['用户名', '额外参数;请参阅上面的说明和表格;特别地,当 `routeParams=exclude_replies`时去除回复,`routeParams=exclude_rts`去除转推,`routeParams=exclude_rts_replies`去除回复和转推,默认包含全部回复和转推。']" radar="1" rssbud="1"/> +<Route author="DIYgod yindaheng98 Rongronggg9" example="/twitter/user/DIYgod" path="/twitter/user/:id/:routeParams?" :paramsDesc="['用户名', '额外参数;请参阅上面的说明和表格;特别地,当 `routeParams=exclude_replies`时去除回复,`routeParams=exclude_rts`去除转推,`routeParams=exclude_rts_replies`去除回复和转推,默认包含全部回复和转推。']" radar="1" rssbud="1"/> ### 用户媒体时间线 -<Route author="yindaheng98" example="/twitter/media/DIYgod" path="/twitter/media/:id/:routeParams?" :paramsDesc="['用户名', '额外参数;请参阅上面的说明和表格。']" radar="1" rssbud="1"/> +<Route author="yindaheng98 Rongronggg9" example="/twitter/media/DIYgod" path="/twitter/media/:id/:routeParams?" :paramsDesc="['用户名', '额外参数;请参阅上面的说明和表格。']" radar="1" rssbud="1"/> ### 用户关注时间线 @@ -732,7 +736,7 @@ Instagram Stories 没有可靠的 guid,你的 RSS 阅读器可能将同一条 ### 关键词 -<Route author="DIYgod" example="/twitter/keyword/RSSHub" path="/twitter/keyword/:keyword/:routeParams?/limit?" :paramsDesc="['关键词', '额外参数;请参阅上面的说明和表格', '查询前多少条']" radar="1" rssbud="1"/> +<Route author="DIYgod yindaheng98 Rongronggg9" example="/twitter/keyword/RSSHub" path="/twitter/keyword/:keyword/:routeParams?/limit?" :paramsDesc="['关键词', '额外参数;请参阅上面的说明和表格', '查询前多少条']" radar="1" rssbud="1"/> ### Trends diff --git a/lib/routes/twitter/api_fallback_common.js b/lib/routes/twitter/api_fallback_common.js new file mode 100644 index 00000000000000..bc6bfa90eee4dd --- /dev/null +++ b/lib/routes/twitter/api_fallback_common.js @@ -0,0 +1,17 @@ +const config = require('@/config').value; +const logger = require('@/utils/logger'); +const utils = require('@/routes/twitter/utils'); + +module.exports = async (ctx, devApiImpl, webApiImpl) => { + const { force_web_api } = utils.parseRouteParams(ctx.params.routeParams); + + if (!force_web_api && config.twitter && config.twitter.consumer_key && config.twitter.consumer_secret) { + try { + await devApiImpl(ctx); + return; + } catch (e) { + logger.error(`Fallback to Twitter web API due to developer API error:\n${e.stack}`); + } + } + await webApiImpl(ctx); +}; diff --git a/lib/routes/twitter/keyword.js b/lib/routes/twitter/keyword.js index 54c470f4c1b124..5d318887756311 100644 --- a/lib/routes/twitter/keyword.js +++ b/lib/routes/twitter/keyword.js @@ -1,16 +1,5 @@ -const config = require('@/config').value; -const webApiImpl = require('./web-api/search'); const devApiImpl = require('./developer-api/search'); -const logger = require('@/utils/logger'); +const webApiImpl = require('./web-api/search'); +const apiFallback = require('./api_fallback_common'); -module.exports = async (ctx) => { - if (config.twitter && config.twitter.consumer_key && config.twitter.consumer_secret) { - try { - await devApiImpl(ctx); - return; - } catch (e) { - logger.error(`Fallback to Twitter web API due to developer API error:\n${e.stack}`); - } - } - await webApiImpl(ctx); -}; +module.exports = (ctx) => apiFallback(ctx, devApiImpl, webApiImpl); diff --git a/lib/routes/twitter/user.js b/lib/routes/twitter/user.js index 60820a94e9fbfe..11a13d979e7f67 100644 --- a/lib/routes/twitter/user.js +++ b/lib/routes/twitter/user.js @@ -1,16 +1,5 @@ -const config = require('@/config').value; const devApiImpl = require('./developer-api/user'); const webApiImpl = require('./web-api/user'); -const logger = require('@/utils/logger'); +const apiFallback = require('./api_fallback_common'); -module.exports = async (ctx) => { - if (config.twitter && config.twitter.consumer_key && config.twitter.consumer_secret) { - try { - await devApiImpl(ctx); - return; - } catch (e) { - logger.error(`Fallback to Twitter web API due to developer API error:\n${e.stack}`); - } - } - await webApiImpl(ctx); -}; +module.exports = (ctx) => apiFallback(ctx, devApiImpl, webApiImpl); diff --git a/lib/routes/twitter/utils.js b/lib/routes/twitter/utils.js index e406ec7edc7753..ed64f0940bf6fb 100644 --- a/lib/routes/twitter/utils.js +++ b/lib/routes/twitter/utils.js @@ -411,8 +411,8 @@ if (config.twitter.consumer_key && config.twitter.consumer_secret) { } const parseRouteParams = (routeParams) => { - let exclude_replies, include_rts; - let count = undefined; + let count, exclude_replies, include_rts; + let force_web_api = false; if (routeParams === 'exclude_rts_replies' || routeParams === 'exclude_replies_rts') { exclude_replies = true; include_rts = false; @@ -427,8 +427,9 @@ const parseRouteParams = (routeParams) => { count = fallback(undefined, queryToInteger(parsed.get('count')), undefined); exclude_replies = fallback(undefined, queryToBoolean(parsed.get('excludeReplies')), false); include_rts = fallback(undefined, queryToBoolean(parsed.get('includeRts')), true); + force_web_api = fallback(undefined, queryToBoolean(parsed.get('forceWebApi')), false); } - return { count, exclude_replies, include_rts }; + return { count, exclude_replies, include_rts, force_web_api }; }; module.exports = {
01a655d83235deba4de43c183c6130617255b8c9
2024-05-02 03:34:33
dependabot[bot]
chore(deps-dev): bump @types/markdown-it from 14.0.1 to 14.1.1 (#15437)
false
bump @types/markdown-it from 14.0.1 to 14.1.1 (#15437)
chore
diff --git a/package.json b/package.json index ab37d6c970af2e..96e85414bd132c 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "@types/jsrsasign": "10.5.13", "@types/lint-staged": "13.3.0", "@types/mailparser": "3.4.4", - "@types/markdown-it": "14.0.1", + "@types/markdown-it": "14.1.1", "@types/module-alias": "2.0.4", "@types/node": "20.12.7", "@types/sanitize-html": "2.11.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5033cbdf95179..5739921bdeff90 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -284,8 +284,8 @@ devDependencies: specifier: 3.4.4 version: 3.4.4 '@types/markdown-it': - specifier: 14.0.1 - version: 14.0.1 + specifier: 14.1.1 + version: 14.1.1 '@types/module-alias': specifier: 2.0.4 version: 2.0.4 @@ -2967,8 +2967,8 @@ packages: iconv-lite: 0.6.3 dev: true - /@types/[email protected]: - resolution: {integrity: sha512-6WfOG3jXR78DW8L5cTYCVVGAsIFZskRHCDo5tbqa+qtKVt4oDRVH7hyIWu1SpDQJlmIoEivNQZ5h+AGAOrgOtQ==} + /@types/[email protected]: + resolution: {integrity: sha512-4NpsnpYl2Gt1ljyBGrKMxFYAYvpqbnnkgP/i/g+NLpjEUa3obn1XJCur9YbEXKDAkaXqsR1LbDnGEJ0MmKFxfg==} dependencies: '@types/linkify-it': 5.0.0 '@types/mdurl': 2.0.0
03146b5b6a01d5686d6d7be759e0516facc32265
2023-09-03 17:27:44
RengarLee
docs: update new-radar doc (#13194)
false
update new-radar doc (#13194)
docs
diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md index e2d07781d4de6f..d6b1f5db4627a8 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-radar.md @@ -17,7 +17,7 @@ module.exports = { '.': [ { title: '仓库 Issues', - docs: 'https://docs.rsshub.app/programming#github', + docs: 'https://docs.rsshub.app/routes/programming#github', source: ['/:user/:repo/issues/:id', '/:user/:repo/issues', '/:user/:repo'], target: '/github/issue/:user/:repo', }, @@ -109,7 +109,7 @@ module.exports = { ### `docs` -文档链接也是*必填*字段。在这种情况下,`GitHub 仓库 Issues` 的文档链接将是 `https://docs.rsshub.app/programming#github`。请注意,URL hash 应位于二级标题 (`##`) 处,而不是三级标题 (`###`) `https://docs.rsshub.app/programming#github-cang-ku-issues`。 +文档链接也是*必填*字段。在这种情况下,`GitHub 仓库 Issues` 的文档链接将是 `https://docs.rsshub.app/routes/programming#github`。请注意,URL hash 应位于二级标题 (`##`) 处,而不是三级标题 (`###`) `https://docs.rsshub.app/routes/programming#github-cang-ku-issues`。 ### `source`
022d806b781a36aeb06d792d72a6e04224897d8e
2024-10-29 15:14:03
pseudoyu
feat(route/reuters): add wire source and modify doc
false
add wire source and modify doc
feat
diff --git a/lib/routes/reuters/common.ts b/lib/routes/reuters/common.ts index 6521ae77b07d02..908ea65b2d6342 100644 --- a/lib/routes/reuters/common.ts +++ b/lib/routes/reuters/common.ts @@ -29,44 +29,7 @@ export const route: Route = { ], default: 'world', }, - topic: { - description: 'find it in the URL, or tables below, leave empty for `All`', - options: [ - // World topics - { value: 'africa', label: 'Africa' }, - { value: 'americas', label: 'Americas' }, - { value: 'asia-pacific', label: 'Asia Pacific' }, - { value: 'china', label: 'China' }, - { value: 'europe', label: 'Europe' }, - { value: 'india', label: 'India' }, - { value: 'middle-east', label: 'Middle East' }, - { value: 'uk', label: 'United Kingdom' }, - { value: 'us', label: 'United States' }, - { value: 'the-great-reboot', label: 'The Great Reboot' }, - { value: 'reuters-next', label: 'Reuters Next' }, - // Business topics - { value: 'aerospace-defense', label: 'Aerospace & Defense' }, - { value: 'autos-transportation', label: 'Autos & Transportation' }, - { value: 'energy', label: 'Energy' }, - { value: 'environment', label: 'Environment' }, - { value: 'finance', label: 'Finance' }, - { value: 'healthcare-pharmaceuticals', label: 'Healthcare & Pharmaceuticals' }, - { value: 'media-telecom', label: 'Media & Telecom' }, - { value: 'retail-consumer', label: 'Retail & Consumer' }, - { value: 'sustainable-business', label: 'Sustainable Business' }, - { value: 'charged', label: 'Charged' }, - { value: 'future-of-health', label: 'Future of Health' }, - { value: 'future-of-money', label: 'Future of Money' }, - { value: 'take-five', label: 'Take Five' }, - { value: 'reuters-impact', label: 'Reuters Impact' }, - // Legal topics - { value: 'government', label: 'Government' }, - { value: 'legalindustry', label: 'Legal Industry' }, - { value: 'litigation', label: 'Litigation' }, - { value: 'transactional', label: 'Transactional' }, - ], - default: 'us', - }, + topic: 'find it in the URL, or tables below, leave empty for `All`', }, features: { requireConfig: false, @@ -82,7 +45,7 @@ export const route: Route = { }, ], name: 'Category/Topic/Author', - maintainers: ['LyleLee', 'HenryQW', 'proletarius101', 'black-desk', 'nczitzk'], + maintainers: ['LyleLee', 'HenryQW', 'proletarius101', 'black-desk', 'nczitzk', 'pseudoyu'], handler, description: `- \`:category\`: @@ -127,128 +90,166 @@ async function handler(ctx) { const useSophi = ctx.req.query('sophi') === 'true' && topic !== '' && CAN_USE_SOPHI.includes(category); const section_id = `/${category}/${topic ? `${topic}/` : ''}`; - const { title, description, rootUrl, response } = await (async () => { - if (MUST_FETCH_BY_TOPICS.has(category)) { - const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-topic-v1'; - const response = await ofetch(rootUrl, { - query: { - query: JSON.stringify({ - offset: 0, - size: limit, - topic_url: section_id, - website: 'reuters', - }), - }, - }); - return { - title: `${response.result.topics[0].name} | Reuters`, - description: response.result.topics[0].entity_id, - rootUrl, - response, - }; - } else { - const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-section-alias-or-id-v1'; - const response = await ofetch(rootUrl, { - query: { - query: JSON.stringify({ - offset: 0, - size: limit, - section_id, - website: 'reuters', - ...(useSophi - ? { - fetch_type: 'sophi', - sophi_page: '*', - sophi_widget: 'topic', - } - : {}), - }), - }, - }); - return { - title: response.result.section.title, - description: response.result.section.section_about, - rootUrl, - response, - }; - } - })(); - - let items = response.result.articles.map((e) => ({ - title: e.title, - link: new URL(e.canonical_url, rootUrl).href, - guid: e.id, - pubDate: parseDate(e.published_time), - updated: parseDate(e.updated_time), - author: e.authors.map((e) => e.name).join(', '), - category: e.kicker.names, - description: e.description, - })); - - items = items.filter((e, i) => items.findIndex((f) => e.guid === f.guid) === i); - - const results = await Promise.allSettled( - items.map((item) => - ctx.req.query('fulltext') === 'true' - ? cache.tryGet(item.link, async () => { - const detailResponse = await ofetch(item.link); - const content = load(detailResponse.data); - - if (detailResponse.url.startsWith('https://www.reuters.com/investigates/')) { - const ldJson = JSON.parse(content('script[type="application/ld+json"]').text()); - content('.special-report-article-container .container, #slide-dek, #slide-end, .share-in-article-container').remove(); - - item.title = ldJson.headline; - item.pubDate = parseDate(ldJson.dateCreated); - item.author = ldJson.creator; - item.category = ldJson.keywords; - item.description = content('.special-report-article-container').html(); + try { + const { title, description, rootUrl, response } = await (async () => { + if (MUST_FETCH_BY_TOPICS.has(category)) { + const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-topic-v1'; + const response = await ofetch(rootUrl, { + query: { + query: JSON.stringify({ + offset: 0, + size: limit, + topic_url: section_id, + website: 'reuters', + }), + }, + }); + + return { + title: `${response.result.topics[0].name} | Reuters`, + description: response.result.topics[0].entity_id, + rootUrl, + response, + }; + } else { + const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-section-alias-or-id-v1'; + const response = await ofetch(rootUrl, { + query: { + query: JSON.stringify({ + offset: 0, + size: limit, + section_id, + website: 'reuters', + ...(useSophi + ? { + fetch_type: 'sophi', + sophi_page: '*', + sophi_widget: 'topic', + } + : {}), + }), + }, + }); + return { + title: response.result.section.title, + description: response.result.section.section_about, + rootUrl, + response, + }; + } + })(); + + let items = response.result.articles.map((e) => ({ + title: e.title, + link: new URL(e.canonical_url, rootUrl).href, + guid: e.id, + pubDate: parseDate(e.published_time), + updated: parseDate(e.updated_time), + author: e.authors.map((e) => e.name).join(', '), + category: e.kicker.names, + description: e.description, + })); + + items = items.filter((e, i) => items.findIndex((f) => e.guid === f.guid) === i); + + const results = await Promise.allSettled( + items.map((item) => + ctx.req.query('fulltext') === 'true' + ? cache.tryGet(item.link, async () => { + const detailResponse = await ofetch(item.link); + const content = load(detailResponse.data); + + if (detailResponse.url.startsWith('https://www.reuters.com/investigates/')) { + const ldJson = JSON.parse(content('script[type="application/ld+json"]').text()); + content('.special-report-article-container .container, #slide-dek, #slide-end, .share-in-article-container').remove(); + + item.title = ldJson.headline; + item.pubDate = parseDate(ldJson.dateCreated); + item.author = ldJson.creator; + item.category = ldJson.keywords; + item.description = content('.special-report-article-container').html(); + + return item; + } + + const matches = content('script#fusion-metadata') + .text() + .match(/Fusion.globalContent=({[\S\s]*?});/); + + if (matches) { + const data = JSON.parse(matches[1]); + + item.title = data.result.title || item.title; + item.description = art(path.join(__dirname, 'templates/description.art'), { + result: data.result, + }); + item.pubDate = parseDate(data.result.display_time); + item.author = data.result.authors.map((author) => author.name).join(', '); + item.category = data.result.taxonomy.keywords; + + return item; + } + + content('.title').remove(); + content('.article-metadata').remove(); + + item.title = content('meta[property="og:title"]').attr('content'); + item.pubDate = parseDate(detailResponse.data.match(/"datePublished":"(.*?)","dateModified/)[1]); + item.author = detailResponse.data + .match(/{"@type":"Person","name":"(.*?)"}/g) + .map((p) => p.match(/"name":"(.*?)"/)[1]) + .join(', '); + item.description = content('article').html(); return item; - } + }) + : item + ) + ); + items = results.filter((r) => r.status === 'fulfilled').map((r) => r.value); + + return { + title, + description, + image: 'https://www.reuters.com/pf/resources/images/reuters/logo-vertical-default-512x512.png?d=116', + link: `https://www.reuters.com${section_id}`, + item: items, + }; + } catch { + // Fallback to arc outboundfeeds if API fails + const arcUrl = topic ? `https://www.reuters.com/arc/outboundfeeds/v4/mobile/section${section_id}?outputType=json` : `https://www.reuters.com/arc/outboundfeeds/v4/mobile/section/${category}/?outputType=json`; + + const arcResponse = await ofetch(arcUrl); + if (arcResponse.wireitems?.length) { + const items = arcResponse.wireitems + .map((item) => { + const story = item.templates.find((t) => t.template === 'story_with_image')?.story; + if (!story) { + return null; + } + + return { + title: story.hed, + link: item.templates.find((t) => t.template === 'story_with_image')?.template_action?.url, + guid: story.usn, + pubDate: parseDate(story.updated_at), + updated: parseDate(story.updated_at), + description: story.lede, + author: story.authors?.map((author) => author.name).join(', '), + category: [arcResponse.analytics?.topic_channel, arcResponse.analytics?.topic_sub_channel].filter(Boolean), + }; + }) + .filter(Boolean); - const matches = content('script#fusion-metadata') - .text() - .match(/Fusion.globalContent=({[\S\s]*?});/); - - if (matches) { - const data = JSON.parse(matches[1]); - - item.title = data.result.title || item.title; - item.description = art(path.join(__dirname, 'templates/description.art'), { - result: data.result, - }); - item.pubDate = parseDate(data.result.display_time); - item.author = data.result.authors.map((author) => author.name).join(', '); - item.category = data.result.taxonomy.keywords; - - return item; - } - - content('.title').remove(); - content('.article-metadata').remove(); - - item.title = content('meta[property="og:title"]').attr('content'); - item.pubDate = parseDate(detailResponse.data.match(/"datePublished":"(.*?)","dateModified/)[1]); - item.author = detailResponse.data - .match(/{"@type":"Person","name":"(.*?)"}/g) - .map((p) => p.match(/"name":"(.*?)"/)[1]) - .join(', '); - item.description = content('article').html(); - - return item; - }) - : item - ) - ); - items = results.filter((r) => r.status === 'fulfilled').map((r) => r.value); - - return { - title, - description, - image: 'https://www.reuters.com/pf/resources/images/reuters/logo-vertical-default-512x512.png?d=116', - link: `https://www.reuters.com${section_id}`, - item: items, - }; + return { + title: arcResponse.analytics?.title || `${arcResponse.wire_name} | Reuters`, + description: arcResponse.analytics?.content_title, + image: 'https://www.reuters.com/pf/resources/images/reuters/logo-vertical-default-512x512.png?d=116', + link: arcResponse.canonical_action?.url || `https://www.reuters.com${section_id}`, + category: [arcResponse.analytics?.topic_channel, arcResponse.analytics?.topic_sub_channel].filter(Boolean), + item: items.slice(0, limit), + }; + } + } }
94399981e048e4c48468ead2b3c1b839feba1660
2024-09-09 17:29:00
dependabot[bot]
chore(deps): bump tldts from 6.1.42 to 6.1.43 (#16674)
false
bump tldts from 6.1.42 to 6.1.43 (#16674)
chore
diff --git a/package.json b/package.json index cc0bb11e26f338..6810558a8a2b9e 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "telegram": "2.24.11", "tiny-async-pool": "2.1.0", "title": "3.5.3", - "tldts": "6.1.42", + "tldts": "6.1.43", "tosource": "2.0.0-alpha.3", "tough-cookie": "4.1.4", "tsx": "4.19.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80db09fbf773a6..a968470e6199ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -228,8 +228,8 @@ importers: specifier: 3.5.3 version: 3.5.3 tldts: - specifier: 6.1.42 - version: 6.1.42 + specifier: 6.1.43 + version: 6.1.43 tosource: specifier: 2.0.0-alpha.3 version: 2.0.0-alpha.3 @@ -1806,8 +1806,8 @@ packages: resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} - '@sindresorhus/[email protected]': - resolution: {integrity: sha512-WDTlVTyvFivSOuyvMeedzg2hdoBLZ3f1uNVuEida2Rl9BrfjrIRjWA/VZIrMRLvSwJYCAlCRA3usDt1THytxWQ==} + '@sindresorhus/[email protected]': + resolution: {integrity: sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==} engines: {node: '>=18'} '@stylistic/[email protected]': @@ -2034,8 +2034,8 @@ packages: '@ungap/[email protected]': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@unhead/[email protected]': - resolution: {integrity: sha512-nX9sJgKPy2t4GHB9ky/vkMLbYqXl9Num5NZToTr0rKrIGkshzHhUrbn/EiHreIjcGI1eIpu+edniCDIwGTJgmw==} + '@unhead/[email protected]': + resolution: {integrity: sha512-oEl5vV3+zZyY1Y3PVE1+gWNMj2wJczP6w0gscp8RnFRSik9p94XqYzBnzeb0tezIyVJWKWycGne9ocV0uGHbzw==} '@vercel/[email protected]': resolution: {integrity: sha512-Rioz3LJkEKicKCi9BSyc1RXZ5R6GmXosFMeBSThh6msWSOiArKhb7c75MiWwZEgPL7x0/l3TAfH/l0cxKNuUFA==} @@ -2366,8 +2366,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - [email protected]: - resolution: {integrity: sha512-N2YVqWbJELVdrnsW5p+apoQyYt51aBMSsBZki1XZEfeBCexcM/sf4xiAHcXQBkuOwJBXtWF7aW1sYX6tKebPHw==} + [email protected]: + resolution: {integrity: sha512-Qxxyfv3RdHAfJcXelgf0hU4DFUVXBGTjqrBUZLUh8AtlGnsDo+CnncYtTd95+ZKfnANUOzxyIQCuU/UeBZBYoA==} [email protected]: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -2611,8 +2611,8 @@ packages: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - [email protected]: - resolution: {integrity: sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==} + [email protected]: + resolution: {integrity: sha512-h66W1URKpBS5YMI/V8PyXvTMFT8SupJ1IzoIV8IeBC/ji8WVmrO8dGlTi+2dh6whmdk6BiKJLD/ZBkhWbcg6nA==} engines: {node: '>=18'} [email protected]: @@ -2821,8 +2821,8 @@ packages: engines: {node: '>=14'} hasBin: true - [email protected]: - resolution: {integrity: sha512-2gQpi2WYobXmz2q23FrOBYTLcI1O/P4heW3eqX+ldmPVDQELRqhiebV380EhlGG12NtnX1qbK/FHpN0ba+7bLA==} + [email protected]: + resolution: {integrity: sha512-1OfuVACu+zKlmjsNdcJuVQuVE61sZOLbNM4JAQ1Rvh6EOj0/EUKhMJjRH73InPlXSh8HIJk1cVZ8pyOV/FMdUQ==} [email protected]: resolution: {integrity: sha512-5gxbEjcb/Z2n6TTmXZx9wVi3N/DOzE7RXY3Xg9dakDuhX/izwumB9rGjeWUV6dTA0D0+juvo+JonZgNR9sgA5A==} @@ -4936,9 +4936,6 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - [email protected]: - resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} - [email protected]: resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==} @@ -5077,8 +5074,8 @@ packages: [email protected]: resolution: {integrity: sha512-NGipjjRicyJJ03rPiZCJYjwlsuP2d1/5QUviozRXC7S3WdVWNK5e3Ojieb9CCyfhq2UC+3+SRd9nG3I2lPRvUw==} - [email protected]: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + [email protected]: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} [email protected]: @@ -5304,8 +5301,8 @@ packages: resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} - [email protected]: - resolution: {integrity: sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==} + [email protected]: + resolution: {integrity: sha512-Zl/ko7fioZvaflejqwgnWwnTjr3K562tmyNFZADyRWYLXxkr2g+cuZ+lP+s2GRUV0PVCqqoDu0Rmx4fzdJnrZw==} engines: {node: '>=14.0.0'} [email protected]: @@ -5324,11 +5321,11 @@ packages: resolution: {integrity: sha512-YY4ei7K7gPGifqNSrfMaPdqTqiHcwYKUJ7zhLqQOK2ildlGgti5TSwJiXXN1YqG17I2GYZh5cZqv2r5fwBUM+w==} hasBin: true - [email protected]: - resolution: {integrity: sha512-MJKxTFpAyUNxST7IrONoeQcFXuF3tQvnVuJ8IRBlA9rzlsAt1speUZSQxai3jrWwxMJ29FWrdpUWBW2pN99Ftw==} + [email protected]: + resolution: {integrity: sha512-iO1G3F2NqtmJUYlTfcH2liSdaqDnjpYn6iGftbLRNx8DF6IRIjbknVt+q0ijwZ2KGZX3J8zeYGFoiI+ZtHT5MQ==} - [email protected]: - resolution: {integrity: sha512-4IQJNZrYPHLVdiaRGmg6X5XrtkwGcfV1BBudNsWlJrl3mXDPEs6IlDzb0rDcgyUx531thK6nT5OA13UpGfZUjA==} + [email protected]: + resolution: {integrity: sha512-5J2v/CbNH8CkwsQV+igsuu0+3eeTfRDn1CFf38a24ZD6FIrbm3DZFu4UrrpoOSejhuP4N1PNDNUvJcw+f4nXNw==} hasBin: true [email protected]: @@ -5460,8 +5457,8 @@ packages: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} engines: {node: '>=10'} - [email protected]: - resolution: {integrity: sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==} + [email protected]: + resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} engines: {node: '>=16'} [email protected]: @@ -7287,7 +7284,7 @@ snapshots: dependencies: openapi-fetch: 0.11.3 ts-case-convert: 2.0.7 - type-fest: 4.26.0 + type-fest: 4.26.1 '@rss3/[email protected]': dependencies: @@ -7311,7 +7308,7 @@ snapshots: dependencies: '@scalar/openapi-types': 0.1.0 '@scalar/themes': 0.9.28 - '@unhead/schema': 1.10.4 + '@unhead/schema': 1.11.1 '@sec-ant/[email protected]': {} @@ -7354,7 +7351,7 @@ snapshots: '@sindresorhus/[email protected]': {} - '@sindresorhus/[email protected]': {} + '@sindresorhus/[email protected]': {} '@stylistic/[email protected]([email protected])([email protected])': dependencies: @@ -7612,7 +7609,7 @@ snapshots: '@ungap/[email protected]': {} - '@unhead/[email protected]': + '@unhead/[email protected]': dependencies: hookable: 5.5.3 zhead: 2.2.4 @@ -7677,7 +7674,7 @@ snapshots: '@vitest/[email protected]': dependencies: - tinyspy: 3.0.0 + tinyspy: 3.0.1 '@vitest/[email protected]': dependencies: @@ -7914,8 +7911,8 @@ snapshots: [email protected]: dependencies: - caniuse-lite: 1.0.30001658 - electron-to-chromium: 1.5.16 + caniuse-lite: 1.0.30001659 + electron-to-chromium: 1.5.18 node-releases: 2.0.18 update-browserslist-db: 1.1.0([email protected]) @@ -7989,7 +7986,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -8263,9 +8260,9 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: - rrweb-cssom: 0.6.0 + rrweb-cssom: 0.7.1 [email protected]: {} @@ -8456,7 +8453,7 @@ snapshots: minimatch: 9.0.1 semver: 7.6.3 - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -9223,7 +9220,7 @@ snapshots: [email protected]: dependencies: - '@sindresorhus/is': 7.0.0 + '@sindresorhus/is': 7.0.1 '@szmarczak/http-timer': 5.0.1 cacheable-lookup: 7.0.0 cacheable-request: 12.0.1 @@ -9233,7 +9230,7 @@ snapshots: lowercase-keys: 3.0.0 p-cancelable: 4.0.1 responselike: 3.0.0 - type-fest: 4.26.0 + type-fest: 4.26.1 [email protected]: {} @@ -9639,7 +9636,7 @@ snapshots: [email protected]([email protected])([email protected]): dependencies: - cssstyle: 4.0.1 + cssstyle: 4.1.0 data-urls: 5.0.0 decimal.js: 10.4.3 form-data: 4.0.0 @@ -9915,7 +9912,7 @@ snapshots: dependencies: '@babel/parser': 7.25.6 '@babel/types': 7.25.6 - source-map-js: 1.2.0 + source-map-js: 1.2.1 [email protected]: dependencies: @@ -10224,7 +10221,7 @@ snapshots: outvariant: 1.4.3 path-to-regexp: 6.2.2 strict-event-emitter: 0.5.1 - type-fest: 4.26.0 + type-fest: 4.26.1 yargs: 17.7.2 optionalDependencies: typescript: 5.5.4 @@ -10545,7 +10542,7 @@ snapshots: dependencies: nanoid: 3.3.7 picocolors: 1.1.0 - source-map-js: 1.2.0 + source-map-js: 1.2.1 [email protected]: dependencies: @@ -10934,8 +10931,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.21.2 fsevents: 2.3.3 - [email protected]: {} - [email protected]: {} [email protected]: @@ -11077,7 +11072,7 @@ snapshots: dependencies: atomic-sleep: 1.0.0 - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -11322,7 +11317,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies: @@ -11337,11 +11332,11 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} - [email protected]: + [email protected]: dependencies: - tldts-core: 6.1.42 + tldts-core: 6.1.43 [email protected]: dependencies: @@ -11444,7 +11439,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: {}
2992e73891947c3edb19456b3455bd025e158363
2022-08-15 21:08:55
Fatpandac
fix(route): appledaily change selector and url (#10467)
false
appledaily change selector and url (#10467)
fix
diff --git a/lib/v2/appledaily/index.js b/lib/v2/appledaily/index.js index f7ccc70d437153..086af987157b94 100644 --- a/lib/v2/appledaily/index.js +++ b/lib/v2/appledaily/index.js @@ -1,8 +1,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); -const path = require('path'); -const { art } = require('@/utils/render'); +const timezone = require('@/utils/timezone'); const rootUrl = 'https://tw.appledaily.com'; @@ -26,7 +25,7 @@ const channelMap = { module.exports = async (ctx) => { const channel = ctx.params.channel ?? 'home'; - const url = `${rootUrl}${channel === 'home' ? '/home' : `/realtime/${channel}`}`; + const url = `${rootUrl}${channel === 'home' ? '/' : `/realtime/${channel}`}`; const response = await got.get(url); const $ = cheerio.load(response.data); @@ -34,8 +33,8 @@ module.exports = async (ctx) => { .slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 25) .map((_, item) => { const title = $(item).find('span.headline').text(); - const link = rootUrl + $(item).find('a').attr('href'); - const pubDate = parseDate($(item).find('div.timestamp').text(), 'YYYY/MM/DD HH:mm'); + const link = $(item).find('a').attr('href'); + const pubDate = timezone(parseDate($(item).find('div.timestamp').text(), 'YYYY/MM/DD HH:mm'), +8); return { title, @@ -48,13 +47,10 @@ module.exports = async (ctx) => { const items = await Promise.all( list.map((item) => ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got.get(item.link); + const detailResponse = await got(item.link); const content = cheerio.load(detailResponse.data); - const dataJs = content('script#fusion-metadata').html(); - const descDataJSON = JSON.parse(dataJs.match(/Fusion.globalContent=(.*);Fusion.globalConte/)[1]); - item.description = art(path.join(__dirname, 'templates/content.art'), { - content_elements: descDataJSON.content_elements, - }); + content('.TW-DESKTOP-AD, .TW-MOBILE-AD, .TW-MOBILE-AD-WRAP').remove(); + item.description = content('div.promo-item-container.box--position-relative') + content('#articleBody').html(); return item; }) diff --git a/lib/v2/appledaily/templates/content.art b/lib/v2/appledaily/templates/content.art deleted file mode 100644 index 886c0a8b3e4906..00000000000000 --- a/lib/v2/appledaily/templates/content.art +++ /dev/null @@ -1,7 +0,0 @@ -{{ each content_elements }} - {{ if $value.type === 'image' }} - <img src="{{ $value.url }}" alt="{{ $value.caption }}"/> - {{ else if $value.type === 'text' }} - <p>{{ $value.content }}</p> - {{ /if }} -{{ /each }}
c2acbe1d2f9c6abba303ce5812ebeb3db880a069
2024-11-11 14:01:28
dependabot[bot]
chore(deps-dev): bump vite-tsconfig-paths from 5.1.0 to 5.1.2 (#17534)
false
bump vite-tsconfig-paths from 5.1.0 to 5.1.2 (#17534)
chore
diff --git a/package.json b/package.json index 9a8b96b46b46bc..5996249273cb41 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ "supertest": "7.0.0", "typescript": "5.6.3", "unified": "11.0.5", - "vite-tsconfig-paths": "5.1.0", + "vite-tsconfig-paths": "5.1.2", "vitest": "2.0.5", "yaml-eslint-parser": "1.2.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d3092e881e998e..80b905931e84b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -433,8 +433,8 @@ importers: specifier: 11.0.5 version: 11.0.5 vite-tsconfig-paths: - specifier: 5.1.0 - version: 5.1.0([email protected])([email protected](@types/[email protected])) + specifier: 5.1.2 + version: 5.1.2([email protected])([email protected](@types/[email protected])) vitest: specifier: 2.0.5 version: 2.0.5(@types/[email protected])([email protected]([email protected])([email protected])) @@ -5639,8 +5639,8 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - [email protected]: - resolution: {integrity: sha512-Y1PLGHCJfAq1Zf4YIGEsmuU/NCX1epoZx9zwSr32Gjn3aalwQHRKr5aUmbo6r0JHeHkqmWpmDg7WOynhYXw1og==} + [email protected]: + resolution: {integrity: sha512-gEIbKfJzSEv0yR3XS2QEocKetONoWkbROj6hGx0FHM18qKUojhvcokQsxQx5nMkelZq2n37zbSGCJn+FSODSjA==} peerDependencies: vite: '*' peerDependenciesMeta: @@ -11642,7 +11642,7 @@ snapshots: - supports-color - terser - [email protected]([email protected])([email protected](@types/[email protected])): + [email protected]([email protected])([email protected](@types/[email protected])): dependencies: debug: 4.3.7 globrex: 0.1.2
23f3dbda49b36de19a76af856dbc89a43072292a
2024-12-10 18:54:57
dependabot[bot]
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#17848)
false
bump @typescript-eslint/eslint-plugin (#17848)
chore
diff --git a/package.json b/package.json index 6125ef078fbbe2..157fd8ed798b16 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "@types/tiny-async-pool": "2.0.3", "@types/title": "3.4.3", "@types/uuid": "10.0.0", - "@typescript-eslint/eslint-plugin": "8.17.0", + "@typescript-eslint/eslint-plugin": "8.18.0", "@typescript-eslint/parser": "8.18.0", "@vercel/nft": "0.27.9", "@vitest/coverage-v8": "2.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 12cfac1379e11f..cb8a083637ffb3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -362,8 +362,8 @@ importers: specifier: 10.0.0 version: 10.0.0 '@typescript-eslint/eslint-plugin': - specifier: 8.17.0 - version: 8.17.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) + specifier: 8.18.0 + version: 8.18.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) '@typescript-eslint/parser': specifier: 8.18.0 version: 8.18.0([email protected])([email protected]) @@ -1995,16 +1995,13 @@ packages: '@types/[email protected]': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' '@typescript-eslint/[email protected]': resolution: {integrity: sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==} @@ -2021,15 +2018,12 @@ packages: resolution: {integrity: sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' '@typescript-eslint/[email protected]': resolution: {integrity: sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==} @@ -2064,6 +2058,13 @@ packages: typescript: optional: true + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -7370,20 +7371,19 @@ snapshots: '@types/node': 22.10.1 optional: true - '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': + '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': dependencies: '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 8.18.0([email protected])([email protected]) - '@typescript-eslint/scope-manager': 8.17.0 - '@typescript-eslint/type-utils': 8.17.0([email protected])([email protected]) - '@typescript-eslint/utils': 8.17.0([email protected])([email protected]) - '@typescript-eslint/visitor-keys': 8.17.0 + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/type-utils': 8.18.0([email protected])([email protected]) + '@typescript-eslint/utils': 8.18.0([email protected])([email protected]) + '@typescript-eslint/visitor-keys': 8.18.0 eslint: 9.16.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 ts-api-utils: 1.4.0([email protected]) - optionalDependencies: typescript: 5.7.2 transitivePeerDependencies: - supports-color @@ -7410,14 +7410,13 @@ snapshots: '@typescript-eslint/types': 8.18.0 '@typescript-eslint/visitor-keys': 8.18.0 - '@typescript-eslint/[email protected]([email protected])([email protected])': + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: - '@typescript-eslint/typescript-estree': 8.17.0([email protected]) - '@typescript-eslint/utils': 8.17.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 8.18.0([email protected]) + '@typescript-eslint/utils': 8.18.0([email protected])([email protected]) debug: 4.3.7 eslint: 9.16.0 ts-api-utils: 1.4.0([email protected]) - optionalDependencies: typescript: 5.7.2 transitivePeerDependencies: - supports-color @@ -7467,6 +7466,17 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/[email protected]([email protected])([email protected])': + dependencies: + '@eslint-community/eslint-utils': 4.4.1([email protected]) + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/typescript-estree': 8.18.0([email protected]) + eslint: 9.16.0 + typescript: 5.7.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/[email protected]': dependencies: '@typescript-eslint/types': 8.17.0
126cd702e12eb7e11e05d5941cfd3153927e3c74
2023-12-26 04:24:31
dependabot[bot]
chore(deps): bump @sentry/node from 7.89.0 to 7.91.0 (#14115)
false
bump @sentry/node from 7.89.0 to 7.91.0 (#14115)
chore
diff --git a/package.json b/package.json index 02f9ca5dc97a31..0cdee83474078a 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "@koa/router": "12.0.1", "@notionhq/client": "2.2.14", "@postlight/parser": "2.2.3", - "@sentry/node": "7.89.0", + "@sentry/node": "7.91.0", "@tonyrl/rand-user-agent": "2.0.43", "aes-js": "3.1.2", "art-template": "4.13.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17ba01ecf4d0b4..513d721159fcab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ dependencies: specifier: 2.2.3 version: 2.2.3 '@sentry/node': - specifier: 7.89.0 - version: 7.89.0 + specifier: 7.91.0 + version: 7.91.0 '@tonyrl/rand-user-agent': specifier: 2.0.43 version: 2.0.43 @@ -1269,46 +1269,46 @@ packages: selderee: 0.11.0 dev: false - /@sentry-internal/[email protected]: - resolution: {integrity: sha512-cSwno2NYteBBqOvcm/ue9cJxGGl2uffG4laEyLR9y4we+bYxigfx/Ki2TFOtwXrv5o59eRAtN1lpzaAf43yfBw==} + /@sentry-internal/[email protected]: + resolution: {integrity: sha512-JH5y6gs6BS0its7WF2DhySu7nkhPDfZcdpAXldxzIlJpqFkuwQKLU5nkYJpiIyZz1NHYYtW5aum2bV2oCOdDRA==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.89.0 - '@sentry/types': 7.89.0 - '@sentry/utils': 7.89.0 + '@sentry/core': 7.91.0 + '@sentry/types': 7.91.0 + '@sentry/utils': 7.91.0 dev: false - /@sentry/[email protected]: - resolution: {integrity: sha512-aU3wfZ+tyFi4T06fOH3z5xnTyMzwvzyEohYOmnQnDrqNgvDzjWkyeUzWse9FaFiut8lBN9O+Pd2H0ucPBMPEhQ==} + /@sentry/[email protected]: + resolution: {integrity: sha512-tu+gYq4JrTdrR+YSh5IVHF0fJi/Pi9y0HZ5H9HnYy+UMcXIotxf6hIEaC6ZKGeLWkGXffz2gKpQLe/g6vy/lPA==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.89.0 - '@sentry/utils': 7.89.0 + '@sentry/types': 7.91.0 + '@sentry/utils': 7.91.0 dev: false - /@sentry/[email protected]: - resolution: {integrity: sha512-3uP0HtwsrTKOUi+Az8j/E2YQA9sjHWWLrNo2CiZVOtQNYtH8SZqQeTrnOi9bqhM7NyHtKz1JrXzttj/LWkUvRA==} + /@sentry/[email protected]: + resolution: {integrity: sha512-hTIfSQxD7L+AKIqyjoq8CWBRkEQrrMZmA3GSZgPI5JFWBHgO0HBo5TH/8TU81oEJh6kqqHAl2ObMhmcnaFqlzg==} engines: {node: '>=8'} dependencies: - '@sentry-internal/tracing': 7.89.0 - '@sentry/core': 7.89.0 - '@sentry/types': 7.89.0 - '@sentry/utils': 7.89.0 + '@sentry-internal/tracing': 7.91.0 + '@sentry/core': 7.91.0 + '@sentry/types': 7.91.0 + '@sentry/utils': 7.91.0 https-proxy-agent: 5.0.1 transitivePeerDependencies: - supports-color dev: false - /@sentry/[email protected]: - resolution: {integrity: sha512-5Rqt6vIP652p01ypUaEIrELjsHF0vUnzj/JFz+i7nXv6w77GPpNzeIlMYdnauBIgJhLUvYCTQaOPV9GhgZhc4g==} + /@sentry/[email protected]: + resolution: {integrity: sha512-bcQnb7J3P3equbCUc+sPuHog2Y47yGD2sCkzmnZBjvBT0Z1B4f36fI/5WjyZhTjLSiOdg3F2otwvikbMjmBDew==} engines: {node: '>=8'} dev: false - /@sentry/[email protected]: - resolution: {integrity: sha512-t6qDQajdAjZ6LPraAWO00ZjvDbNH82DoVGV/2o4C5MBPCutJGTGyWIpI2tliYPZPPx+3C2m5L757zh1dCzrgUg==} + /@sentry/[email protected]: + resolution: {integrity: sha512-fvxjrEbk6T6Otu++Ax9ntlQ0sGRiwSC179w68aC3u26Wr30FAIRKqHTCCdc2jyWk7Gd9uWRT/cq+g8NG/8BfSg==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.89.0 + '@sentry/types': 7.91.0 dev: false /@sinclair/[email protected]:
57da1ea4638e7e79a97d63bfeec94bae465c85cf
2019-06-22 14:15:58
Enoch Ma
feat: nautilus (topics) (#2459)
false
nautilus (topics) (#2459)
feat
diff --git a/docs/reading.md b/docs/reading.md index 9190134efc6697..25d14cc08b252c 100644 --- a/docs/reading.md +++ b/docs/reading.md @@ -10,6 +10,12 @@ pageClass: routes <Route author="HenryQW" example="/allpoetry/newest" path="/allpoetry/:order?" :paramsDesc="['排序方式, `best` 或 `newest`, 缺省 `best`']"/> +## Nautilus + +### 话题 + +<Route author="emdoe" example=“/nautilus/topic/Art” path="/nautilus/topic/:tid" :paramsDesc=“[‘话题 id, 可在页面上方 TOPICS 栏目处找到']"/> + ## UU 看书 ### 小说更新 diff --git a/lib/router.js b/lib/router.js index e9249b06f1e0f3..7f2f21c4cace0d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -905,6 +905,9 @@ router.get('/coolbuy/newest', require('./routes/coolbuy/newest')); router.get('/nga/forum/:fid', require('./routes/nga/forum')); router.get('/nga/post/:tid', require('./routes/nga/post')); +// Nautilus +router.get('/nautilus/topic/:tid', require('./routes/nautilus/topics')); + // JavBus router.get('/javbus/home', require('./routes/javbus/home')); router.get('/javbus/genre/:gid', require('./routes/javbus/genre')); diff --git a/lib/routes/nautilus/topics.js b/lib/routes/nautilus/topics.js new file mode 100644 index 00000000000000..8046eda3afdf1d --- /dev/null +++ b/lib/routes/nautilus/topics.js @@ -0,0 +1,41 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const url = `http://nautil.us/term/f/${ctx.params.tid}`; + + const res = await got.get(url); + const $ = cheerio.load(res.data); + const list = $('article.search-result').get(); + + const out = await Promise.all( + list.map(async (item) => { + const $ = cheerio.load(item); + const title = $('h3 > a').text(); + const partial = $('h3 > a').attr('href'); + const address = `http://nautil.us${partial}`; + const cache = await ctx.cache.get(address); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + const res = await got.get(address); + const capture = cheerio.load(res.data); + capture('div.reco').remove(); + const banner = capture('div.banner').html(); + const contents = banner + capture('div.page-content').html(); + const single = { + title, + description: contents, + link: address, + guid: address, + }; + ctx.cache.set(address, JSON.stringify(single)); + return Promise.resolve(single); + }) + ); + ctx.state.data = { + title: 'Nautilus | ' + $('title').text(), + link: url, + item: out, + }; +};
e296cf39c05ed0bf50664622f6b54f1eb99bdd6b
2023-07-20 21:32:05
Andvari
fix(route): AP News时区调整 (#12842)
false
AP News时区调整 (#12842)
fix
diff --git a/lib/v2/apnews/topics.js b/lib/v2/apnews/topics.js index 394836b980dbc1..573fb2baf5d78c 100644 --- a/lib/v2/apnews/topics.js +++ b/lib/v2/apnews/topics.js @@ -1,5 +1,6 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); +const timezone = require('@/utils/timezone'); const HOME_PAGE = 'https://apnews.com'; module.exports = async (ctx) => { @@ -21,8 +22,8 @@ module.exports = async (ctx) => { const $ = cheerio.load(response); $('div.Enhancement').remove(); return Object.assign(item, { - pubDate: new Date($("meta[property='article:published_time']").attr('content')), - updated: new Date($("meta[property='article:modified_time']").attr('content')), + pubDate: timezone(new Date($("meta[property='article:published_time']").attr('content')), 0), + updated: timezone(new Date($("meta[property='article:modified_time']").attr('content')), 0), description: $('div.RichTextStoryBody').html(), category: $("meta[property='article:section']").attr('content'), guid: $("meta[name='brightspot.contentId']").attr('content'),
b17d3605c89eec1caab406ec8ffceee2d5ac9b39
2024-12-10 14:14:18
dependabot[bot]
chore(deps-dev): bump discord-api-types from 0.37.110 to 0.37.111 (#17849)
false
bump discord-api-types from 0.37.110 to 0.37.111 (#17849)
chore
diff --git a/package.json b/package.json index 9430935074421d..9c7b01527f366c 100644 --- a/package.json +++ b/package.json @@ -171,7 +171,7 @@ "@typescript-eslint/parser": "8.17.0", "@vercel/nft": "0.27.7", "@vitest/coverage-v8": "2.0.5", - "discord-api-types": "0.37.110", + "discord-api-types": "0.37.111", "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-nibble": "8.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8e27b13d2b34f6..8e95d21e5dd059 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -374,8 +374,8 @@ importers: specifier: 2.0.5 version: 2.0.5([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) discord-api-types: - specifier: 0.37.110 - version: 0.37.110 + specifier: 0.37.111 + version: 0.37.111 eslint: specifier: 9.16.0 version: 9.16.0 @@ -2768,8 +2768,8 @@ packages: resolution: {integrity: sha512-d9paCbverdqmuwR+B40phSqiHhgPKiP8dpsMz5WT9U6ug2VVQ3tqXNCedpa6iGHg6mgv9lHaoq5DJUu2IXMjsQ==} engines: {node: '>=18.17.0'} - [email protected]: - resolution: {integrity: sha512-wVaAJkrSgNRo8nd523qKYPqkClTNHhjKOk/g6265rzHuc7TNS6Ivz06DPW4iZvnhFobbH95hKlgsRf6jcAbtlA==} + [email protected]: + resolution: {integrity: sha512-22O4/mjfcLaQ8bbJorGpzFThnjhd8/exQxFscP3fnyJPo9Fk9O5GkWDIremYbvuw4YiwMfssWFniIb/iAwRqTg==} [email protected]: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} @@ -8231,7 +8231,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies:
07825f1340bcb8ba5931dd9a5172aaa9d8b59c24
2023-06-28 22:18:28
Ethan Shen
fix(route): multiple videos in posts of shuiguopai (#12698)
false
multiple videos in posts of shuiguopai (#12698)
fix
diff --git a/lib/v2/shuiguopai/index.js b/lib/v2/shuiguopai/index.js index 1b555c8e893814..392eac86850039 100644 --- a/lib/v2/shuiguopai/index.js +++ b/lib/v2/shuiguopai/index.js @@ -6,11 +6,13 @@ const { art } = require('@/utils/render'); const path = require('path'); module.exports = async (ctx) => { - const rootUrl = 'http://shuiguopai.com'; + const rootUrl = 'https://sgp3.fun'; const apiRootUrl = 'https://api.cbbee0.com'; const listUrl = `${apiRootUrl}/v1_2/homePage`; const filmUrl = `${apiRootUrl}/v1_2/filmInfo`; + const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 50; + const response = await got({ method: 'post', url: listUrl, @@ -18,7 +20,7 @@ module.exports = async (ctx) => { device_id: '', hm: '008-api', last_page: 0, - length: 3, + length: limit, ltype: 1, page: 1, userToken: '', @@ -48,18 +50,20 @@ module.exports = async (ctx) => { url: filmUrl, json: { device_id: '', - film_id: detailResponse.data.match(/film_id:"(\d+)",/)[1], + film_id: detailResponse.data.match(/film_id:"([\d,]+)",/)[1], hm: '008-api', userToken: '', }, }); - const data = infoResponse.data.data[0]; + const data = infoResponse.data.data; + + const videos = data.map((d) => d.download_url); - item.author = data.actor; - item.category = data.tags.map((t) => t.tag_title); + item.category = data.flatMap((d) => d.tags.map((t) => t.tag_title)); + item.author = data.map((d) => d.actor).join(' '); item.description = art(path.join(__dirname, 'templates/description.art'), { - video: data.download_url, + videos, description: content('.content').html(), }); diff --git a/lib/v2/shuiguopai/templates/description.art b/lib/v2/shuiguopai/templates/description.art index 2609b35e34d42c..8687d7eee03128 100644 --- a/lib/v2/shuiguopai/templates/description.art +++ b/lib/v2/shuiguopai/templates/description.art @@ -1,6 +1,8 @@ -{{ if video }} +{{ if videos }} +{{ each videos video }} <video controls> <source src="{{ video }}" type="video/mp4"> </video> +{{ /each }} {{ /if }} {{@ description }} \ No newline at end of file
103aae26d8e7ce13d159e7a21c24d11563564a4c
2023-12-21 20:24:12
DIYgod
feat: remove notOperational routes - shopping
false
remove notOperational routes - shopping
feat
diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 72487422807d1a..25fd9eeefa51fd 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -52,7 +52,6 @@ ], }, 'www.chicagotribune.com': { _name: 'Chicago Tribune', www: [{ title: 'Chicago Tribune', docs: 'https://docs.rsshub.app/routes/traditional_media#chicago-tribune', source: '/' }] }, - 'wineyun.com': { _name: '酒云网', www: [{ title: '最新商品', docs: 'https://docs.rsshub.app/routes/other#jiu-yun-wang', source: ['/:category'], target: '/wineyun/:category' }] }, 'playstation.com': { _name: 'PlayStation', store: [ @@ -86,8 +85,6 @@ { title: '新闻', docs: 'https://docs.rsshub.app/routes/other#xin-tian-hui-hai-guan-fang-wang-zhan', source: '/contents/news', target: '/emi-nitta/news' }, ], }, - 'alter-shanghai.cn': { _name: 'Alter', '.': [{ title: '新闻', docs: 'https://docs.rsshub.app/routes/shopping#alter-zhong-guo', source: '/cn/news', target: '/alter-cn/news' }] }, - 'leboncoin.fr': { _name: 'leboncoin', www: [{ title: 'ads', docs: 'https://docs.rsshub.app/routes/shopping#leboncoin', source: '/recherche', target: (params, url) => '/leboncoin/ad/' + url.split('?')[1] }] }, 'yuancheng.work': { _name: '远程.work', '.': [ @@ -306,7 +303,6 @@ }, 'eventernote.com': { _name: 'Eventernote', www: [{ title: '声优活动及演唱会', docs: 'https://docs.rsshub.app/routes/anime#eventernote', source: '/actors/:name/:id/events', target: '/eventernote/actors/:name/:id' }] }, 'huya.com': { _name: '虎牙直播', '.': [{ title: '直播间开播', docs: 'https://docs.rsshub.app/routes/live#hu-ya-zhi-bo-zhi-bo-jian-kai-bo', source: '/:id', target: '/huya/live/:id' }] }, - 'craigslist.org': { _name: 'Craigslist', '.': [{ title: '商品搜索列表', docs: 'https://docs.rsshub.app/routes/shopping#craigslist' }] }, 'scboy.com': { _name: 'scboy 论坛', www: [ diff --git a/lib/radar-rules.js b/lib/radar-rules.js index 828932337654ca..79a6d7321f2d18 100644 --- a/lib/radar-rules.js +++ b/lib/radar-rules.js @@ -66,17 +66,6 @@ module.exports = { }, ], }, - 'wineyun.com': { - _name: '酒云网', - www: [ - { - title: '最新商品', - docs: 'https://docs.rsshub.app/routes/other#jiu-yun-wang', - source: ['/:category'], - target: '/wineyun/:category', - }, - ], - }, 'playstation.com': { _name: 'PlayStation', store: [ @@ -168,30 +157,6 @@ module.exports = { ], }, - 'alter-shanghai.cn': { - _name: 'Alter', - '.': [ - { - title: '新闻', - docs: 'https://docs.rsshub.app/routes/shopping#alter-zhong-guo', - source: '/cn/news.html', - target: '/alter-cn/news', - }, - ], - }, - - 'leboncoin.fr': { - _name: 'leboncoin', - www: [ - { - title: 'ads', - docs: 'https://docs.rsshub.app/routes/shopping#leboncoin', - source: '/recherche', - target: (params, url) => '/leboncoin/ad/' + url.split('?')[1], - }, - ], - }, - 'yuancheng.work': { _name: '远程.work', '.': [ @@ -772,15 +737,6 @@ module.exports = { }, ], }, - 'craigslist.org': { - _name: 'Craigslist', - '.': [ - { - title: '商品搜索列表', - docs: 'https://docs.rsshub.app/routes/shopping#craigslist', - }, - ], - }, 'scboy.com': { _name: 'scboy 论坛', www: [ diff --git a/lib/router.js b/lib/router.js index f040a99395b75d..439c38a506e180 100644 --- a/lib/router.js +++ b/lib/router.js @@ -382,9 +382,6 @@ router.get('/dgtle/trade/search/:keyword', lazyloadRouteHandler('./routes/dgtle/ router.get('/chouti/top/:hour?', lazyloadRouteHandler('./routes/chouti/top')); router.get('/chouti/:subject?', lazyloadRouteHandler('./routes/chouti')); -// Westore -router.get('/westore/new', lazyloadRouteHandler('./routes/westore/new')); - // 龙腾网 router.get('/ltaaa/:category?', lazyloadRouteHandler('./routes/ltaaa/index')); @@ -490,9 +487,6 @@ router.get('/icourse163/newest', lazyloadRouteHandler('./routes/icourse163/newes // patchwork.kernel.org router.get('/patchwork.kernel.org/comments/:id', lazyloadRouteHandler('./routes/patchwork.kernel.org/comments')); -// 京东众筹 -router.get('/jingdong/zhongchou/:type/:status/:sort', lazyloadRouteHandler('./routes/jingdong/zhongchou')); - // All Poetry router.get('/allpoetry/:order?', lazyloadRouteHandler('./routes/allpoetry/order')); @@ -885,15 +879,9 @@ router.get('/socialclub/events/:game?', lazyloadRouteHandler('./routes/socialclu router.get('/ctfhub/upcoming/:limit?', lazyloadRouteHandler('./routes/ctfhub/upcoming')); router.get('/ctfhub/search/:limit?/:form?/:class?/:title?', lazyloadRouteHandler('./routes/ctfhub/search')); -// 礼物说 -router.get('/liwushuo/index', lazyloadRouteHandler('./routes/liwushuo/index.js')); - // 中国日报 router.get('/chinadaily/english/:category', lazyloadRouteHandler('./routes/chinadaily/english.js')); -// leboncoin -router.get('/leboncoin/ad/:query', lazyloadRouteHandler('./routes/leboncoin/ad.js')); - // DHL router.get('/dhl/:id', lazyloadRouteHandler('./routes/dhl/shipment-tracking')); @@ -981,9 +969,6 @@ router.get('/watchface/:watch_type?/:list_type?', lazyloadRouteHandler('./routes router.get('/cnu/selected', lazyloadRouteHandler('./routes/cnu/selected')); router.get('/cnu/discovery/:type?/:category?', lazyloadRouteHandler('./routes/cnu/discovery')); -// 酒云网 -router.get('/wineyun/:category', lazyloadRouteHandler('./routes/wineyun')); - // X-MOL化学资讯平台 // router.get('/x-mol/news/:tag?', lazyloadRouteHandler('./routes/x-mol/news.js')); // router.get('/x-mol/paper/:type/:magazine', lazyloadRouteHandler('./routes/x-mol/paper')); @@ -1047,9 +1032,6 @@ router.get('/whb/:category', lazyloadRouteHandler('./routes/whb/zhuzhan')); // Emi Nitta official website router.get('/emi-nitta/:type', lazyloadRouteHandler('./routes/emi-nitta/home')); -// Alter China -router.get('/alter-cn/news', lazyloadRouteHandler('./routes/alter-cn/news')); - // Visual Studio Code Marketplace router.get('/vscode/marketplace/:type?', lazyloadRouteHandler('./routes/vscode/marketplace')); @@ -1296,9 +1278,6 @@ router.get('/axis-studios/:type/:tag?', lazyloadRouteHandler('./routes/axis-stud // 人民邮电出版社 router.get('/ptpress/book/:type?', lazyloadRouteHandler('./routes/ptpress/book')); -// uniqlo styling book -router.get('/uniqlo/stylingbook/:category?', lazyloadRouteHandler('./routes/uniqlo/stylingbook')); - // unit-image router.get('/unit-image/films/:type?', lazyloadRouteHandler('./routes/unit-image/films')); @@ -1525,15 +1504,6 @@ router.get('/xmind/mindmap/:lang?', lazyloadRouteHandler('./routes/xmind/mindmap // 思维导图社区 router.get('/edrawsoft/mindmap/:classId?/:order?/:sort?/:lang?/:price?/:search?', lazyloadRouteHandler('./routes/edrawsoft/mindmap')); -// 它惠网 -router.get('/tahui/rptlist', lazyloadRouteHandler('./routes/tahui/rptlist')); - -// Guiltfree -router.get('/guiltfree/onsale', lazyloadRouteHandler('./routes/guiltfree/onsale')); - -// 消费明鉴 -router.get('/mingjian', lazyloadRouteHandler('./routes/mingjian/index')); - // hentaimama router.get('/hentaimama/videos', lazyloadRouteHandler('./routes/hentaimama/videos')); @@ -1605,9 +1575,6 @@ router.get('/cktest/policy', lazyloadRouteHandler('./routes/cktest/policy')); // 妈咪帮 router.get('/mamibuy/:caty?/:age?/:sort?', lazyloadRouteHandler('./routes/mamibuy/index')); -// Mercari -router.get('/mercari/:type/:id', lazyloadRouteHandler('./routes/mercari/index')); - // World Economic Forum router.get('/weforum/report/:lang?/:year?/:platform?', lazyloadRouteHandler('./routes/weforum/report')); @@ -1789,9 +1756,6 @@ router.get('/marginnote/tag/:id?', lazyloadRouteHandler('./routes/marginnote/tag // ASML router.get('/asml/press-releases', lazyloadRouteHandler('./routes/asml/press-releases')); -// Craigslist -router.get('/craigslist/:location/:type', lazyloadRouteHandler('./routes/craigslist/search')); - // 有趣天文奇观 router.get('/interesting-sky/astronomical_events/:year?', lazyloadRouteHandler('./routes/interesting-sky/astronomical_events')); router.get('/interesting-sky/recent-interesting', lazyloadRouteHandler('./routes/interesting-sky/recent-interesting')); diff --git a/lib/routes/alter-cn/news.js b/lib/routes/alter-cn/news.js deleted file mode 100644 index acc6e7a2a5d068..00000000000000 --- a/lib/routes/alter-cn/news.js +++ /dev/null @@ -1,44 +0,0 @@ -const url = require('url'); -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const root_url = 'http://alter-shanghai.cn'; - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: url.resolve(root_url, '/cn/news.html'), - }); - - const $ = cheerio.load(response.data); - const list = $('ul.listnews li') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('a'); - const m = /(\d{4}-\d+-\d+)/.exec(item.find('span').text()); - return { - title: a.text(), - link: a.attr('href'), - pubDate: m && new Date(m[1] + ' GMT+8').toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet('alter-cn' + item.link, async () => { - const res = await got({ method: 'get', url: url.resolve(root_url, item.link) }); - const content = cheerio.load(res.data); - item.description = content(content('div.con table.table3')[1]).html(); - return item; - }) - ) - ); - - ctx.state.data = { - title: 'Alter Shanghai', - link: root_url, - item: items, - }; -}; diff --git a/lib/routes/craigslist/search.js b/lib/routes/craigslist/search.js deleted file mode 100644 index 0327154bdd3aa0..00000000000000 --- a/lib/routes/craigslist/search.js +++ /dev/null @@ -1,51 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const { isValidHost } = require('@/utils/valid-host'); - -module.exports = async (ctx) => { - if (!isValidHost(ctx.params.location)) { - throw Error('Invalid location'); - } - - const queryParams = ctx.request.querystring; - const queryUrl = `https://${ctx.params.location}.craigslist.org/search/${ctx.params.type}?${queryParams}`; - const { data } = await got.get(queryUrl); - const $ = cheerio.load(data); - const items = $('.result-row') - .slice(0, 20) - .map((_, _item) => { - const item = $(_item); - const info = item.find('.result-info').first(); - const titleNode = info.find('.result-title').first(); - const price = info.find('.result-price').first().text(); - const hood = info.find('.result-hood').first().text(); - const date = info.find('time').first().attr('datetime'); - - const dataIds = item.find('.result-image').first().attr('data-ids'); - let desc = ''; - if (dataIds) { - const imageList = dataIds.split(',').map((id) => `<img src="https://images.craigslist.org/${id.split(':')[1]}_1200x900.jpg"/>`); - desc = imageList.join(''); - } - return { - title: price + ' - ' + titleNode.text() + hood, - link: titleNode.attr('href'), - description: desc, - pubDate: date, - guid: titleNode.attr('id'), - }; - }) - .get(); - const urlParams = new URLSearchParams(queryParams); - let itemName = urlParams.get('query'); - if (!itemName) { - itemName = ''; - } else { - itemName = itemName.replace('+', ' '); - } - ctx.state.data = { - title: itemName + ' - Craigslist', - link: queryUrl, - item: items, - }; -}; diff --git a/lib/routes/guiltfree/onsale.js b/lib/routes/guiltfree/onsale.js deleted file mode 100644 index a1f8e04a90c9e2..00000000000000 --- a/lib/routes/guiltfree/onsale.js +++ /dev/null @@ -1,48 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const currentUrl = 'https://www.guiltfree.pl/pl/onsale'; - const response = await got({ - method: 'get', - url: currentUrl, - }); - const $ = cheerio.load(response.data); - const list = $('#prodlistx ul li') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('a.product-name'); - return { - title: item.find('span.name_list').text(), - link: a.attr('href'), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - content('.cartqtyrow').remove(); - content('#accessoriesblock').remove(); - content('#crossselling_block').remove(); - - item.description = content('#center_column').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: 'Guiltfree.pl - Wyprzedaże', - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/jingdong/zhongchou.js b/lib/routes/jingdong/zhongchou.js deleted file mode 100644 index 4cfc62b7c6c15b..00000000000000 --- a/lib/routes/jingdong/zhongchou.js +++ /dev/null @@ -1,78 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const url = require('url'); -const queryString = require('query-string'); - -const contentUrl = 'https://z.jd.com/bigger/search.html'; -const host = 'https://z.jd.com/'; -const typeCodes = new Map([ - ['all', { title: '京东众筹 -- 全部', code: '' }], - ['kj', { title: '京东众筹 -- 科技', code: 10 }], - ['ms', { title: '京东众筹 -- 美食', code: 36 }], - ['jd', { title: '京东众筹 -- 家电', code: 37 }], - ['sj', { title: '京东众筹 -- 设计', code: 12 }], - ['yl', { title: '京东众筹 -- 娱乐', code: 11 }], - ['wh', { title: '京东众筹 -- 文化', code: 38 }], - ['gy', { title: '京东众筹 -- 公益', code: 13 }], - ['qt', { title: '京东众筹 -- 其他', code: 14 }], -]); - -const statusCodes = { - all: '', - yrz: 1, - zcz: 2, - zccg: 4, - xmcg: 8, -}; - -module.exports = async (ctx) => { - const type = ctx.params.type || 'all'; - const status = ctx.params.status || 'all'; - const sort = ctx.params.sort || 'zxsx'; - - const title = typeCodes.get(type).title; - const typeCode = typeCodes.get(type).code; - const statusCode = statusCodes[status]; - - const params = { - sort, - }; - if (typeCode !== '') { - params.categoryId = typeCode; - } - if (statusCode !== '') { - params.status = statusCode; - } - const response = await got({ - method: 'post', - url: contentUrl, - headers: { - 'Content-type': 'application/x-www-form-urlencoded', - }, - searchParams: queryString.stringify(params), - }); - - const $ = cheerio.load(response.data); - - const out = $('body > div.wrap.mt20 > div.l-info > div.l-result > ul > li') - .slice(0, 10) - .map(function () { - const image = 'https:' + $(this).find('a.link-pic > img').attr('src'); - const information = $(this).find('div.p-outter > div.p-items > ul').html().trim(); - const description = `<img src="${image}" /><br>${information}`; - - const info = { - link: url.resolve(host, $(this).find('a.link-pic').attr('href')), - description, - title: $(this).find('div.i-tits.no-color-choose > a > h4').text() || $(this).find('div.i-tits > a > h4').text(), - }; - return info; - }) - .get(); - - ctx.state.data = { - title, - link: host, - item: out, - }; -}; diff --git a/lib/routes/leboncoin/ad.js b/lib/routes/leboncoin/ad.js deleted file mode 100644 index 93c7b4780e2b40..00000000000000 --- a/lib/routes/leboncoin/ad.js +++ /dev/null @@ -1,136 +0,0 @@ -const querystring = require('querystring'); -const got = require('@/utils/got'); - -const API_KEY = 'ba0c2dad52b3ec'; -const SEARCH_ENDPOINT = 'https://api.leboncoin.fr/finder/search'; - -// convert the querystring read from the url to the object expected by the rest API -const convertQueryToFilters = (query) => { - const queryObject = querystring.parse(query); - - const filters = { keywords: {}, location: {}, ranges: {}, enums: {} }; - - queryObject.ad_type = queryObject.ad_type || 'offer'; - - for (const [key, value] of Object.entries(queryObject)) { - // category - if (key === 'category') { - filters.category = { id: queryObject.category }; - continue; - } - - // location.locations - if (key === 'locations') { - filters.location.locations = value - .split(',') - .map((l) => { - if (l.startsWith('r_')) { - return { locationType: 'region', region_id: l.slice(2) }; - } - if (l.startsWith('dn_')) { - return { locationType: 'department_near', department_id: l.slice(3) }; - } - - if (l.startsWith('d_')) { - return { locationType: 'department', department_id: l.slice(2) }; - } - - { - if (l.match(/.+_.+/)) { - const [city, zipcode] = l.split('_'); - return { locationType: 'city', city, zipcode }; - } - } - return undefined; - }) - .filter(Boolean); - - continue; - } - - // keywords.text - if (key === 'text') { - filters.keywords.text = value; - - continue; - } - - // location.area - if (key === 'lat' || key === 'lng' || key === 'radius') { - filters.location.area = { - lat: parseFloat(queryObject.lat), - lng: parseFloat(queryObject.lng), - radius: parseFloat(queryObject.radius), - }; - continue; - } - - // range type - { - const m = value.match(/^(\d+|min)-(\d+|max)$/); - - if (m) { - const [, min, max] = m; - - filters.ranges = filters.ranges || {}; - filters.ranges[key] = {}; - if (min !== 'min') { - filters.ranges[key].min = parseInt(min); - } - if (max !== 'max') { - filters.ranges[key].max = parseInt(max); - } - - continue; - } - } - - // enum type - filters.enums[key] = value.split(','); - } - - return filters; -}; - -const buildDescription = (ad) => - // the description is made of - // - first the thumbnail - // - the ad description - // - all the images in thumbnail version, and link to large version - [ - (ad.images && ad.images.thumb_url && `<img src="${ad.images.thumb_url}">`) || '', - '', - ...ad.body.split(/\n/), - '', - ((ad.images && ad.images.urls_thumb && ad.images.urls_thumb.map((url, i) => `<a href=${ad.images.urls_large[i]}><img src="${url}"></a>`)) || []).join(''), - ].join('<br>'); - -module.exports = async (ctx) => { - const query = ctx.params.query; - - const response = await got({ - headers: { - api_key: API_KEY, - origin: 'https://www.leboncoin.fr', - Accept: '*/*', - }, - method: 'post', - url: SEARCH_ENDPOINT, - body: JSON.stringify({ filters: convertQueryToFilters(query), limit: 50, limit_alu: 3, sort_by: 'time', sort_order: 'desc' }), - }); - - ctx.state.data = { - title: `ads for ${query.replace(/&/g, ' ')}`, - description: `ads for ${query.replace(/&/g, ' ')}`, - link: `https://www.leboncoin.fr/recherche/?${query}`, - language: 'fr', - item: (response.data.ads || []) - .filter((ad) => ad.status === 'active') - .map((ad) => ({ - title: (ad.price && ad.price[0] ? `${ad.price[0]}€ - ` : '') + ad.subject, - description: buildDescription(ad), - pubDate: new Date(ad.first_publication_date).toUTCString(), - link: ad.url, - })), - }; -}; diff --git a/lib/routes/liwushuo/index.js b/lib/routes/liwushuo/index.js deleted file mode 100644 index 739c789535f99f..00000000000000 --- a/lib/routes/liwushuo/index.js +++ /dev/null @@ -1,28 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const baseUrl = 'https://www.liwushuo.com'; - const link = `${baseUrl}/api/channels/1/items`; - const res = await got(link, { - searchParams: { - limit: 21, - }, - }); - - const item = res.data.data.items.map((item) => { - const { content_url, cover_image_url, created_at, share_msg, title } = item; - return { - title, - link: content_url, - pubDate: new Date(created_at * 1000).toUTCString(), - description: [`<img src="${cover_image_url}"/>`, share_msg].join('<br/>'), - }; - }); - - ctx.state.data = { - title: '礼物说 - 精选', - description: '礼物说 - 精选', - link: baseUrl, - item, - }; -}; diff --git a/lib/routes/mercari/index.js b/lib/routes/mercari/index.js deleted file mode 100644 index 1c7053a53aff25..00000000000000 --- a/lib/routes/mercari/index.js +++ /dev/null @@ -1,67 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - ctx.params.type = ctx.params.type === 'search' ? ctx.params.type + '/?keyword=' : ctx.params.type + '/'; - - const rootUrl = 'https://www.mercari.com'; - const currentUrl = `${rootUrl}/jp/${ctx.params.type}${ctx.params.id}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - let list; - if (ctx.params.type === 'category/') { - list = JSON.parse(response.data.match(/"searchCategory":(.*?),"crossBorderBanner/)[1]) - .data.slice(0, 10) - .map((item) => ({ - title: item.name, - link: `${rootUrl}/jp/items/${item.id}/`, - })); - } else { - list = $('section.items-box') - .slice(0, 10) - .map((_, item) => { - item = $(item); - return { - title: item.find('h3.items-box-name').text(), - link: `${rootUrl}${item.find('a').attr('href')}`, - }; - }) - .get(); - } - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - try { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - - const content = cheerio.load(detailResponse.data); - - content('div.item-btn-float-area').remove(); - content('div.owl-nav').remove(); - content('div.owl-dots').remove(); - - item.description = content('div.item-main-content').html(); - - return item; - } catch (e) { - return Promise.resolve(''); - } - }) - ) - ); - - ctx.state.data = { - title: $('title').text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/mingjian/index.js b/lib/routes/mingjian/index.js deleted file mode 100644 index c8a3a6f591abe7..00000000000000 --- a/lib/routes/mingjian/index.js +++ /dev/null @@ -1,46 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const currentUrl = 'https://www.mingjian.cn/'; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - const list = $('div.col-md-3') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('a'); - return { - link: a.attr('href'), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.title = content('div.title').eq(0).text(); - item.description = content('div.content').html(); - item.pubDate = new Date(content('div.date').eq(0).text().replace('发表于', '') + ' GMT+8').toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: '消费明鉴 - 最新新闻', - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/tahui/rptlist.js b/lib/routes/tahui/rptlist.js deleted file mode 100644 index 8278e9120d165b..00000000000000 --- a/lib/routes/tahui/rptlist.js +++ /dev/null @@ -1,48 +0,0 @@ -const url = require('url'); -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const rootUrl = 'https://www.tahui.com/'; - const currentUrl = 'https://www.tahui.com/rptlist'; - - const response = await got({ - method: 'get', - url: currentUrl, - }); - const $ = cheerio.load(response.data); - const list = $('article.excerpt h2') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('a').eq(0); - return { - title: a.text(), - link: url.resolve(rootUrl, a.attr('href')), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.pubDate = new Date(content('div.meta span').eq(0).text().trim().replace(/\n/g, '')).toUTCString(); - item.description = content('div.artcontent').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: '它惠网 - 线报', - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/westore/new.js b/lib/routes/westore/new.js deleted file mode 100644 index c4bd0c42b7b0b9..00000000000000 --- a/lib/routes/westore/new.js +++ /dev/null @@ -1,40 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const link = 'https://umall.vip.qq.com/v2/?_wv=1025&_wwv=4&product=32482&path=/category/list-ip&query=ip%253D20372%2526type%253Dip%2526isDetail%253D1%2526sortType%253D3#/category/list-ip?ip=20372&type=ip&isDetail=1&sortType=3'; - const response = await got({ - method: 'post', - url: 'https://uapi.vip.qq.com/Api/api.brand.productssrf', - json: { - page: 1, - per_page: 20, - asc: 0, - brand_id: 20372, - sort_type: 3, - adtag2: 'search_mr', - scence: 'ipdetail', - }, - headers: { - Referer: link, - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', - }, - }); - - ctx.state.data = { - title: 'Westore', - link, - description: '微信周边', - item: response.data.brands.map(({ name, img, vipprice, id }) => { - const description = ` - <img src="https:${img}" /><br> - <strong>价格:</strong> ${+vipprice / 100}元 - `; - - return { - title: name, - description, - link: `https://umall.vip.qq.com/v2/?_wv=1025&_wwv=4&product=32482&path=/product/${id}`, - }; - }), - }; -}; diff --git a/lib/routes/wineyun/index.js b/lib/routes/wineyun/index.js deleted file mode 100644 index dac01adcebfc38..00000000000000 --- a/lib/routes/wineyun/index.js +++ /dev/null @@ -1,36 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const JSON5 = require('json5'); - -module.exports = async (ctx) => { - const category = ctx.params.category; - const url = 'http://www.wineyun.com/' + category; - - const response = await got({ - method: 'get', - url, - headers: { - Referer: 'http://www.wineyun.com', - }, - }); - - const $ = cheerio.load(response.data); - - const description = $('head title'); - - const regex = /new Vue\({\s+el: '#wy_app',[\s\S]+data: {[\s\S]+list: (.+),/gm; - const match = regex.exec(response.data); - const list = JSON5.parse(match[1]); - const resultItem = list.map((item) => ({ - title: `¥${item.price} ${item.goodsname}`, - link: `http://www.wineyun.com/group/${item.id}`, - description: `<img src ="${item.Image}"><br>${item.summary}`, - })); - - ctx.state.data = { - title: '酒云网-最新商品', - link: url, - item: resultItem, - description, - }; -}; diff --git a/lib/v2/independent/maintainer.js b/lib/v2/independent/maintainer.js deleted file mode 100644 index 9aa0d7e3208924..00000000000000 --- a/lib/v2/independent/maintainer.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - '/ps5-stock-uk': ['DIYgod'], -}; diff --git a/lib/v2/independent/ps5-stock-uk.js b/lib/v2/independent/ps5-stock-uk.js deleted file mode 100644 index 23987a8e86647a..00000000000000 --- a/lib/v2/independent/ps5-stock-uk.js +++ /dev/null @@ -1,27 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const data = await got.get(`https://www.independent.co.uk/extras/indybest/gadgets-tech/video-games-consoles/ps5-stock-uk-restock-live-today-b1938965.html`); - const $ = cheerio.load(data.data); - - const list = $('div[items]>div'); - - ctx.state.data = { - title: `PS5 stock UK - The Independent`, - link: `https://www.independent.co.uk/extras/indybest/gadgets-tech/video-games-consoles/ps5-stock-uk-restock-live-today-b1938965.html`, - item: list - .map((index, item) => { - item = $(item); - return { - title: item.find('h3').text(), - description: item.find('>div').eq(0).html(), - link: item.find('a').eq(0).attr('href'), - pubDate: parseInt(item.attr('data-sort-time')), - author: item.find('>div').eq(1).find('span').eq(0).html(), - }; - }) - .get() - .reverse(), - }; -}; diff --git a/lib/v2/independent/radar.js b/lib/v2/independent/radar.js deleted file mode 100644 index a9545f8d96542b..00000000000000 --- a/lib/v2/independent/radar.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - 'independent.co.uk': { - _name: 'PS5 stock UK - The Independent', - www: [ - { - title: 'News', - docs: 'https://docs.rsshub.app/routes/shopping#the-independent', - source: ['/extras/indybest/gadgets-tech/video-games-consoles/ps5-stock-uk-restock-live-today-b1938965.html'], - target: '/ps5-stock-uk', - }, - ], - }, -}; diff --git a/lib/v2/independent/router.js b/lib/v2/independent/router.js deleted file mode 100644 index a6dfba6ff8e0e9..00000000000000 --- a/lib/v2/independent/router.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (router) { - router.get('/ps5-stock-uk', require('./ps5-stock-uk')); -}; diff --git a/lib/v2/lativ/index.js b/lib/v2/lativ/index.js deleted file mode 100644 index 2c8ad13efb1a2b..00000000000000 --- a/lib/v2/lativ/index.js +++ /dev/null @@ -1,42 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const path = require('path'); -const { art } = require('@/utils/render'); -const { parseDate } = require('@/utils/parse-date'); - -const rootUrl = 'https://www.lativ.com.tw'; - -module.exports = async (ctx) => { - const id = ctx.params.id; - const url = `${rootUrl}/Detail/${id}`; - const response = await got.get(url); - const $ = cheerio.load(response.data); - const title = $('#wrap > h1').text(); - const image = $('div.oldPic.show > a:nth-child(1) > img').attr('src'); - const productId = $('div.clearfloat > div.size > div > span').attr('data-value'); - - const productInfoUrl = `https://www.lativ.com.tw/Product/GetProductInfo?productId=${productId}`; - const productInfo = await got.get(productInfoUrl); - const itemInfo = JSON.parse(productInfo.data.info)[0].ItemList[0]; - const price = itemInfo.Price; - const time = parseInt(itemInfo.LastEditTime.replace(/[^\d]/g, '')); - const discount = JSON.parse(productInfo.data.activity).Discount; - - const item = { - title, - link: url, - description: art(path.join(__dirname, 'templates/detail.art'), { - price, - discount, - image, - title, - }), - pubDate: parseDate(time), - }; - - ctx.state.data = { - title: `lativ-${title}`, - link: url, - item: [item], - }; -}; diff --git a/lib/v2/lativ/maintainer.js b/lib/v2/lativ/maintainer.js deleted file mode 100644 index aa80031296ee54..00000000000000 --- a/lib/v2/lativ/maintainer.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - '/:id': ['Fatpandac'], -}; diff --git a/lib/v2/lativ/radar.js b/lib/v2/lativ/radar.js deleted file mode 100644 index bb6b3047b13a4c..00000000000000 --- a/lib/v2/lativ/radar.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - 'lativ.com.tw': { - _name: 'lativ', - www: [ - { - title: '订阅商品价格', - docs: 'https://docs.rsshub.app/routes/shopping#lativ', - source: '/Detail/:id', - target: '/lativ/:id', - }, - ], - }, -}; diff --git a/lib/v2/lativ/router.js b/lib/v2/lativ/router.js deleted file mode 100644 index 641c23df3a1d0f..00000000000000 --- a/lib/v2/lativ/router.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (router) { - router.get('/:id', require('./index')); -}; diff --git a/lib/v2/lativ/templates/detail.art b/lib/v2/lativ/templates/detail.art deleted file mode 100644 index 4e8eb20d73279e..00000000000000 --- a/lib/v2/lativ/templates/detail.art +++ /dev/null @@ -1,9 +0,0 @@ -<div> - {{ if discount != null }} - <h2><strike>原价: {{ price }}</strike></h2> - <h1>特价: {{ discount }}</h1> - {{ else }} - <h1>价格: {{ price }}</h1> - {{ /if }} - <img src="{{ image }}" alt="{{ title }}"/> -</div> diff --git a/website/docs/routes/shopping.mdx b/website/docs/routes/shopping.mdx index 60eecf0e3daee4..749e0a03579794 100644 --- a/website/docs/routes/shopping.mdx +++ b/website/docs/routes/shopping.mdx @@ -10,12 +10,6 @@ | 1 | 2 | 3 | </Route> -## Alter 中国 {#alter-zhong-guo} - -### 新闻 {#alter-zhong-guo-xin-wen} - -<Route author="luyuhuang" example="/alter-cn/news" path="/alter-cn/news" notOperational="1" /> - ## AppSales {#appsales} ### Apps {#appsales-apps} @@ -96,19 +90,6 @@ <Route author="KTachibanaM" example="/booth.pm/shop/annn-boc0123" path="/booth.pm/shop/:subdomain" paramsDesc={['Shop subdomain']} /> -## Craigslist {#craigslist} - -### Shop {#craigslist-shop} - -<Route author="lxiange" example="/craigslist/sfbay/sso?query=folding+bike&sort=rel" path="/craigslist/:location/:type?" paramsDesc={['location, Craigslist subdomain, e.g., `sfbay`', 'search type, e.g., `sso`']} notOperational="1" /> - -> We use RSSHub to implement the searching of Craigslist -> An example of a full original search url: -> [https://sfbay.craigslist.org/search/sso?query=folding+bike\&sort=rel](https://sfbay.craigslist.org/search/sso?query=folding+bike\&sort=rel) -> -> the `xxx` in `/search/xxx` is the search type, just refer to the original search url. -> The query string is the actual name of query, in this case is folding bike - ## Furstar {#furstar} ### 最新售卖角色列表 {#furstar-zui-xin-shou-mai-jue-se-lie-biao} @@ -123,12 +104,6 @@ <Route author="NeverBehave" example="/furstar/artists/cn" path="/furstar/artists/:lang?" paramsDesc={['语言, 留空为jp, 支持cn, en']} /> -## Guiltfree.pl {#guiltfree-pl} - -### Onsale {#guiltfree-pl-onsale} - -<Route author="nczitzk" example="/guiltfree/onsale" path="/guiltfree/onsale" notOperational="1" /> - ## Gumroad {#gumroad} ### Products {#gumroad-products} @@ -169,32 +144,6 @@ <Route author="jzhangdev" example="/ikea/cn/new" path="/ikea/cn/new" radar="1" /> -## lativ {#lativ} - -### 订阅价格 {#lativ-ding-yue-jia-ge} - -<Route author="Fatpandac" example="/lativ/54220021" path="/lativ/:id" paramsDesc={['商品id,网址上可以直接拿到']} notOperational="1" /> - -## LeBonCoin {#leboncoin} - -### Ads {#leboncoin-ads} - -Transform any search into a feed. - -<Route author="Platane" example="/leboncoin/ad/category=10&locations=Paris_75015" path="/leboncoin/ad/:query" paramsDesc={['search page querystring']} notOperational="1"> - For instance, in `https://www.leboncoin.fr/recherche/?category=10&locations=Paris_75015`, the query is **category=10\&locations=Paris\_75015** -</Route> - -## Mercari {#mercari} - -### Goods {#mercari-goods} - -<Route author="nczitzk" example="/mercari/category/1" path="/mercari/:type/:id" paramsDesc={['`category` as seaching by category, `brand` as searching by brand, `search` as searching for keyword', 'can be found in URL of the category or brand page. If you choose `search` as `type`, then put keyword here']} notOperational="1"> - All categories, see [Category list](https://www.mercari.com/jp/category/) - - All brands, see [Brand list](https://www.mercari.com/jp/brand/) -</Route> - ## MyFigureCollection {#myfigurecollection} ### Activity {#myfigurecollection-activity} @@ -264,7 +213,7 @@ Transform any search into a feed. ### Store {#shopback-store} -<Route author="nczitzk" example="/shopback/shopee-mart" path="/shopback/:store" paramsDesc={['Store, can be found in URL']} notOperational="1" /> +<Route author="nczitzk" example="/shopback/shopee-mart" path="/shopback/:store" paramsDesc={['Store, can be found in URL']} /> ## Snow Peak {#snow-peak} @@ -272,24 +221,12 @@ Transform any search into a feed. <Route author="EthanWng97" example="/snowpeak/us/new-arrivals" path="/snowpeak/us/new-arrivals" /> -## The Independent {#the-independent} - -### PS5 stock UK {#the-independent-ps5-stock-uk} - -<Route author="DIYgod" example="/independent/ps5-stock-uk" path="/independent/ps5-stock-uk" notOperational="1" /> - ## Uniqlo {#uniqlo} ### New Arrivals {#uniqlo-new-arrivals} <Route author="DIYgod" example="/uniqlo/new/sg/men" path="/uniqlo/new/:country/:category" paramsDesc={['currently only supports sg, us, jp', 'supports `men` `women`, `kids`, `baby`']} radar="1" /> -## Westore {#westore} - -### 新品 {#westore-xin-pin} - -<Route author="xyqfer" example="/westore/new" path="/westore/new" notOperational="1" /> - ## Zagg {#zagg} ### New Arrivals {#zagg-new-arrivals} @@ -354,46 +291,6 @@ For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3 ::: </Route> -## 京东众筹 {#jing-dong-zhong-chou} - -### 众筹项目 {#jing-dong-zhong-chou-zhong-chou-xiang-mu} - -<Route author="LogicJake" example="/jingdong/zhongchou/all/zcz/zhtj" path="/jingdong/zhongchou/:type/:status/:sort" paramsDesc={['类型','状态','排序方式']} notOperational="1"> - 类型 - - | 全部 | 科技 | 美食 | 家电 | 设计 | 娱乐 | 文化 | 公益 | 其他 | - | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | - | all | kj | ms | jd | sj | yl | wh | gy | qt | - - 状态 - - | 全部 | 预热中 | 众筹中 | 众筹成功 | 项目成功 | - | ---- | ------ | ------ | -------- | -------- | - | all | yrz | zcz | zccg | xmcg | - - 排序方式 - - | 综合推荐 | 最新上线 | 金额最多 | 支持最多 | 即将结束 | - | -------- | -------- | -------- | -------- | -------- | - | zhtj | zxsx | jezg | zczd | jjjs | -</Route> - -## 酒云网 {#jiu-yun-wang} - -### 最新商品 {#jiu-yun-wang-zui-xin-shang-pin} - -<Route author="yuuow" example="/wineyun/home" path="/wineyun/:category" paramsDesc={['分类名']} notOperational="1"> - | 全部 | 闪购 | 秒发 | 跨境 | 尾货专场 | - | ---- | ------- | ------ | -------- | -------- | - | home | shangou | miaofa | csborder | weihuo | -</Route> - -## 礼物说 {#li-wu-shuo} - -### 礼物说 {#li-wu-shuo-li-wu-shuo} - -<Route author="sanmmm" example="/liwushuo/index" path="/liwushuo/index" notOperational="1" /> - ## 麦当劳 {#mai-dang-lao} ### 麦当劳活动资讯 {#mai-dang-lao-mai-dang-lao-huo-dong-zi-xun} @@ -504,12 +401,6 @@ For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3 <Route author="nczitzk" example="/smzdm/baoliao/7367111021" path="/smzdm/baoliao/:uid" paramsDesc={['用户id,网址上直接可以看到']} /> -## 它惠网 {#ta-hui-wang} - -### 线报 {#ta-hui-wang-xian-bao} - -<Route author="nczitzk" example="/tahui/rptlist" path="/tahui/rptlist" notOperational="1" /> - ## 淘宝众筹 {#tao-bao-zhong-chou} ### 众筹项目 {#tao-bao-zhong-chou-zhong-chou-xiang-mu} @@ -619,17 +510,11 @@ For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3 <Route author="LogicJake" example="/weidian/goods/431508863" path="/weidian/goods/:id" paramsDesc={['商铺 id']} /> -## 消费明鉴 {#xiao-fei-ming-jian} - -### 最新新闻 {#xiao-fei-ming-jian-zui-xin-xin-wen} - -<Route author="nczitzk" example="/mingjian" path="/mingjian" notOperational="1" /> - ## 消费者报道 {#xiao-fei-zhe-bao-dao} ### 要闻 {#xiao-fei-zhe-bao-dao-yao-wen} -<Route author="EsuRt Fatpandac" example="/ccreports/article" path="/ccreports/article" notOperational="1" /> +<Route author="EsuRt Fatpandac" example="/ccreports/article" path="/ccreports/article" /> ## 小米 {#xiao-mi} @@ -679,16 +564,6 @@ For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3 厂牌 ID 查询: `/showstart/search/brand/:keyword`,如: [https://rsshub.app/showstart/search/brand/ 声场](https://rsshub.app/showstart/search/brand/声场) ::: -## 优衣库 {#you-yi-ku} - -### Stylingbook {#you-yi-ku-stylingbook} - -<Route author="LunaXu" example="/uniqlo/stylingbook/women" path="/uniqlo/stylingbook/:category?" paramsDesc={['类别']} notOperational="1"> - | 女式 | 男式 | 小孩 | 婴儿 | - | ----- | ---- | ---- | ---- | - | women | men | kids | baby | -</Route> - ## 有赞 {#you-zan} ### 商品上新 {#you-zan-shang-pin-shang-xin}
af1fdac8a637c810b29a357536ec89ae277f7ae2
2020-10-20 19:08:49
dependabot-preview[bot]
chore(deps-dev): bump jest from 26.5.3 to 26.6.0
false
bump jest from 26.5.3 to 26.6.0
chore
diff --git a/package.json b/package.json index 25b8bf427050ef..7e6fcbffbd87cf 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "eslint": "7.11.0", "eslint-config-prettier": "6.13.0", "eslint-plugin-prettier": "3.1.4", - "jest": "26.5.3", + "jest": "26.6.0", "mockdate": "3.0.2", "nock": "13.0.4", "nodemon": "2.0.6", diff --git a/yarn.lock b/yarn.lock index ada471212f70c9..edbe3e2cdce7ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1110,93 +1110,93 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.5.2.tgz#94fc4865b1abed7c352b5e21e6c57be4b95604a6" - integrity sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw== +"@jest/console@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.0.tgz#fd4a4733df3c50260aefb227414296aee96e682f" + integrity sha512-ArGcZWAEYMWmWnc/QvxLDvFmGRPvmHeulhS7FUUAlUGR5vS/SqMfArsGaYmIFEThSotCMnEihwx1h62I1eg5lg== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^26.5.2" - jest-util "^26.5.2" + jest-message-util "^26.6.0" + jest-util "^26.6.0" slash "^3.0.0" -"@jest/core@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.5.3.tgz#712ed4adb64c3bda256a3f400ff1d3eb2a031f13" - integrity sha512-CiU0UKFF1V7KzYTVEtFbFmGLdb2g4aTtY0WlyUfLgj/RtoTnJFhh50xKKr7OYkdmBUlGFSa2mD1TU3UZ6OLd4g== +"@jest/core@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.0.tgz#04dd3e046e9ebbe06a4f330e05a67f21f7bb314a" + integrity sha512-7wbunxosnC5zXjxrEtTQSblFjRVOT8qz1eSytw8riEeWgegy3ct91NLPEP440CDuWrmW3cOLcEGxIf9q2u6O9Q== dependencies: - "@jest/console" "^26.5.2" - "@jest/reporters" "^26.5.3" - "@jest/test-result" "^26.5.2" - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.0" + "@jest/reporters" "^26.6.0" + "@jest/test-result" "^26.6.0" + "@jest/transform" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^26.5.2" - jest-config "^26.5.3" - jest-haste-map "^26.5.2" - jest-message-util "^26.5.2" + jest-changed-files "^26.6.0" + jest-config "^26.6.0" + jest-haste-map "^26.6.0" + jest-message-util "^26.6.0" jest-regex-util "^26.0.0" - jest-resolve "^26.5.2" - jest-resolve-dependencies "^26.5.3" - jest-runner "^26.5.3" - jest-runtime "^26.5.3" - jest-snapshot "^26.5.3" - jest-util "^26.5.2" - jest-validate "^26.5.3" - jest-watcher "^26.5.2" + jest-resolve "^26.6.0" + jest-resolve-dependencies "^26.6.0" + jest-runner "^26.6.0" + jest-runtime "^26.6.0" + jest-snapshot "^26.6.0" + jest-util "^26.6.0" + jest-validate "^26.6.0" + jest-watcher "^26.6.0" micromatch "^4.0.2" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.5.2.tgz#eba3cfc698f6e03739628f699c28e8a07f5e65fe" - integrity sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw== +"@jest/environment@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.0.tgz#695ee24cbf110456272caa9debbbf7e01afb2f78" + integrity sha512-l+5MSdiC4rUUrz8xPdj0TwHBwuoqMcAbFnsYDTn5FkenJl8b+lvC5NdJl1tVICGHWnx0fnjdd1luRZ7u3U4xyg== dependencies: - "@jest/fake-timers" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/fake-timers" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" - jest-mock "^26.5.2" + jest-mock "^26.6.0" -"@jest/fake-timers@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.5.2.tgz#1291ac81680ceb0dc7daa1f92c059307eea6400a" - integrity sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw== +"@jest/fake-timers@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.0.tgz#5b4cc83fab91029963c53e6e2716f02544323b22" + integrity sha512-7VQpjChrwlwvGNysS10lDBLOVLxMvMtpx0Xo6aIotzNVyojYk0NN0CR8R4T6h/eu7Zva/LB3P71jqwGdtADoag== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@sinonjs/fake-timers" "^6.0.1" "@types/node" "*" - jest-message-util "^26.5.2" - jest-mock "^26.5.2" - jest-util "^26.5.2" + jest-message-util "^26.6.0" + jest-mock "^26.6.0" + jest-util "^26.6.0" -"@jest/globals@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.5.3.tgz#90769b40e0af3fa0b28f6d8c5bbe3712467243fd" - integrity sha512-7QztI0JC2CuB+Wx1VdnOUNeIGm8+PIaqngYsZXQCkH2QV0GFqzAYc9BZfU0nuqA6cbYrWh5wkuMzyii3P7deug== +"@jest/globals@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.0.tgz#da2f58d17105b6a7531ee3c8724acb5f233400e2" + integrity sha512-rs3a/a8Lq8FgTx11SxbqIU2bDjsFU2PApl2oK2oUVlo84RSF76afFm2nLojW93AGssr715GHUwhq5b6mpCI5BQ== dependencies: - "@jest/environment" "^26.5.2" - "@jest/types" "^26.5.2" - expect "^26.5.3" + "@jest/environment" "^26.6.0" + "@jest/types" "^26.6.0" + expect "^26.6.0" -"@jest/reporters@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.5.3.tgz#e810e9c2b670f33f1c09e9975749260ca12f1c17" - integrity sha512-X+vR0CpfMQzYcYmMFKNY9n4jklcb14Kffffp7+H/MqitWnb0440bW2L76NGWKAa+bnXhNoZr+lCVtdtPmfJVOQ== +"@jest/reporters@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.0.tgz#2a8d631ad3b19a722fd0fae58ce9fa25e8aac1cf" + integrity sha512-PXbvHhdci5Rj1VFloolgLb+0kkdtzswhG8MzVENKJRI3O1ndwr52G6E/2QupjwrRcYnApZOelFf4nNpf5+SDxA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^26.5.2" - "@jest/test-result" "^26.5.2" - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.0" + "@jest/test-result" "^26.6.0" + "@jest/transform" "^26.6.0" + "@jest/types" "^26.6.0" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -1207,9 +1207,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^26.5.2" - jest-resolve "^26.5.2" - jest-util "^26.5.2" + jest-haste-map "^26.6.0" + jest-resolve "^26.6.0" + jest-util "^26.6.0" jest-worker "^26.5.0" slash "^3.0.0" source-map "^0.6.0" @@ -1228,52 +1228,52 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.5.2.tgz#cc1a44cfd4db2ecee3fb0bc4e9fe087aa54b5230" - integrity sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw== +"@jest/test-result@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.0.tgz#79705c8a57165777af5ef1d45c65dcc4a5965c11" + integrity sha512-LV6X1ry+sKjseQsIFz3e6XAZYxwidvmeJFnVF08fq98q08dF1mJYI0lDq/LmH/jas+R4s0pwnNGiz1hfC4ZUBw== dependencies: - "@jest/console" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.0" + "@jest/types" "^26.6.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.5.3.tgz#9ae0ab9bc37d5171b28424029192e50229814f8d" - integrity sha512-Wqzb7aQ13L3T47xHdpUqYMOpiqz6Dx2QDDghp5AV/eUDXR7JieY+E1s233TQlNyl+PqtqgjVokmyjzX/HA51BA== +"@jest/test-sequencer@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.0.tgz#a9dbc6545b1c59e7f375b05466e172126609906d" + integrity sha512-rWPTMa+8rejvePZnJmnKkmKWh0qILFDPpN0qbSif+KNGvFxqqDGafMo4P2Y8+I9XWrZQBeXL9IxPL4ZzDgRlbw== dependencies: - "@jest/test-result" "^26.5.2" + "@jest/test-result" "^26.6.0" graceful-fs "^4.2.4" - jest-haste-map "^26.5.2" - jest-runner "^26.5.3" - jest-runtime "^26.5.3" + jest-haste-map "^26.6.0" + jest-runner "^26.6.0" + jest-runtime "^26.6.0" -"@jest/transform@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.5.2.tgz#6a0033a1d24316a1c75184d010d864f2c681bef5" - integrity sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg== +"@jest/transform@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.0.tgz#1a6b95d0c7f9b4f96dd3aab9d28422a9e5e4043e" + integrity sha512-NUNA1NMCyVV9g5NIQF1jzW7QutQhB/HAocteCiUyH0VhmLXnGMTfPYQu1G6IjPk+k1SWdh2PD+Zs1vMqbavWzg== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^26.5.2" + jest-haste-map "^26.6.0" jest-regex-util "^26.0.0" - jest-util "^26.5.2" + jest-util "^26.6.0" micromatch "^4.0.2" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.5.2.tgz#44c24f30c8ee6c7f492ead9ec3f3c62a5289756d" - integrity sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg== +"@jest/types@^26.6.0": + version "26.6.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.0.tgz#2c045f231bfd79d52514cda3fbc93ef46157fa6a" + integrity sha512-8pDeq/JVyAYw7jBGU83v8RMYAkdrRxLG3BGnAJuqaQAUd6GWBmND2uyl+awI88+hit48suLoLjNFtR+ZXxWaYg== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -2616,13 +2616,13 @@ babel-extract-comments@^1.0.0: dependencies: babylon "^6.18.0" -babel-jest@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.5.2.tgz#164f367a35946c6cf54eaccde8762dec50422250" - integrity sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A== +babel-jest@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.0.tgz#eca57ac8af99d6e06047e595b1faf0b5adf8a7bb" + integrity sha512-JI66yILI7stzjHccAoQtRKcUwJrJb4oMIxLTirL3GdAjGpaUBQSjZDFi9LsPkN4gftsS4R2AThAJwOjJxadwbg== dependencies: - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/transform" "^26.6.0" + "@jest/types" "^26.6.0" "@types/babel__core" "^7.1.7" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^26.5.0" @@ -5148,16 +5148,16 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.5.3.tgz#89d9795036f7358b0a9a5243238eb8086482d741" - integrity sha512-kkpOhGRWGOr+TEFUnYAjfGvv35bfP+OlPtqPIJpOCR9DVtv8QV+p8zG0Edqafh80fsjeE+7RBcVUq1xApnYglw== +expect@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.0.tgz#f48861317f62bb9f1248eaab7ae9e50a9a5a8339" + integrity sha512-EzhbZ1tbwcaa5Ok39BI11flIMeIUSlg1QsnXOrleaMvltwHsvIQPBtL710l+ma+qDFLUgktCXK4YuQzmHdm7cg== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" ansi-styles "^4.0.0" jest-get-type "^26.3.0" - jest-matcher-utils "^26.5.2" - jest-message-util "^26.5.2" + jest-matcher-utils "^26.6.0" + jest-message-util "^26.6.0" jest-regex-util "^26.0.0" express@^4.17.1: @@ -7027,67 +7027,67 @@ javascript-stringify@^2.0.1: resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-2.0.1.tgz#6ef358035310e35d667c675ed63d3eb7c1aa19e5" integrity sha512-yV+gqbd5vaOYjqlbk16EG89xB5udgjqQF3C5FAORDg4f/IS1Yc5ERCv5e/57yBcfJYw05V5JyIXabhwb75Xxow== -jest-changed-files@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.5.2.tgz#330232c6a5c09a7f040a5870e8f0a9c6abcdbed5" - integrity sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w== +jest-changed-files@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.0.tgz#63b04aa261b5733c6ade96b7dd24784d12d8bb2d" + integrity sha512-k8PZzlp3cRWDe0fDc/pYs+c4w36+hiWXe1PpW/pW1UJmu1TNTAcQfZUrVYleij+uEqlY6z4mPv7Iff3kY0o5SQ== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" execa "^4.0.0" throat "^5.0.0" -jest-cli@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.5.3.tgz#f936b98f247b76b7bc89c7af50af82c88e356a80" - integrity sha512-HkbSvtugpSXBf2660v9FrNVUgxvPkssN8CRGj9gPM8PLhnaa6zziFiCEKQAkQS4uRzseww45o0TR+l6KeRYV9A== +jest-cli@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.0.tgz#dc3ae34fd5937310493ed07dc79c5ffba2bf6671" + integrity sha512-lJAMZGpmML+y3Kfln6L5DGRTfKGQ+n1JDM1RQstojSLUhe/EaXWR8vmcx70v4CyJKvFZs7c/0QDkPX5ra/aDew== dependencies: - "@jest/core" "^26.5.3" - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/core" "^26.6.0" + "@jest/test-result" "^26.6.0" + "@jest/types" "^26.6.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^26.5.3" - jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-config "^26.6.0" + jest-util "^26.6.0" + jest-validate "^26.6.0" prompts "^2.0.1" yargs "^15.4.1" -jest-config@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.5.3.tgz#baf51c9be078c2c755c8f8a51ec0f06c762c1d3f" - integrity sha512-NVhZiIuN0GQM6b6as4CI5FSCyXKxdrx5ACMCcv/7Pf+TeCajJhJc+6dwgdAVPyerUFB9pRBIz3bE7clSrRge/w== +jest-config@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.0.tgz#cb879a37002f881edb66d673fd40b6704595de89" + integrity sha512-RCR1Kf7MGJ5waVCvrj/k3nCAJKquWZlzs8rkskzj0KlG392hNBOaYd5FQ4cCac08j6pwfIDOwNvMcy0/FqguJg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.5.3" - "@jest/types" "^26.5.2" - babel-jest "^26.5.2" + "@jest/test-sequencer" "^26.6.0" + "@jest/types" "^26.6.0" + babel-jest "^26.6.0" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-environment-jsdom "^26.5.2" - jest-environment-node "^26.5.2" + jest-environment-jsdom "^26.6.0" + jest-environment-node "^26.6.0" jest-get-type "^26.3.0" - jest-jasmine2 "^26.5.3" + jest-jasmine2 "^26.6.0" jest-regex-util "^26.0.0" - jest-resolve "^26.5.2" - jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-resolve "^26.6.0" + jest-util "^26.6.0" + jest-validate "^26.6.0" micromatch "^4.0.2" - pretty-format "^26.5.2" + pretty-format "^26.6.0" -jest-diff@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.5.2.tgz#8e26cb32dc598e8b8a1b9deff55316f8313c8053" - integrity sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA== +jest-diff@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.0.tgz#5e5bbbaf93ec5017fae2b3ef12fc895e29988379" + integrity sha512-IH09rKsdWY8YEY7ii2BHlSq59oXyF2pK3GoK+hOK9eD/x6009eNB5Jv1shLMKgxekodPzLlV7eZP1jPFQYds8w== dependencies: chalk "^4.0.0" diff-sequences "^26.5.0" jest-get-type "^26.3.0" - pretty-format "^26.5.2" + pretty-format "^26.6.0" jest-docblock@^26.0.0: version "26.0.0" @@ -7096,53 +7096,53 @@ jest-docblock@^26.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.5.2.tgz#35e68d6906a7f826d3ca5803cfe91d17a5a34c31" - integrity sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg== +jest-each@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.0.tgz#9e9d90a4fc5a79e1d99a008897038325a6c7fbbf" + integrity sha512-7LzSNwNviYnm4FWK46itIE03NqD/8O8/7tVQ5rwTdTNrmPMQoQ1Z7hEFQ1uzRReluOFislpurpnQ0QsclSiDkA== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" chalk "^4.0.0" jest-get-type "^26.3.0" - jest-util "^26.5.2" - pretty-format "^26.5.2" + jest-util "^26.6.0" + pretty-format "^26.6.0" -jest-environment-jsdom@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz#5feab05b828fd3e4b96bee5e0493464ddd2bb4bc" - integrity sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw== +jest-environment-jsdom@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.0.tgz#2ce353fb82d27a9066bfea3ff2c27d9405076c69" + integrity sha512-bXO9IG7a3YlyiHxwfKF+OWoTA+GIw4FrD+Y0pb6CC+nKs5JuSRZmR2ovEX6PWo6KY42ka3JoZOp3KEnXiFPPCg== dependencies: - "@jest/environment" "^26.5.2" - "@jest/fake-timers" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/environment" "^26.6.0" + "@jest/fake-timers" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" - jest-mock "^26.5.2" - jest-util "^26.5.2" + jest-mock "^26.6.0" + jest-util "^26.6.0" jsdom "^16.4.0" -jest-environment-node@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.5.2.tgz#275a0f01b5e47447056f1541a15ed4da14acca03" - integrity sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA== +jest-environment-node@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.0.tgz#97f6e48085e67bda43b97f48e678ce78d760cd14" + integrity sha512-kWU6ZD1h6fs7sIl6ufuK0sXW/3d6WLaj48iow0NxhgU6eY89d9K+0MVmE0cRcVlh53yMyxTK6b+TnhLOnlGp/A== dependencies: - "@jest/environment" "^26.5.2" - "@jest/fake-timers" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/environment" "^26.6.0" + "@jest/fake-timers" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" - jest-mock "^26.5.2" - jest-util "^26.5.2" + jest-mock "^26.6.0" + jest-util "^26.6.0" jest-get-type@^26.3.0: version "26.3.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-haste-map@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.5.2.tgz#a15008abfc502c18aa56e4919ed8c96304ceb23d" - integrity sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA== +jest-haste-map@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.0.tgz#4cd392bc51109bd8e0f765b2d5afa746bebb5ce2" + integrity sha512-RpNqAGMR58uG9E9vWITorX2/R7he/tSbHWldX5upt1ymEcmCaXczqXxjqI6xOtRR8Ev6ZEYDfgSA5Fy7WHUL5w== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -7150,7 +7150,7 @@ jest-haste-map@^26.5.2: graceful-fs "^4.2.4" jest-regex-util "^26.0.0" jest-serializer "^26.5.0" - jest-util "^26.5.2" + jest-util "^26.6.0" jest-worker "^26.5.0" micromatch "^4.0.2" sane "^4.0.3" @@ -7158,55 +7158,55 @@ jest-haste-map@^26.5.2: optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.5.3.tgz#baad2114ce32d16aff25aeb877d18bb4e332dc4c" - integrity sha512-nFlZOpnGlNc7y/+UkkeHnvbOM+rLz4wB1AimgI9QhtnqSZte0wYjbAm8hf7TCwXlXgDwZxAXo6z0a2Wzn9FoOg== +jest-jasmine2@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.0.tgz#1b59e26aa56651bae3d4637965c8cd4d3851de6d" + integrity sha512-2E3c+0A9y2OIK5caw5qlcm3b4doaf8FSfXKTX3xqKTUJoR4zXh0xvERBNWxZP9xMNXEi/2Z3LVsZpR2hROgixA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.5.2" + "@jest/environment" "^26.6.0" "@jest/source-map" "^26.5.0" - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/test-result" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.5.3" + expect "^26.6.0" is-generator-fn "^2.0.0" - jest-each "^26.5.2" - jest-matcher-utils "^26.5.2" - jest-message-util "^26.5.2" - jest-runtime "^26.5.3" - jest-snapshot "^26.5.3" - jest-util "^26.5.2" - pretty-format "^26.5.2" + jest-each "^26.6.0" + jest-matcher-utils "^26.6.0" + jest-message-util "^26.6.0" + jest-runtime "^26.6.0" + jest-snapshot "^26.6.0" + jest-util "^26.6.0" + pretty-format "^26.6.0" throat "^5.0.0" -jest-leak-detector@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz#83fcf9a4a6ef157549552cb4f32ca1d6221eea69" - integrity sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw== +jest-leak-detector@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.0.tgz#a211c4c7627743e8d87b392bf92502cd64275df3" + integrity sha512-3oMv34imWTl1/nwKnmE/DxYo3QqHnZeF3nO6UzldppkhW0Za7OY2DYyWiamqVzwdUrjhoQkY5g+aF6Oc3alYEQ== dependencies: jest-get-type "^26.3.0" - pretty-format "^26.5.2" + pretty-format "^26.6.0" -jest-matcher-utils@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" - integrity sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA== +jest-matcher-utils@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.0.tgz#8f57d78353275bfa7a3ccea128c1030b347138e2" + integrity sha512-BUy/dQYb7ELGRazmK4ZVkbfPYCaNnrMtw1YljVhcKzWUxBM0xQ+bffrfnMLdRZp4wUUcT4ahaVnA3VWZtXWP9Q== dependencies: chalk "^4.0.0" - jest-diff "^26.5.2" + jest-diff "^26.6.0" jest-get-type "^26.3.0" - pretty-format "^26.5.2" + pretty-format "^26.6.0" -jest-message-util@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.5.2.tgz#6c4c4c46dcfbabb47cd1ba2f6351559729bc11bb" - integrity sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw== +jest-message-util@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.0.tgz#c3499053022e05765f71b8c2535af63009e2d4be" + integrity sha512-WPAeS38Kza29f04I0iOIQrXeiebRXjmn6cFehzI7KKJOgT0NmqYAcLgjWnIAfKs5FBmEQgje1kXab0DaLKCl2w== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" @@ -7214,12 +7214,12 @@ jest-message-util@^26.5.2: slash "^3.0.0" stack-utils "^2.0.2" -jest-mock@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.5.2.tgz#c9302e8ef807f2bfc749ee52e65ad11166a1b6a1" - integrity sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw== +jest-mock@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.0.tgz#5d13a41f3662a98a55c7742ac67c482e232ded13" + integrity sha512-HsNmL8vVIn1rL1GWA21Drpy9Cl+7GImwbWz/0fkWHrUXVzuaG7rP0vwLtE+/n70Mt0U8nPkz8fxioi3SC0wqhw== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -7232,83 +7232,83 @@ jest-regex-util@^26.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== -jest-resolve-dependencies@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.3.tgz#11483f91e534bdcd257ab21e8622799e59701aba" - integrity sha512-+KMDeke/BFK+mIQ2IYSyBz010h7zQaVt4Xie6cLqUGChorx66vVeQVv4ErNoMwInnyYHi1Ud73tDS01UbXbfLQ== +jest-resolve-dependencies@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.0.tgz#05bfecc977a3a48929fc7d9876f03d93a16b7df0" + integrity sha512-4di+XUT7LwJJ8b8qFEEDQssC5+aeVjLhvRICCaS4alh/EVS9JCT1armfJ3pnSS8t4o6659WbMmKVo82H4LuUVw== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" jest-regex-util "^26.0.0" - jest-snapshot "^26.5.3" + jest-snapshot "^26.6.0" -jest-resolve@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.5.2.tgz#0d719144f61944a428657b755a0e5c6af4fc8602" - integrity sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg== +jest-resolve@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.0.tgz#070fe7159af87b03e50f52ea5e17ee95bbee40e1" + integrity sha512-tRAz2bwraHufNp+CCmAD8ciyCpXCs1NQxB5EJAmtCFy6BN81loFEGWKzYu26Y62lAJJe4X4jg36Kf+NsQyiStQ== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" chalk "^4.0.0" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^26.5.2" + jest-util "^26.6.0" read-pkg-up "^7.0.1" resolve "^1.17.0" slash "^3.0.0" -jest-runner@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.5.3.tgz#800787459ea59c68e7505952933e33981dc3db38" - integrity sha512-qproP0Pq7IIule+263W57k2+8kWCszVJTC9TJWGUz0xJBr+gNiniGXlG8rotd0XxwonD5UiJloYoSO5vbUr5FQ== +jest-runner@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.0.tgz#465a76efc9ec12cfd83a2af3a6cfb695b13a3efe" + integrity sha512-QpeN6pje8PQvFgT+wYOlzeycKd67qAvSw5FgYBiX2cTW+QTiObTzv/k09qRvT09rcCntFxUhy9VB1mgNGFLYIA== dependencies: - "@jest/console" "^26.5.2" - "@jest/environment" "^26.5.2" - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.0" + "@jest/environment" "^26.6.0" + "@jest/test-result" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.7.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-config "^26.5.3" + jest-config "^26.6.0" jest-docblock "^26.0.0" - jest-haste-map "^26.5.2" - jest-leak-detector "^26.5.2" - jest-message-util "^26.5.2" - jest-resolve "^26.5.2" - jest-runtime "^26.5.3" - jest-util "^26.5.2" + jest-haste-map "^26.6.0" + jest-leak-detector "^26.6.0" + jest-message-util "^26.6.0" + jest-resolve "^26.6.0" + jest-runtime "^26.6.0" + jest-util "^26.6.0" jest-worker "^26.5.0" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.5.3.tgz#5882ae91fd88304310f069549e6bf82f3f198bea" - integrity sha512-IDjalmn2s/Tc4GvUwhPHZ0iaXCdMRq5p6taW9P8RpU+FpG01O3+H8z+p3rDCQ9mbyyyviDgxy/LHPLzrIOKBkQ== +jest-runtime@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.0.tgz#90f80ea5eb0d97a1089120f582fb84bd36ca5491" + integrity sha512-JEz4YGnybFvtN4NLID6lsZf0bcd8jccwjWcG5TRE3fYVnxoX1egTthPjnC4btIwWJ6QaaHhtOQ/E3AGn8iClAw== dependencies: - "@jest/console" "^26.5.2" - "@jest/environment" "^26.5.2" - "@jest/fake-timers" "^26.5.2" - "@jest/globals" "^26.5.3" + "@jest/console" "^26.6.0" + "@jest/environment" "^26.6.0" + "@jest/fake-timers" "^26.6.0" + "@jest/globals" "^26.6.0" "@jest/source-map" "^26.5.0" - "@jest/test-result" "^26.5.2" - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/test-result" "^26.6.0" + "@jest/transform" "^26.6.0" + "@jest/types" "^26.6.0" "@types/yargs" "^15.0.0" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-config "^26.5.3" - jest-haste-map "^26.5.2" - jest-message-util "^26.5.2" - jest-mock "^26.5.2" + jest-config "^26.6.0" + jest-haste-map "^26.6.0" + jest-message-util "^26.6.0" + jest-mock "^26.6.0" jest-regex-util "^26.0.0" - jest-resolve "^26.5.2" - jest-snapshot "^26.5.3" - jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-resolve "^26.6.0" + jest-snapshot "^26.6.0" + jest-util "^26.6.0" + jest-validate "^26.6.0" slash "^3.0.0" strip-bom "^4.0.0" yargs "^15.4.1" @@ -7321,63 +7321,63 @@ jest-serializer@^26.5.0: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.5.3.tgz#f6b4b4b845f85d4b0dadd7cf119c55d0c1688601" - integrity sha512-ZgAk0Wm0JJ75WS4lGaeRfa0zIgpL0KD595+XmtwlIEMe8j4FaYHyZhP1LNOO+8fXq7HJ3hll54+sFV9X4+CGVw== +jest-snapshot@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.0.tgz#457aa9c1761efc781ac9c02b021a0b21047c6a38" + integrity sha512-mcqJZeIZqxomvBcsaiIbiEe2g7K1UxnUpTwjMoHb+DX4uFGnuZoZ6m28YOYRyCfZsdU9mmq73rNBnEH2atTR4Q== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.0.0" chalk "^4.0.0" - expect "^26.5.3" + expect "^26.6.0" graceful-fs "^4.2.4" - jest-diff "^26.5.2" + jest-diff "^26.6.0" jest-get-type "^26.3.0" - jest-haste-map "^26.5.2" - jest-matcher-utils "^26.5.2" - jest-message-util "^26.5.2" - jest-resolve "^26.5.2" + jest-haste-map "^26.6.0" + jest-matcher-utils "^26.6.0" + jest-message-util "^26.6.0" + jest-resolve "^26.6.0" natural-compare "^1.4.0" - pretty-format "^26.5.2" + pretty-format "^26.6.0" semver "^7.3.2" -jest-util@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.5.2.tgz#8403f75677902cc52a1b2140f568e91f8ed4f4d7" - integrity sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg== +jest-util@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.0.tgz#a81547f6d38738b505c5a594b37d911335dea60f" + integrity sha512-/cUGqcnKeZMjvTQLfJo65nBOEZ/k0RB/8usv2JpfYya05u0XvBmKkIH5o5c4nCh9DD61B1YQjMGGqh1Ha0aXdg== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^2.0.0" micromatch "^4.0.2" -jest-validate@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.5.3.tgz#eefd5a5c87059550548c5ad8d6589746c66929e3" - integrity sha512-LX07qKeAtY+lsU0o3IvfDdN5KH9OulEGOMN1sFo6PnEf5/qjS1LZIwNk9blcBeW94pQUI9dLN9FlDYDWI5tyaA== +jest-validate@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.0.tgz#b95e2076cca1a58b183e5bcce2bf43af52eebf10" + integrity sha512-FKHNqvh1Pgs4NWas56gsTPmjcIoGAAzSVUCK1+g8euzuCGbmdEr8LRTtOEFjd29uMZUk0PhzmzKGlHPe6j3UWw== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" camelcase "^6.0.0" chalk "^4.0.0" jest-get-type "^26.3.0" leven "^3.1.0" - pretty-format "^26.5.2" + pretty-format "^26.6.0" -jest-watcher@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.5.2.tgz#2957f4461007e0769d74b537379ecf6b7c696916" - integrity sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw== +jest-watcher@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.0.tgz#06001c22831583a16f9ccb388ee33316a7f4200f" + integrity sha512-gw5BvcgPi0PKpMlNWQjUet5C5A4JOYrT7gexdP6+DR/f7mRm7wE0o1GqwPwcTsTwo0/FNf9c/kIDXTRaSAYwlw== dependencies: - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/test-result" "^26.6.0" + "@jest/types" "^26.6.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^26.5.2" + jest-util "^26.6.0" string-length "^4.0.1" jest-worker@^26.5.0: @@ -7389,14 +7389,14 @@ jest-worker@^26.5.0: merge-stream "^2.0.0" supports-color "^7.0.0" [email protected]: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.5.3.tgz#5e7a322d16f558dc565ca97639e85993ef5affe6" - integrity sha512-uJi3FuVSLmkZrWvaDyaVTZGLL8WcfynbRnFXyAHuEtYiSZ+ijDDIMOw1ytmftK+y/+OdAtsG9QrtbF7WIBmOyA== [email protected]: + version "26.6.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.0.tgz#546b25a1d8c888569dbbe93cae131748086a4a25" + integrity sha512-jxTmrvuecVISvKFFhOkjsWRZV7sFqdSUAd1ajOKY+/QE/aLBVstsJ/dX8GczLzwiT6ZEwwmZqtCUHLHHQVzcfA== dependencies: - "@jest/core" "^26.5.3" + "@jest/core" "^26.6.0" import-local "^3.0.2" - jest-cli "^26.5.3" + jest-cli "^26.6.0" jquery@^3.4.1: version "3.5.0" @@ -9973,12 +9973,12 @@ pretty-error@^2.0.2: renderkid "^2.0.1" utila "~0.4" -pretty-format@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.5.2.tgz#5d896acfdaa09210683d34b6dc0e6e21423cd3e1" - integrity sha512-VizyV669eqESlkOikKJI8Ryxl/kPpbdLwNdPs2GrbQs18MpySB5S0Yo0N7zkg2xTRiFq4CFw8ct5Vg4a0xP0og== +pretty-format@^26.6.0: + version "26.6.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.0.tgz#1e1030e3c70e3ac1c568a5fd15627671ea159391" + integrity sha512-Uumr9URVB7bm6SbaByXtx+zGlS+0loDkFMHP0kHahMjmfCtmFY03iqd++5v3Ld6iB5TocVXlBN/T+DXMn9d4BA== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.0" ansi-regex "^5.0.0" ansi-styles "^4.0.0" react-is "^16.12.0"
53ec35a2259444c588562236bcf9db0937977b15
2020-08-19 01:28:45
sgqy
feat: Japan MFA, Press conference (#5452)
false
Japan MFA, Press conference (#5452)
feat
diff --git a/docs/en/government.md b/docs/en/government.md index 6e91cf89ced6fe..eb9f9e8d33dc9a 100644 --- a/docs/en/government.md +++ b/docs/en/government.md @@ -4,6 +4,12 @@ pageClass: routes # Goverment +## Ministry of Foreign Affairs of Japan + +### Press conference + +<RouteEn author="sgqy" example="/go.jp/mofa" path="/go.jp/mofa"/> + ## United Nations ### Security Council Vetoed a Resolution diff --git a/docs/government.md b/docs/government.md index 6c73d009519946..38f10a91b06090 100644 --- a/docs/government.md +++ b/docs/government.md @@ -71,6 +71,12 @@ pageClass: routes <Route author="HenryQW" example="/un/scveto" path="/un/scveto"/> +## 日本国外務省 + +### 記者会見 + +<Route author="sgqy" example="/go.jp/mofa" path="/go.jp/mofa"/> + ## 苏州市人民政府 ### 政府新闻 diff --git a/lib/router.js b/lib/router.js index 2a3a3d363da11a..e2761a9aa4d52d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1258,6 +1258,9 @@ router.get('/gov/beijing/bjeea/:type', require('./routes/gov/beijing/eea')); // 广东省教育厅 router.get('/gov/guangdong/edu/:caty', require('./routes/gov/guangdong/edu')); +// 日本国外務省記者会見 +router.get('/go.jp/mofa', require('./routes/go.jp/mofa/main')); + // 小黑盒 router.get('/xiaoheihe/user/:id', require('./routes/xiaoheihe/user')); router.get('/xiaoheihe/news', require('./routes/xiaoheihe/news')); diff --git a/lib/routes/go.jp/mofa/main.js b/lib/routes/go.jp/mofa/main.js new file mode 100644 index 00000000000000..4ed0ba2c635ef7 --- /dev/null +++ b/lib/routes/go.jp/mofa/main.js @@ -0,0 +1,95 @@ +// Japan government page + +// params: +// [null] + +const got = require('@/utils/got'); // get web content +const cheerio = require('cheerio'); // html parser +const path = require('path'); + +const base_url = 'https://www.mofa.go.jp'; +const index_url = path.join(base_url, '/mofaj/press/kaiken/bn/index.html'); +module.exports = async (ctx) => { + // get the update list + const response = await got({ + method: 'get', + url: index_url, + }); + const data = response.data; // content is html format + + const $ = cheerio.load(data); + const list = $('dl.title-list dt.list-title a'); + + // parse meeting urls + const detail_urls = []; + for (let i = 0; i < list.length; ++i) { + // for (let i = 0; i < 1; ++i) { + const a = list[i]; + if ($(a).text() === 'テキスト版要旨') { + let l = $(a).attr('href'); + l = path.join(base_url, l); + detail_urls.push(l); + } + } + + // get meetings + const responses = await Promise.all(detail_urls.map((url) => got(url))); + const meetings = responses.map(({ data }) => data); + + // get real data to feed + const article_list = []; + for (let i = 0; i < meetings.length; ++i) { + const $ = cheerio.load(meetings[i]); + $('script').remove(); + $('div.social-btn-top').remove(); + const link = $('meta[property="og:url"]').attr('content'); + const title = $('meta[property="og:title"]').attr('content'); + const author = '外務省'; + const content = $('h3.title3').html() + '<br/>' + $('div#maincontents').html(); + + let pub_date_num = '1970-01-01T00:00Z'; + try { + const date_str = $('h3.title3').text(); + const m = date_str.match(/((..)([0-9]+)年([0-9]+)月([0-9]+)日((.)曜日)([0-9]+)時([0-9]+)分.*)/); + const era = m[1]; + let yy = parseInt(m[2]); + const mm = m[3]; + const dd = m[4]; + // const ww = m[5]; + const HH = m[6]; + const MM = m[7]; + switch (era) { + case '昭和': + yy += 1925; + break; + case '平成': + yy += 1988; + break; + case '令和': + yy += 2018; + break; + } + pub_date_num = yy.toString() + '-' + mm + '-' + dd + ' ' + HH + ':' + MM + ' +09'; + // console.log(pub_date_num); + } catch (_) { + _; + } + const pub_date = new Date(pub_date_num).toUTCString(); + + const item = { + title: title, + author: author, + pubDate: pub_date, + link: link, + description: content, + }; + article_list.push(item); + } + + // feed the data + ctx.state.data = { + title: '日本国外務省記者会見', + link: index_url, + item: article_list, + }; +};
26ad38a0da22bff03dcf68b435eeded440307032
2021-01-10 13:23:24
GitHub Action
style: auto format
false
auto format
style
diff --git a/docs/bbs.md b/docs/bbs.md index a3eac632655e29..81779d9bf7f5c0 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -188,7 +188,7 @@ pageClass: routes 帖子网址如果为 <https://www.scboy.com/?thread-188673.htm> 那么帖子 tid 就是 `1789863`。 -访问水区需要添加环境变量 `SCBOY_BBS_TOKEN`, 详情见部署页面的配置模块。 `SCBOY_BBS_TOKEN`在cookies的`bbs_token`中。 +访问水区需要添加环境变量 `SCBOY_BBS_TOKEN`, 详情见部署页面的配置模块。 `SCBOY_BBS_TOKEN`在 cookies 的`bbs_token`中。 </Route> ## V2EX diff --git a/lib/router.js b/lib/router.js index a14f5c4e2c8d78..46d98594bef216 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3774,7 +3774,6 @@ router.get('/sciencenet/blog/:type?/:time?/:sort?', require('./routes/sciencenet // DailyArt router.get('/dailyart/:language?', require('./routes/dailyart/index')); - // SCBOY router.get('/scboy/thread/:tid', require('./routes/scboy/thread')); @@ -3821,5 +3820,4 @@ router.get('/simpread/changelog', require('./routes/simpread/changelog')); // Radio Free Asia router.get('/rfa/:language?/:channel?/:subChannel?', require('./routes/rfa/index')); - module.exports = router;
932dd502911f8cdb3f32259b34c133a062a7ca97
2020-12-10 03:54:11
dependabot-preview[bot]
chore(deps-dev): bump @types/cheerio from 0.22.22 to 0.22.23 (#6379)
false
bump @types/cheerio from 0.22.22 to 0.22.23 (#6379)
chore
diff --git a/package.json b/package.json index 03cfe36ec6a3f4..b1156e538af6fd 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/DIYgod/RSSHub#readme", "devDependencies": { - "@types/cheerio": "0.22.22", + "@types/cheerio": "0.22.23", "@types/got": "9.6.11", "@types/koa": "2.11.6", "@vuepress/plugin-back-to-top": "1.7.1", diff --git a/yarn.lock b/yarn.lock index f3514bce5baf04..6e698fd56015ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1557,10 +1557,10 @@ resolved "https://registry.yarnpkg.com/@types/chance/-/chance-1.1.0.tgz#7d8e6bd0506344d94c042f692d59d20f8eb7d66d" integrity sha512-j/9aaLU6JaaN2iFiSZgvD+G0nju1Fi2/f2WM+WwS+8+cpTdzFhXFH3+SHZgfjgum6wNW80sfcawUx+Rx7tH26w== -"@types/[email protected]": - version "0.22.22" - resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.22.tgz#ae71cf4ca59b8bbaf34c99af7a5d6c8894988f5f" - integrity sha512-05DYX4zU96IBfZFY+t3Mh88nlwSMtmmzSYaQkKN48T495VV1dkHSah6qYyDTN5ngaS0i0VonH37m+RuzSM0YiA== +"@types/[email protected]": + version "0.22.23" + resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.23.tgz#74bcfee9c5ee53f619711dca953a89fe5cfa4eb4" + integrity sha512-QfHLujVMlGqcS/ePSf3Oe5hK3H8wi/yN2JYuxSB1U10VvW1fO3K8C+mURQesFYS1Hn7lspOsTT75SKq/XtydQg== dependencies: "@types/node" "*"
c1a5b0c48a5c3df11537cf89d5f7e7add3dc003f
2019-01-24 09:02:10
DIYgod
app: remove config.connect.disabled
false
remove config.connect.disabled
app
diff --git a/lib/config.js b/lib/config.js index 1e4c138690b9ff..14366569e20cfe 100644 --- a/lib/config.js +++ b/lib/config.js @@ -2,7 +2,6 @@ module.exports = { connect: { port: process.env.PORT || 1200, // 监听端口 socket: process.env.SOCKET || null, // 监听 Unix Socket, null 为禁用 - disabled: process.env.CONNECT_DISABLED, // 禁用监听,测试用 }, cacheType: process.env.CACHE_TYPE || 'memory', // 缓存类型,支持 'memory' 和 'redis',设为空可以禁止缓存 cacheExpire: process.env.CACHE_EXPIRE || 5 * 60, // 缓存时间,单位为秒 diff --git a/lib/index.js b/lib/index.js index 4a442d7b47c0e0..35045957f26da7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -125,9 +125,6 @@ app.use(mount('/protected', protected_router.routes())).use(protected_router.all app.use(mount('/api', api_router.routes())).use(api_router.allowedMethods()); // connect -if (config.connect.disabled) { - process.exit(); -} if (config.connect.port) { app.listen(config.connect.port, parseInt(config.listenInaddrAny) ? null : '127.0.0.1'); logger.info('Listening Port ' + config.connect.port);
1f00f0f0d67dfa47a78049a51b97ef43321f7120
2023-11-28 03:20:32
dependabot[bot]
chore(deps-dev): bump @types/react from 18.2.38 to 18.2.39 in /website (#13891)
false
bump @types/react from 18.2.38 to 18.2.39 in /website (#13891)
chore
diff --git a/website/package.json b/website/package.json index 49c29204256b5b..e2c08bc34b84cf 100644 --- a/website/package.json +++ b/website/package.json @@ -36,7 +36,7 @@ "@docusaurus/types": "3.0.0", "@types/markdown-it": "^13.0.7", "@types/mdx-js__react": "^1.5.8", - "@types/react": "^18.2.38", + "@types/react": "^18.2.39", "@types/react-dom": "^18.2.17", "typescript": "^5.2.2" }, diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index f91ec8194a09fa..cbb2ef6975419b 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -19,10 +19,10 @@ dependencies: version: 3.0.0([email protected])([email protected])([email protected]) '@docusaurus/preset-classic': specifier: 3.0.0 - version: 3.0.0(@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]) + version: 3.0.0(@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]) '@mdx-js/react': specifier: ^3.0.0 - version: 3.0.0(@types/[email protected])([email protected]) + version: 3.0.0(@types/[email protected])([email protected]) clsx: specifier: ^2.0.0 version: 2.0.0 @@ -62,8 +62,8 @@ devDependencies: specifier: ^1.5.8 version: 1.5.8 '@types/react': - specifier: ^18.2.38 - version: 18.2.38 + specifier: ^18.2.39 + version: 18.2.39 '@types/react-dom': specifier: ^18.2.17 version: 18.2.17 @@ -1651,7 +1651,7 @@ packages: resolution: {integrity: sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==} dev: false - /@docsearch/[email protected](@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]): + /@docsearch/[email protected](@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -1671,7 +1671,7 @@ packages: '@algolia/autocomplete-core': 1.9.3(@algolia/[email protected])([email protected])([email protected]) '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/[email protected])([email protected]) '@docsearch/css': 3.5.2 - '@types/react': 18.2.38 + '@types/react': 18.2.39 algoliasearch: 4.20.0 react: 18.2.0 react-dom: 18.2.0([email protected]) @@ -2003,7 +2003,7 @@ packages: '@docusaurus/react-loadable': 5.5.2([email protected]) '@docusaurus/types': 3.0.0([email protected])([email protected]) '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 '@types/react-router-config': 5.0.9 '@types/react-router-dom': 5.3.3 react: 18.2.0 @@ -2174,7 +2174,7 @@ packages: - webpack-cli dev: false - /@docusaurus/[email protected](@types/[email protected])([email protected])([email protected])([email protected]): + /@docusaurus/[email protected](@types/[email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-gSV07HfQgnUboVEb3lucuVyv5pEoy33E7QXzzn++3kSc/NLEimkjXh3sSnTGOishkxCqlFV9BHfY/VMm5Lko5g==} engines: {node: '>=18.0'} peerDependencies: @@ -2184,7 +2184,7 @@ packages: '@docusaurus/core': 3.0.0(@docusaurus/[email protected])([email protected])([email protected])([email protected]) '@docusaurus/types': 3.0.0([email protected])([email protected]) '@docusaurus/utils': 3.0.0(@docusaurus/[email protected]) - '@microlink/react-json-view': 1.23.0(@types/[email protected])([email protected])([email protected]) + '@microlink/react-json-view': 1.23.0(@types/[email protected])([email protected])([email protected]) fs-extra: 11.1.1 react: 18.2.0 react-dom: 18.2.0([email protected]) @@ -2386,7 +2386,7 @@ packages: - webpack-cli dev: false - /@docusaurus/[email protected](@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]): + /@docusaurus/[email protected](@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-90aOKZGZdi0+GVQV+wt8xx4M4GiDrBRke8NO8nWwytMEXNrxrBxsQYFRD1YlISLJSCiHikKf3Z/MovMnQpnZyg==} engines: {node: '>=18.0'} peerDependencies: @@ -2397,14 +2397,14 @@ packages: '@docusaurus/plugin-content-blog': 3.0.0([email protected])([email protected])([email protected]) '@docusaurus/plugin-content-docs': 3.0.0([email protected])([email protected])([email protected]) '@docusaurus/plugin-content-pages': 3.0.0([email protected])([email protected])([email protected]) - '@docusaurus/plugin-debug': 3.0.0(@types/[email protected])([email protected])([email protected])([email protected]) + '@docusaurus/plugin-debug': 3.0.0(@types/[email protected])([email protected])([email protected])([email protected]) '@docusaurus/plugin-google-analytics': 3.0.0([email protected])([email protected])([email protected]) '@docusaurus/plugin-google-gtag': 3.0.0([email protected])([email protected])([email protected]) '@docusaurus/plugin-google-tag-manager': 3.0.0([email protected])([email protected])([email protected]) '@docusaurus/plugin-sitemap': 3.0.0([email protected])([email protected])([email protected]) - '@docusaurus/theme-classic': 3.0.0(@types/[email protected])([email protected])([email protected])([email protected]) + '@docusaurus/theme-classic': 3.0.0(@types/[email protected])([email protected])([email protected])([email protected]) '@docusaurus/theme-common': 3.0.0(@docusaurus/[email protected])([email protected])([email protected])([email protected]) - '@docusaurus/theme-search-algolia': 3.0.0(@algolia/[email protected])(@docusaurus/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]) + '@docusaurus/theme-search-algolia': 3.0.0(@algolia/[email protected])(@docusaurus/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]) '@docusaurus/types': 3.0.0([email protected])([email protected]) react: 18.2.0 react-dom: 18.2.0([email protected]) @@ -2435,11 +2435,11 @@ packages: peerDependencies: react: '*' dependencies: - '@types/react': 18.2.38 + '@types/react': 18.2.39 prop-types: 15.8.1 react: 18.2.0 - /@docusaurus/[email protected](@types/[email protected])([email protected])([email protected])([email protected]): + /@docusaurus/[email protected](@types/[email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-wWOHSrKMn7L4jTtXBsb5iEJ3xvTddBye5PjYBnWiCkTAlhle2yMdc4/qRXW35Ot+OV/VXu6YFG8XVUJEl99z0A==} engines: {node: '>=18.0'} peerDependencies: @@ -2458,7 +2458,7 @@ packages: '@docusaurus/utils': 3.0.0(@docusaurus/[email protected]) '@docusaurus/utils-common': 3.0.0(@docusaurus/[email protected]) '@docusaurus/utils-validation': 3.0.0(@docusaurus/[email protected]) - '@mdx-js/react': 3.0.0(@types/[email protected])([email protected]) + '@mdx-js/react': 3.0.0(@types/[email protected])([email protected]) clsx: 1.2.1 copy-text-to-clipboard: 3.2.0 infima: 0.2.0-alpha.43 @@ -2507,7 +2507,7 @@ packages: '@docusaurus/utils': 3.0.0(@docusaurus/[email protected]) '@docusaurus/utils-common': 3.0.0(@docusaurus/[email protected]) '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 '@types/react-router-config': 5.0.9 clsx: 1.2.1 parse-numeric-range: 1.3.0 @@ -2535,14 +2535,14 @@ packages: - webpack-cli dev: false - /@docusaurus/[email protected](@algolia/[email protected])(@docusaurus/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]): + /@docusaurus/[email protected](@algolia/[email protected])(@docusaurus/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-PyMUNIS9yu0dx7XffB13ti4TG47pJq3G2KE/INvOFb6M0kWh+wwCnucPg4WAOysHOPh+SD9fjlXILoLQstgEIA==} engines: {node: '>=18.0'} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 dependencies: - '@docsearch/react': 3.5.2(@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]) + '@docsearch/react': 3.5.2(@algolia/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]) '@docusaurus/core': 3.0.0(@docusaurus/[email protected])([email protected])([email protected])([email protected]) '@docusaurus/logger': 3.0.0 '@docusaurus/plugin-content-docs': 3.0.0([email protected])([email protected])([email protected]) @@ -2601,7 +2601,7 @@ packages: react-dom: ^16.8.4 || ^17.0.0 dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 commander: 5.1.0 joi: 17.11.0 react: 18.2.0 @@ -2624,7 +2624,7 @@ packages: react-dom: ^18.0.0 dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 commander: 5.1.0 joi: 17.11.0 react: 18.2.0 @@ -2888,14 +2888,14 @@ packages: - supports-color dev: false - /@mdx-js/[email protected](@types/[email protected])([email protected]): + /@mdx-js/[email protected](@types/[email protected])([email protected]): resolution: {integrity: sha512-nDctevR9KyYFyV+m+/+S4cpzCWHqj+iHDHq3QrsWezcC+B17uZdIWgCguESUkwFhM3n/56KxWVE3V6EokrmONQ==} peerDependencies: '@types/react': '>=16' react: '>=16' dependencies: '@types/mdx': 2.0.9 - '@types/react': 18.2.38 + '@types/react': 18.2.39 react: 18.2.0 dev: false @@ -2903,7 +2903,7 @@ packages: resolution: {integrity: sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==} dev: false - /@microlink/[email protected](@types/[email protected])([email protected])([email protected]): + /@microlink/[email protected](@types/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-HYJ1nsfO4/qn8afnAMhuk7+5a1vcjEaS8Gm5Vpr1SqdHDY0yLBJGpA+9DvKyxyVKaUkXzKXt3Mif9RcmFSdtYg==} peerDependencies: react: '>= 15' @@ -2914,7 +2914,7 @@ packages: react-base16-styling: 0.6.0 react-dom: 18.2.0([email protected]) react-lifecycles-compat: 3.0.4 - react-textarea-autosize: 8.3.4(@types/[email protected])([email protected]) + react-textarea-autosize: 8.3.4(@types/[email protected])([email protected]) transitivePeerDependencies: - '@types/react' - encoding @@ -3421,7 +3421,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-iLQL8JZ4AZ+rpZvGUsQwENffpsSCMLYB8kE6OhGasLmdYn7aSLq53uOvZrKx5FM+hymE2nm08HDfq7tFx02ElA==} dependencies: - '@types/react': 18.2.38 + '@types/react': 18.2.39 dev: true /@types/[email protected]: @@ -3481,31 +3481,31 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-rvrT/M7Df5eykWFxn6MYt5Pem/Dbyc1N8Y0S9Mrkw2WFCRiqUgw9P7ul2NpwsXCSM1DVdENzdG9J5SreqfAIWg==} dependencies: - '@types/react': 18.2.38 + '@types/react': 18.2.39 dev: true /@types/[email protected]: resolution: {integrity: sha512-a7zOj9yVUtM3Ns5stoseQAAsmppNxZpXDv6tZiFV5qlRmV4W96u53on1vApBX1eRSc8mrFOiB54Hc0Pk1J8GFg==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 '@types/react-router': 5.1.20 /@types/[email protected]: resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 '@types/react-router': 5.1.20 /@types/[email protected]: resolution: {integrity: sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.38 + '@types/react': 18.2.39 - /@types/[email protected]: - resolution: {integrity: sha512-cBBXHzuPtQK6wNthuVMV6IjHAFkdl/FOPFIlkd81/Cd1+IqkHu/A+w4g43kaQQoYHik/ruaQBDL72HyCy1vuMw==} + /@types/[email protected]: + resolution: {integrity: sha512-Oiw+ppED6IremMInLV4HXGbfbG6GyziY3kqAwJYOR0PNbkYDmLWQA3a95EhdSmamsvbkJN96ZNN+YD+fGjzSBA==} dependencies: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 @@ -9280,7 +9280,7 @@ packages: tiny-warning: 1.0.3 dev: false - /[email protected](@types/[email protected])([email protected]): + /[email protected](@types/[email protected])([email protected]): resolution: {integrity: sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ==} engines: {node: '>=10'} peerDependencies: @@ -9289,7 +9289,7 @@ packages: '@babel/runtime': 7.23.2 react: 18.2.0 use-composed-ref: 1.3.0([email protected]) - use-latest: 1.2.1(@types/[email protected])([email protected]) + use-latest: 1.2.1(@types/[email protected])([email protected]) transitivePeerDependencies: - '@types/react' dev: false @@ -10854,7 +10854,7 @@ packages: react: 18.2.0 dev: false - /[email protected](@types/[email protected])([email protected]): + /[email protected](@types/[email protected])([email protected]): resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: '@types/react': '*' @@ -10863,11 +10863,11 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.38 + '@types/react': 18.2.39 react: 18.2.0 dev: false - /[email protected](@types/[email protected])([email protected]): + /[email protected](@types/[email protected])([email protected]): resolution: {integrity: sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==} peerDependencies: '@types/react': '*' @@ -10876,9 +10876,9 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.38 + '@types/react': 18.2.39 react: 18.2.0 - use-isomorphic-layout-effect: 1.1.2(@types/[email protected])([email protected]) + use-isomorphic-layout-effect: 1.1.2(@types/[email protected])([email protected]) dev: false /[email protected]:
ea5428e12bc329b913d69e3cf31d452dd549e15c
2020-08-29 02:34:09
Ethan Shen
feat: add 它惠网线报列表 (#5533)
false
add 它惠网线报列表 (#5533)
feat
diff --git a/docs/shopping.md b/docs/shopping.md index d979b08d2db621..1a9403887d339c 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -209,6 +209,12 @@ For instance, in <https://www.leboncoin.fr/recherche/?**category=10&locations=Pa <Route author="nczitzk" example="/smzdm/baoliao/7367111021" path="/smzdm/baoliao/:uid" :paramsDesc="['用户id,网址上直接可以看到']"/> +## 它惠网 + +### 线报 + +<Route author="nczitzk" example="/tahui/rptlist" path="/tahui/rptlist"/> + ## 淘宝众筹 ### 众筹项目 diff --git a/lib/router.js b/lib/router.js index 334ac887ab2a4e..f52040d5418042 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3119,6 +3119,9 @@ router.get('/fjnews/fz/30', require('./routes/fjnews/fznews')); // 九江新闻jjnews router.get('/fjnews/jjnews', require('./routes/fjnews/jjnews')); +// 它惠网 +router.get('/tahui/rptlist', require('./routes/tahui/rptlist')); + // Guiltfree router.get('/guiltfree/onsale', require('./routes/guiltfree/onsale')); diff --git a/lib/routes/tahui/rptlist.js b/lib/routes/tahui/rptlist.js new file mode 100644 index 00000000000000..6073cd961170e2 --- /dev/null +++ b/lib/routes/tahui/rptlist.js @@ -0,0 +1,49 @@ +const url = require('url'); +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.tahui.com/'; + const currentUrl = 'https://www.tahui.com/rptlist'; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + const $ = cheerio.load(response.data); + const list = $('article.excerpt h2') + .slice(0, 10) + .map((_, item) => { + item = $(item); + const a = item.find('a').eq(0); + return { + title: a.text(), + link: url.resolve(rootUrl, a.attr('href')), + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.pubDate = new Date(content('div.meta span').eq(0).text().trim().replace(/\n/g, '')).toUTCString(); + item.description = content('div.artcontent').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: '它惠网 - 线报', + link: currentUrl, + item: items, + }; +};
2f0e3ada69d62e44c3f7cf77013b06cc14cb590c
2022-02-20 20:27:32
Fatpandac
feat(route): add 腾讯研究院 (#9159)
false
add 腾讯研究院 (#9159)
feat
diff --git a/docs/new-media.md b/docs/new-media.md index f57d19a6ca8bb6..19403c17cb663c 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -2983,6 +2983,12 @@ column 为 third 时可选的 category: <Route author="LogicJake" example="/tencent/news/author/5933889" path="/tencent/news/author/:mid" :paramsDesc="['企鹅号 ID']"/> +## 腾讯研究院 + +### 最近更新 + +<Route author="Fatpandac" example="/tisi/latest" path="/tisi/latest"/> + ## 通識・現代中國 ### 議題熱話 diff --git a/lib/v2/tisi/index.js b/lib/v2/tisi/index.js new file mode 100644 index 00000000000000..f00833fa9bdb97 --- /dev/null +++ b/lib/v2/tisi/index.js @@ -0,0 +1,38 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +const rootUrl = 'https://www.tisi.org'; + +module.exports = async (ctx) => { + const url = `${rootUrl}/?page_id=11151`; + + const response = await got(url); + const $ = cheerio.load(response.data); + const list = $('div.new-artice-list-box') + .map((_, item) => ({ + title: $(item).find('p.new-article-title > a').text(), + link: new URL($(item).find('p.new-article-title > a').attr('href'), rootUrl).href, + pubDate: parseDate($(item).find('p.new-article-date > span.left-span').text()), + category: $(item).find('p.new-article-date > span:nth-child(1)').text(), + })) + .get(); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got(item.link); + const content = cheerio.load(detailResponse.data); + item.description = content('div.article-content').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: '腾讯研究院 - 最近更新', + link: url, + item: items, + }; +}; diff --git a/lib/v2/tisi/maintainer.js b/lib/v2/tisi/maintainer.js new file mode 100644 index 00000000000000..bea03de5ec7284 --- /dev/null +++ b/lib/v2/tisi/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/latest': ['Fatpandac'], +}; diff --git a/lib/v2/tisi/radar.js b/lib/v2/tisi/radar.js new file mode 100644 index 00000000000000..b5294973c51812 --- /dev/null +++ b/lib/v2/tisi/radar.js @@ -0,0 +1,17 @@ +module.exports = { + 'tisi.org': { + _name: '腾讯研究院', + '.': [ + { + title: '最近更新', + docs: 'https://docs.rsshub.app/new-media.html#teng-xun-yan-jiu-yuan', + source: ['/'], + target: (_params, url) => { + if (new URL(url).searchParams.get('page_id') === '11151') { + return '/tisi/latest'; + } + }, + }, + ], + }, +}; diff --git a/lib/v2/tisi/router.js b/lib/v2/tisi/router.js new file mode 100644 index 00000000000000..e20373cf8db1e9 --- /dev/null +++ b/lib/v2/tisi/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/latest', require('./index')); +};
a06670eff5248b474b200f60649daa5b296b854f
2024-09-20 18:24:46
AzureG03
feat(route): add 西南交通大学计算机学院本科生教育 (#16810)
false
add 西南交通大学计算机学院本科生教育 (#16810)
feat
diff --git a/lib/routes/swjtu/scai/bks.ts b/lib/routes/swjtu/scai/bks.ts new file mode 100644 index 00000000000000..af442a576c01b1 --- /dev/null +++ b/lib/routes/swjtu/scai/bks.ts @@ -0,0 +1,80 @@ +import { Route } from '@/types'; +import cache from '@/utils/cache'; +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; +import got from '@/utils/got'; +import { ofetch } from 'ofetch'; + +const rootURL = 'https://scai.swjtu.edu.cn'; +const pageURL = `${rootURL}/web/page-module.html?mid=B730BEB095B31840`; + +export const route: Route = { + path: '/scai/bks', + categories: ['university'], + example: '/swjtu/scai/bks', + parameters: {}, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: true, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + source: ['scai.swjtu.edu.cn/'], + }, + ], + name: '计算机与人工智能学院', + description: '本科生教育', + maintainers: ['AzureG03'], + handler, +}; + +const getItem = (item, cache) => { + const title = item.find('a').text(); + const link = `${rootURL}${item.find('a').attr('href').slice(2)}`; + + return cache.tryGet(link, async () => { + const res = await ofetch(link); + const $ = load(res); + + const pubDate = parseDate( + $('div.news-info span:nth-of-type(2)') + .text() + .match(/\d{4}(-|\/|.)\d{1,2}\1\d{1,2}/)[0] + ); + const description = $('div.content-main').html(); + return { + title, + pubDate, + link, + description, + }; + }); +}; + +async function handler() { + const res = await got({ + method: 'get', + url: pageURL, + }); + + const $ = load(res.data); + const $list = $('div.list-top-item, div.item-wrapper'); + + const items = await Promise.all( + $list.toArray().map((i) => { + const $item = $(i); + return getItem($item, cache); + }) + ); + + return { + title: '西南交大计算机学院-本科生教育', + link: pageURL, + item: items, + allowEmpty: true, + }; +}
67b36025744f6ea39f4b56b2f6fc539d5c1dd051
2022-06-01 18:00:10
dependabot[bot]
chore(deps): bump socks-proxy-agent from 6.2.0 to 7.0.0 (#9868)
false
bump socks-proxy-agent from 6.2.0 to 7.0.0 (#9868)
chore
diff --git a/package.json b/package.json index 2e321de71665a8..d4b7ab61bc3b54 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "rss-parser": "3.12.0", "showdown": "2.1.0", "simplecc-wasm": "0.1.4", - "socks-proxy-agent": "6.2.0", + "socks-proxy-agent": "7.0.0", "string-similarity": "4.0.4", "tiny-async-pool": "2.1.0", "torrent-search-api": "2.1.4", diff --git a/yarn.lock b/yarn.lock index fd3dcb9c8e7a16..716d41b575ff0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12410,10 +12410,10 @@ socks-proxy-agent@5, socks-proxy-agent@^5.0.0: debug "4" socks "^2.3.3" [email protected]: - version "6.2.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.2.0.tgz#f6b5229cc0cbd6f2f202d9695f09d871e951c85e" - integrity sha512-wWqJhjb32Q6GsrUqzuFkukxb/zzide5quXYcMVpIjxalDBBYy2nqKCFQ/9+Ie4dvOYSQdOk3hUlZSdzZOd3zMQ== [email protected]: + version "7.0.0" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" + integrity sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww== dependencies: agent-base "^6.0.2" debug "^4.3.3"
d8ddc29e4356472be7d82354c39c0f1fc8e6da21
2023-07-28 18:02:39
Felix Hsu
fix(route): bloomberg: add default handing of news in storymode based on react-renderer (#12878)
false
bloomberg: add default handing of news in storymode based on react-renderer (#12878)
fix
diff --git a/lib/v2/bloomberg/react-renderer.js b/lib/v2/bloomberg/react-renderer.js index 00fc468c666d77..2298f1bc65a20a 100644 --- a/lib/v2/bloomberg/react-renderer.js +++ b/lib/v2/bloomberg/react-renderer.js @@ -1,6 +1,39 @@ const art = require('art-template'); const path = require('path'); -const { processVideo } = require('./utils'); +const got = require('@/utils/got'); + +const headers = { + accept: 'application/json', + 'cache-control': 'no-cache', + referer: 'https://www.bloomberg.com', +}; + +const processVideo = async (bmmrId, summary) => { + const api = `https://www.bloomberg.com/multimedia/api/embed?id=${bmmrId}`; + const res = await got(api, { headers }); + + // Blocked by PX3, return the default + const redirectUrls = res.redirectUrls.map(String); + if (redirectUrls.some((r) => new URL(r).pathname === '/tosv2.html')) { + return { + stream: '', + mp4: '', + coverUrl: '', + caption: summary, + }; + } + + if (res.data) { + const video_json = res.data; + return { + stream: video_json.streams ? video_json.streams[0]?.url : '', + mp4: video_json.downloadURLs ? video_json.downloadURLs['600'] : '', + coverUrl: video_json.thumbnail?.baseUrl ?? '', + caption: video_json.description || video_json.title || summary, + }; + } + return {}; +}; const nodeRenderers = { paragraph: async (node, nextNode) => `<p>${await nextNode(node.content)}</p>`, @@ -128,9 +161,9 @@ const nodeRenderers = { } if (t === 'video') { const h = node.data; - const id = h.attachment && h.attachment.id; - const v = await processVideo(id); - return v; + const id = h.attachment?.id; + const desc = await processVideo(id, h.attachment?.title); + return art(path.join(__dirname, 'templates/video_media.art'), desc); } if (t === 'audio' && node.data.attachment) { const B = node.data.attachment; @@ -187,4 +220,6 @@ const documentToHtmlString = async (document) => { module.exports = { documentToHtmlString, + processVideo, + headers, }; diff --git a/lib/v2/bloomberg/utils.js b/lib/v2/bloomberg/utils.js index 2f42ac910f1726..419194459893ed 100644 --- a/lib/v2/bloomberg/utils.js +++ b/lib/v2/bloomberg/utils.js @@ -6,7 +6,7 @@ const { parseDate } = require('@/utils/parse-date'); const got = require('@/utils/got'); const { art } = require('@/utils/render'); -const { documentToHtmlString } = require('./react-renderer'); +const { documentToHtmlString, processVideo, headers } = require('./react-renderer'); const rootUrl = 'https://www.bloomberg.com/feeds'; const sel = 'script[data-component-props="ArticleBody"], script[data-component-props="FeatureBody"]'; @@ -40,11 +40,6 @@ const apiEndpoints = { sel: 'script#__SSR_DATA__', }, }; -const headers = { - accept: 'application/json', - 'cache-control': 'no-cache', - referer: 'https://www.bloomberg.com', -}; const pageTypeRegex1 = /\/(?<page>[\w-]*?)\/(?<link>\d{4}-\d{2}-\d{2}\/.*)/; const pageTypeRegex2 = /(?<!news|politics)\/(?<page>features\/|graphics\/)(?<link>.*)/; @@ -84,7 +79,7 @@ const parseArticle = (item, ctx) => if (group) { const { page, link } = group; if (apiEndpoints[page]) { - const api = apiEndpoints[page]; + const api = { ...apiEndpoints[page] }; let res; try { @@ -95,6 +90,7 @@ const parseArticle = (item, ctx) => if (err.name && (err.name === 'HTTPError' || err.name === 'RequestError')) { try { res = await got(item.link, { headers }); + api.useOrigLink = true; } catch (err) { // return the default one return { @@ -106,7 +102,7 @@ const parseArticle = (item, ctx) => } } - // Blocked by PX3, or 404 by api, return the default + // Blocked by PX3, or 404 by both api and direct link, return the default const redirectUrls = res.redirectUrls.map(String); if (redirectUrls.some((r) => new URL(r).pathname === '/tosv2.html') || res.statusCode === 404) { return { @@ -257,11 +253,15 @@ const parseFeaturePage = async (res, api, item) => { }; const parseOtherPage = async function (res, api, item) { + if (api.useOrigLink) { + return parseNewsletterPage(res, apiEndpoints.newsletters, item); + } const article_json = JSON.parse( cheerio .load(res.data.html ?? res.data)(api.sel) .html() ); + const story_json = article_json.story; const body_html = story_json.body; const media_img = story_json.ledeImageUrl || Object.values(story_json.imageAttachments ?? {})[0]?.baseUrl; @@ -332,33 +332,6 @@ const processLedeMedia = async (story_json) => { } }; -const processVideo = async (bmmrId, summary) => { - const api = `https://www.bloomberg.com/multimedia/api/embed?id=${bmmrId}`; - const res = await got(api, { headers }); - - // Blocked by PX3, return the default - const redirectUrls = res.redirectUrls.map(String); - if (redirectUrls.some((r) => new URL(r).pathname === '/tosv2.html')) { - return { - stream: '', - mp4: '', - coverUrl: '', - caption: summary, - }; - } - - if (res.data) { - const video_json = res.data; - return { - stream: video_json.streams ? video_json.streams[0]?.url : '', - mp4: video_json.downloadURLs ? video_json.downloadURLs['600'] : '', - coverUrl: video_json.thumbnail?.baseUrl ?? '', - caption: video_json.description || video_json.title || summary, - }; - } - return {}; -}; - const processBody = async (body_html, story_json) => { const removeSel = ['meta', 'script', '*[class$="-footnotes"]', '*[class$="for-you"]', '*[class$="-newsletter"]', '*[class$="page-ad"]', '*[class$="-recirc"]', '*[data-ad-placeholder="Advertisement"]']; @@ -436,5 +409,4 @@ module.exports = { asyncPoolAll, parseNewsList, parseArticle, - processVideo, };
beeb063dbba3d553d7497b266fe1d4c915024d91
2023-07-19 17:57:29
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/docs/en/traditional-media.md b/docs/en/traditional-media.md index f5c01348c936c5..463e8969693e26 100644 --- a/docs/en/traditional-media.md +++ b/docs/en/traditional-media.md @@ -355,6 +355,18 @@ Only `s00017` is in English. </RouteEn> +## NPR + +### News + +<RouteEn author="bennyyip" example="/npr/1001" path="/npr/:endpoint?" :paramsDesc="['Channel ID, can be found in Official RSS URL, `1001` by default']"> + +Provide full article RSS for CBC topics. + +</RouteEn> + + + ## Radio France ### Géopolitique @@ -784,15 +796,3 @@ Free articles only. | 皇室 | koushitsu | </RouteEn> - -## NPR - -### News - -<RouteEn author="bennyyip" example="/npr/1001" path="/npr/:endpoint?" :paramsDesc="['Channel ID, can be found in Official RSS URL, `1001` by default']"> - -Provide full article RSS for CBC topics. - -</RouteEn> - - diff --git a/docs/traditional-media.md b/docs/traditional-media.md index c3f361d4c4084b..5bf6aa6ba85330 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -312,6 +312,16 @@ pageClass: routes <Route author="nczitzk" example="/now/news/rank" path="/now/news/rank"/> +## NPR + +### 新闻 + +<Route author="bennyyip" example="/npr/1001" path="/npr/:endpoint?" :paramsDesc="['频道 ID,可在官方频道 RSS URL 中找到,默认为 `1001`']"> + +通过提取文章全文,以提供比官方源更佳的阅读体验。 + +</Route> + ## RTHK 傳媒透視 <Route author="tpnonthealps" example="/mediadigest/latest" path="/mediadigest/:range" :paramsDesc="['时间范围']"> @@ -2715,13 +2725,3 @@ category 对应的关键词有 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | </Route> - -## NPR - -### 新闻 - -<Route author="bennyyip" example="/npr/1001" path="/npr/:endpoint?" :paramsDesc="['频道 ID,可在官方频道 RSS URL 中找到,默认为 `1001`']"> - -通过提取文章全文,以提供比官方源更佳的阅读体验。 - -</Route>
c3e09482979d88e44f930e3f95c04fb927df5a1c
2021-11-27 12:50:47
zytomorrow
feat(route): add 德阳考试中心 (#7901)
false
add 德阳考试中心 (#7901)
feat
diff --git a/docs/government.md b/docs/government.md index 9f4d44ab221e42..698b631b9c5884 100644 --- a/docs/government.md +++ b/docs/government.md @@ -713,3 +713,15 @@ pageClass: routes ### 审查调查 <Route author="LogicJake" example="/ccdi/scdc" path="/ccdi/scdc"/> + +## 德阳考试中心 + +### 考试新闻 + +<Route author="zytomorrow" example="/dykszx/news" path="/dykszx/news/:type?" :paramsDesc="['考试类型。']"> + +| 新闻中心 | 公务员考试 | 事业单位 | (职)业资格、职称考试 | 其他 | +| :------: | :------: | :------: |:------: |:------: | +| all | gwy | sydw | zyzc | other | + +</Route> diff --git a/lib/router.js b/lib/router.js index ed878e94ca097e..deba3abdcf4696 100644 --- a/lib/router.js +++ b/lib/router.js @@ -4224,4 +4224,7 @@ router.get('/odaily/activity', require('./routes/odaily/activity')); // Fashion Network router.get('/fashionnetwork/news/:sectors?/:categories?/:language?', require('./routes/fashionnetwork/news.js')); +// dykszx +router.get('/dykszx/news/:type?', require('./routes/dykszx/news')); + module.exports = router; diff --git a/lib/routes/dykszx/news.js b/lib/routes/dykszx/news.js new file mode 100644 index 00000000000000..604a24050fa537 --- /dev/null +++ b/lib/routes/dykszx/news.js @@ -0,0 +1,57 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); +const host = 'https://www.dykszx.com'; + +const getContent = (href, caches) => { + const newsPage = `${host}${href}`; + return caches.tryGet(newsPage, async () => { + const response = await got.get(newsPage); + const data = response.data; + const $ = cheerio.load(data); + const newsTime = $('body > div:nth-child(3) > div.page.w > div.shuxing.w') + .text() + .trim() + .match(/时间:(.*?)点击/g)[0]; + // 移除二维码 + $('.sjlook').remove(); + const content = $('#show-body').html(); + return { newsTime, content, newsPage }; + }); +}; + +const newsTypeObj = { + all: { selector: '#nrs > li > b', name: '新闻中心' }, + gwy: { selector: 'body > div:nth-child(3) > div:nth-child(8) > ul > li', name: '公务员考试' }, + sydw: { selector: 'body > div:nth-child(3) > div:nth-child(9) > ul > li', name: '事业单位考试' }, + zyzc: { selector: 'body > div:nth-child(3) > div:nth-child(10) > ul > li', name: '执(职)业资格、职称考试' }, + other: { selector: 'body > div:nth-child(3) > div:nth-child(11) > ul > li', name: '其他考试' }, +}; + +module.exports = async (ctx) => { + const newsType = ctx.params.type || 'all'; + const response = await got.get(host); + const data = response.data; + const $ = cheerio.load(data); + const newsList = $(newsTypeObj[newsType].selector).toArray(); + + const newsDetail = await Promise.all( + newsList.map(async (item) => { + const href = item.children[0].attribs.href; + const newsContent = await getContent(href, ctx.cache); + return { + title: item.children[0].children[0].data, + description: newsContent.content, + link: newsContent.newsPage, + pubDate: timezone(parseDate(newsContent.newsTime, '时间:YYYY-MM-DD HH:mm:ss'), +8), + }; + }) + ); + ctx.state.data = { + title: `德阳人事考试网 - ${newsTypeObj[newsType].name}`, + link: host, + description: '德阳人事考试网 考试新闻发布', + item: newsDetail, + }; +};
9dccb13af4890ec9d2a8604f8c2750208acf39a2
2024-10-16 16:31:27
Nano
fix(route/damai): allow to return empty results (#17162)
false
allow to return empty results (#17162)
fix
diff --git a/lib/routes/damai/activity.ts b/lib/routes/damai/activity.ts index ff26f7b209c683..bcf0962bcf926f 100644 --- a/lib/routes/damai/activity.ts +++ b/lib/routes/damai/activity.ts @@ -15,13 +15,13 @@ export const route: Route = { features: { requireConfig: false, requirePuppeteer: false, - antiCrawler: false, + antiCrawler: true, supportBT: false, supportPodcast: false, supportScihub: false, }, name: '票务更新', - maintainers: ['hoilc'], + maintainers: ['hoilc', 'Konano'], handler, description: `城市、分类名、子分类名,请参见[大麦网搜索页面](https://search.damai.cn/search.htm)`, }; @@ -55,6 +55,7 @@ async function handler(ctx) { return { title: `大麦网票务 - ${city || '全国'} - ${category || '全部分类'}${subcategory ? ' - ' + subcategory : ''}${keyword ? ' - ' + keyword : ''}`, link: 'https://search.damai.cn/search.htm', + allowEmpty: true, item: list.map((item) => ({ title: item.nameNoHtml, author: item.actors ? load(item.actors, null, false).text() : '大麦网',
a2a3e1b58b3804644c3fe8cc35780a15aff6ad89
2024-03-02 00:57:44
DIYgod
feat: remove unclean require in router.js
false
remove unclean require in router.js
feat
diff --git a/lib/routes/ciweimao/router.js b/lib/routes/ciweimao/router.js index bf5f0b92e5d9ed..817fef3dde6546 100644 --- a/lib/routes/ciweimao/router.js +++ b/lib/routes/ciweimao/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/chapter/:id', require('./chapter')); + router.get('/chapter/:id', './chapter'); }; diff --git a/lib/routes/hbooker/router.js b/lib/routes/hbooker/router.js index bf5f0b92e5d9ed..817fef3dde6546 100644 --- a/lib/routes/hbooker/router.js +++ b/lib/routes/hbooker/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/chapter/:id', require('./chapter')); + router.get('/chapter/:id', './chapter'); }; diff --git a/lib/routes/sfacg/router.js b/lib/routes/sfacg/router.js index 151935db563465..72374499e482ae 100644 --- a/lib/routes/sfacg/router.js +++ b/lib/routes/sfacg/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/novel/chapter/:id', require('./novel-chapter')); + router.get('/novel/chapter/:id', './novel-chapter'); }; diff --git a/lib/routes/tvtropes/router.js b/lib/routes/tvtropes/router.js index 85f49f95fa91ce..676e3be2634e25 100644 --- a/lib/routes/tvtropes/router.js +++ b/lib/routes/tvtropes/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/featured/:category?', require('./featured')); + router.get('/featured/:category?', './featured'); }; diff --git a/lib/routes/wmpvp/router.js b/lib/routes/wmpvp/router.js index ed30ab29899c57..4f35ef401d901a 100644 --- a/lib/routes/wmpvp/router.js +++ b/lib/routes/wmpvp/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/news/:type', require('.')); + router.get('/news/:type', './index'); }; diff --git a/lib/routes/zrblog/router.js b/lib/routes/zrblog/router.js index 692ecaf4aabb91..09c585b57315bb 100644 --- a/lib/routes/zrblog/router.js +++ b/lib/routes/zrblog/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/', require('./rss')); + router.get('/', './rss'); };
569c630ca62adc4ee4b0966408057833fa5c2fbd
2023-03-07 18:19:13
Jack Bryant
feat(route): 支持 xsijishe.com 论坛 rss (#12043)
false
支持 xsijishe.com 论坛 rss (#12043)
feat
diff --git a/docs/bbs.md b/docs/bbs.md index 3f5323b016654c..c212696a121a0a 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -869,6 +869,20 @@ pageClass: routes <Route author="nczitzk" example="/newsmth/account/fef705ec94819a5a87941759e33c0982" path="/newsmth/account/:id" :paramsDesc="['用户 id,可在用户页的 URL 中找到']"/> +## 司机社 + +### 论坛 + +<Route author="akynazh" example="/xsijishe/forum/51" path="/xsijishe/forum/:fid" :paramDesc="['子论坛 id']" radar="1"> + +::: tip 关于子论坛 id 的获取方法 + +`/xsijishe/forum/51` 对应于论坛 <https://xsijishe.com/forum-51-1.html>,这个论坛的 fid 为 51,也就是 `forum-{fid}-1` 中的 fid。 + +::: + +</Route> + ## 天涯论坛 ### 子版块 diff --git a/lib/v2/xsijishe/forum.js b/lib/v2/xsijishe/forum.js new file mode 100644 index 00000000000000..91f7b839f9a8f3 --- /dev/null +++ b/lib/v2/xsijishe/forum.js @@ -0,0 +1,61 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const baseUrl = 'https://xsijishe.com'; + +module.exports = async (ctx) => { + const fid = ctx.params.fid; + const url = `${baseUrl}/forum-${fid}-1.html`; + const resp = await got(url); + const $ = cheerio.load(resp.data); + const forumCategory = $('.nex_bkinterls_top .nex_bkinterls_ls a').text(); + let items = $('[id^="normalthread"]') + .toArray() + .map((item) => { + item = $(item); + const nexAuthorBtms = item.find('.nex_author_btms'); + const nexForumtitTopA = item.find('.nex_forumtit_top a').first(); + const nexFtdate = nexAuthorBtms.find('.nex_ftdate'); + let pubDate; + if (nexFtdate.find('span').length > 0) { + pubDate = nexFtdate.find('span').attr('title'); + } else { + pubDate = nexFtdate.text().replace('发表于', ''); + } + return { + title: nexForumtitTopA.text().trim(), + pubDate: parseDate(pubDate.trim()), + category: nexAuthorBtms.find('em a').text().trim(), + link: baseUrl + '/' + nexForumtitTopA.attr('href'), + author: item.find('.nex_threads_author').find('a').text().trim(), + }; + }); + items = await Promise.all( + items.map((item) => + ctx.cache.tryGet(item.link, async () => { + const resp = await got(item.link); + const $ = cheerio.load(resp.data); + const firstViewBox = $('.t_f').first(); + + firstViewBox.find('img').each((_, img) => { + img = $(img); + if (img.attr('zoomfile')) { + img.attr('src', img.attr('zoomfile')); + img.removeAttr('zoomfile'); + img.removeAttr('file'); + } + img.removeAttr('onmouseover'); + }); + + item.description = firstViewBox.html(); + return item; + }) + ) + ); + ctx.state.data = { + title: `司机社${forumCategory}论坛`, + link: url, + description: `司机社${forumCategory}论坛`, + item: items, + }; +}; diff --git a/lib/v2/xsijishe/maintainer.js b/lib/v2/xsijishe/maintainer.js new file mode 100644 index 00000000000000..e136abf725334b --- /dev/null +++ b/lib/v2/xsijishe/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/forum/:fid': ['akynazh'], +}; diff --git a/lib/v2/xsijishe/radar.js b/lib/v2/xsijishe/radar.js new file mode 100644 index 00000000000000..e0423fa3444af8 --- /dev/null +++ b/lib/v2/xsijishe/radar.js @@ -0,0 +1,19 @@ +module.exports = { + 'xsijishe.com': { + _name: '司机社', + '.': [ + { + title: '论坛', + docs: 'https://docs.rsshub.app/bbs.html#si-ji-she', + source: ['/*'], + target: (_, url) => { + const re = /forum-(\d+)-/; + const res = re.exec(url); + if (res) { + return `/xsijishe/forum/${res[1]}`; + } + }, + }, + ], + }, +}; diff --git a/lib/v2/xsijishe/router.js b/lib/v2/xsijishe/router.js new file mode 100644 index 00000000000000..87b792c189aec7 --- /dev/null +++ b/lib/v2/xsijishe/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/forum/:fid', require('./forum')); +};
88486f71d992bfa5c1147136eee40e54065c04fa
2024-07-01 17:43:52
dependabot[bot]
chore(deps): bump hono from 4.4.9 to 4.4.10 (#16052)
false
bump hono from 4.4.9 to 4.4.10 (#16052)
chore
diff --git a/package.json b/package.json index 3c1ed482473cdc..e16d382ba2873c 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "fanfou-sdk": "5.0.0", "form-data": "4.0.0", "googleapis": "140.0.1", - "hono": "4.4.9", + "hono": "4.4.10", "html-to-text": "9.0.5", "http-cookie-agent": "6.0.5", "https-proxy-agent": "7.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ec7cbb41042d9..e7b2f258f876e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: version: 1.11.4 '@hono/zod-openapi': specifier: 0.14.5 - version: 0.14.5([email protected])([email protected]) + version: 0.14.5([email protected])([email protected]) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -84,8 +84,8 @@ importers: specifier: 140.0.1 version: 140.0.1 hono: - specifier: 4.4.9 - version: 4.4.9 + specifier: 4.4.10 + version: 4.4.10 html-to-text: specifier: 9.0.5 version: 9.0.5 @@ -3655,8 +3655,8 @@ packages: [email protected]: resolution: {integrity: sha512-4FP6J0oI8jqb6gLLl9tSwVdosWJ/AKSGJ+HwYf6Ixe4MUcEkst4uWzpVQrNOCin0fzTRQbXV8ePheU8WiiDYBw==} - [email protected]: - resolution: {integrity: sha512-VW1hnYipHL/XsnSYiCTLJ+Z7iisZYWwSOiKXm9RBV2NKPxNqjfaHqeMFiDl11fK893ofmErvRpX20+FTNjZIjA==} + [email protected]: + resolution: {integrity: sha512-z6918u9rXRU5CCisMHd2uUVoQXcNyUrUMmYY7VH10v4HJG7+hqgMK/G8YNTd13C6s4rBfzF09iz8VpOip9qG3A==} engines: {node: '>=16.0.0'} [email protected]: @@ -7415,16 +7415,16 @@ snapshots: '@hono/[email protected]': {} - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: '@asteasolutions/zod-to-openapi': 7.1.1([email protected]) - '@hono/zod-validator': 0.2.2([email protected])([email protected]) - hono: 4.4.9 + '@hono/zod-validator': 0.2.2([email protected])([email protected]) + hono: 4.4.10 zod: 3.23.8 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: - hono: 4.4.9 + hono: 4.4.10 zod: 3.23.8 '@humanwhocodes/[email protected]': @@ -7845,7 +7845,7 @@ snapshots: '@scalar/[email protected]([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: '@scalar/api-reference': 1.24.27([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) - hono: 4.4.9 + hono: 4.4.10 transitivePeerDependencies: - '@jest/globals' - '@types/bun' @@ -10394,7 +10394,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: {}
e4bd492aafa7df6bcfb07ba6f6d6e4a49fd4412b
2023-09-27 21:59:28
Tony
fix(route): xiaohongshu (#13425)
false
xiaohongshu (#13425)
fix
diff --git a/lib/v2/xiaohongshu/user.js b/lib/v2/xiaohongshu/user.js index c8a6ef1d81ba64..54603f81f03315 100644 --- a/lib/v2/xiaohongshu/user.js +++ b/lib/v2/xiaohongshu/user.js @@ -5,26 +5,50 @@ module.exports = async (ctx) => { const category = ctx.params.category; const url = `https://www.xiaohongshu.com/user/profile/${userId}`; - const content = await getUser(url, ctx.cache); + const { + userPageData: { basicInfo, interactions, tags }, + notes, + collect, + } = await getUser(url, ctx.cache); - const { otherInfo, user_posted, collect } = content; - const title = `${otherInfo.data.basic_info.nickname} - ${category === 'notes' ? '笔记' : '收藏'} • 小红书 / RED`; - const description = otherInfo.data.basic_info.desc; - const image = otherInfo.data.basic_info.imageb || otherInfo.data.basic_info.images; + const title = `${basicInfo.nickname} - ${category === 'notes' ? '笔记' : '收藏'} • 小红书 / RED`; + const description = `${basicInfo.desc} ${tags.map((t) => t.name).join(' ')} ${interactions.map((i) => `${i.count} ${i.name}`).join(' ')}`; + const image = basicInfo.imageb || basicInfo.images; - const items = (category, user_posted, collect) => - (category === 'notes' ? user_posted : collect).data.notes.map((item) => ({ + const renderNote = (notes) => + notes.flatMap((n) => + n.map(({ noteCard }) => ({ + title: noteCard.displayTitle, + link: `${url}/${noteCard.noteId}`, + description: `<img src ="${noteCard.cover.infoList.pop().url}"><br>${noteCard.displayTitle}`, + author: noteCard.user.nickname, + upvotes: noteCard.interactInfo.likedCount, + })) + ); + const renderCollect = (collect) => { + if (!collect) { + throw Error('该用户已设置收藏内容不可见'); + } + if (collect.code !== 0) { + throw Error(JSON.stringify(collect)); + } + if (!collect.data.notes.length) { + throw ctx.throw(403, '该用户已设置收藏内容不可见'); + } + return collect.data.notes.map((item) => ({ title: item.display_title, link: `${url}/${item.note_id}`, - description: `<img src ="${item.cover.url}"><br>${item.display_title}`, + description: `<img src ="${item.cover.info_list.pop().url}"><br>${item.display_title}`, author: item.user.nickname, + upvotes: item.interact_info.likedCount, })); + }; ctx.state.data = { title, description, image, link: url, - item: items(category, user_posted, collect), + item: category === 'notes' ? renderNote(notes) : renderCollect(collect), }; }; diff --git a/lib/v2/xiaohongshu/util.js b/lib/v2/xiaohongshu/util.js index c4d9ef7c1ae844..2ac4bdf7692f85 100644 --- a/lib/v2/xiaohongshu/util.js +++ b/lib/v2/xiaohongshu/util.js @@ -10,33 +10,29 @@ const getUser = (url, cache) => try { const page = await browser.newPage(); await page.setRequestInterception(true); - let otherInfo = ''; - let user_posted = ''; let collect = ''; page.on('request', (request) => { request.resourceType() === 'document' || request.resourceType() === 'script' || request.resourceType() === 'xhr' || request.resourceType() === 'other' ? request.continue() : request.abort(); }); - page.on('response', async (response) => { - const request = response.request(); - if (request.url().includes('/api/sns/web/v1/user/otherinfo')) { - otherInfo = await response.json(); - } - if (request.url().includes('/api/sns/web/v1/user_posted')) { - user_posted = await response.json(); - } - if (request.url().includes('/api/sns/web/v2/note/collect/page')) { - collect = await response.json(); - } - }); logger.debug(`Requesting ${url}`); - await page.goto(url); - await page.waitForSelector('.feeds-container:nth-child(1) .note-item'); + await page.goto(url, { + waitUntil: 'domcontentloaded', + }); + await page.waitForSelector('div.reds-tab-item:nth-child(2)'); await page.click('div.reds-tab-item:nth-child(2)'); - const privateCollection = await page.evaluate(() => document.querySelector('div.reds-tab-item:nth-child(2) .reds-icon')); - if (!privateCollection) { - await page.waitForSelector('.feeds-container:nth-child(2) .note-item'); - } - return { otherInfo, user_posted, collect }; + const response = await page.waitForResponse((res) => { + const req = res.request(); + return req.url().includes('/api/sns/web/v2/note/collect/page') && req.method() === 'GET' && req.resourceType() === 'xhr'; + }); + collect = await response.json(); + + const initialState = await page.evaluate(() => window.__INITIAL_STATE__); + + let { userPageData, notes } = initialState.user; + userPageData = userPageData._rawValue || userPageData; + notes = notes._rawValue || notes; + + return { userPageData, notes, collect }; } finally { browser.close(); }
329b3fc240501191cb6442de629b1e6eee253fe3
2020-06-23 02:15:36
dependabot-preview[bot]
chore(deps): bump koa from 2.12.1 to 2.13.0
false
bump koa from 2.12.1 to 2.13.0
chore
diff --git a/package.json b/package.json index 4c6f8fb2da3b21..058cd30f1b4009 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "jsdom": "16.2.2", "json-bigint": "0.3.1", "json5": "2.1.3", - "koa": "2.12.1", + "koa": "2.13.0", "koa-basic-auth": "4.0.0", "koa-favicon": "2.1.0", "koa-mount": "4.0.0", diff --git a/yarn.lock b/yarn.lock index a08b419056e010..469b4f345b7434 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7571,10 +7571,10 @@ [email protected]: debug "^4.0.1" koa-compose "^4.1.0" [email protected]: - version "2.12.1" - resolved "https://registry.yarnpkg.com/koa/-/koa-2.12.1.tgz#a0ab4dcfebe3cc1b6f0875cbfd686edd7e926643" - integrity sha512-NuYVKjnBxeEe19VljPO9yNcaKKVrMagcax3jjzZtOlxRY2nThWKQqgnI3Pr1OG7mFtvySoDRixoUWZIt6R9C3A== [email protected]: + version "2.13.0" + resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501" + integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ== dependencies: accepts "^1.3.5" cache-content-type "^1.0.0"
a87ecdfed2ac4ff4b1f38a6166ecedc3600e6b78
2021-05-13 00:58:18
Ethan Shen
feat(route): add 弯弯字幕组 (#7408)
false
add 弯弯字幕组 (#7408)
feat
diff --git a/docs/multimedia.md b/docs/multimedia.md index fcf94a9e0cdf8f..c96f20bdd38a7f 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -979,6 +979,22 @@ pageClass: routes <Route author="Andiedie" example="/tencentvideo/playlist/jx7g4sm320sqm7i" path="/tencentvideo/playlist/:id" :paramsDesc="['播放列表 ID,可以在 URL 中找到']" radar="1" /> +## 弯弯字幕组 + +### 分类 + +<Route author="nczitzk" example="/wanwansub/139" path="/wanwansub/:id?" :paramsDesc="['分类 id,见下表,默认为 ALL']" > + +| ALL | 英语小分队 | 日语小分队 | 韩语小分队 | 葡语小分队 | 西语小分队 | 法语小分队 | 意语小分队 | 德语小分队 | 泰语小分队 | 其他语种 | +| --- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | -------- | +| 139 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 153 | 117 | 154 | + +</Route> + +### 剧集 + +<Route author="nczitzk" example="/wanwansub/info/393" path="/wanwansub/info/:id" :paramsDesc="['剧集 id,可在剧集页 URL 中找到']" /> + ## 网易云音乐 ### 歌单歌曲 diff --git a/lib/router.js b/lib/router.js index d57eb8b756c35c..8e7256c301c98f 100644 --- a/lib/router.js +++ b/lib/router.js @@ -4067,6 +4067,10 @@ router.get('/jisilu/topic/:user', require('./routes/jisilu/topic')); // Constitutional Court of Baden-Württemberg (Germany) router.get('/verfghbw/press/:keyword?', require('./routes/verfghbw/press')); +// 弯弯字幕组 +router.get('/wanwansub/info/:id', require('./routes/wanwansub/info')); +router.get('/wanwansub/:id?', require('./routes/wanwansub/index')); + // FIX 字幕侠 router.get('/zimuxia/portfolio/:id', require('./routes/zimuxia/portfolio')); router.get('/zimuxia/:category?', require('./routes/zimuxia/index')); diff --git a/lib/routes/wanwansub/index.js b/lib/routes/wanwansub/index.js new file mode 100644 index 00000000000000..8d4d87eadc0c32 --- /dev/null +++ b/lib/routes/wanwansub/index.js @@ -0,0 +1,58 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id || '139'; + + const rootUrl = 'http://wanwansub.com'; + const currentUrl = `${rootUrl}/node/${id}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('.pg-item a') + .slice(0, 10) + .map((_, item) => { + item = $(item); + return { + title: item.text(), + link: `${rootUrl}${item.attr('href')}`, + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + content('.button').remove(); + + const links = detailResponse.data.match(/<a href="magnet:(.*?)" target="_self">磁力<\/a>/g); + + if (links) { + item.enclosure_type = 'application/x-bittorrent'; + item.enclosure_url = links.pop().match(/<a href="(.*)" target="_self">磁力<\/a>/)[1]; + } + + item.description = content('.content-box').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/wanwansub/info.js b/lib/routes/wanwansub/info.js new file mode 100644 index 00000000000000..7cd978654bca9d --- /dev/null +++ b/lib/routes/wanwansub/info.js @@ -0,0 +1,44 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id; + + const rootUrl = 'http://wanwansub.com'; + const currentUrl = `${rootUrl}/info/${id}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const items = $('.lightbox-image') + .nextAll('p') + .slice(3) + .map((_, item) => { + const i = {}; + + item = $(item); + + item.find('a').each(function () { + if ($(this).text() === '磁力') { + i.enclosure_url = $(this).attr('href'); + i.enclosure_type = 'application/x-bittorrent'; + } + }); + + i.description = `<p>${item.html()}</p>`; + i.title = item.text().split(' ')[0]; + i.link = currentUrl; + + return i; + }) + .get(); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +};
3b272fb9e980eae971f05fb9e1a9f39436a57ba7
2024-04-23 04:10:52
dependabot[bot]
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 7.7.0 to 7.7.1 (#15333)
false
bump @typescript-eslint/eslint-plugin from 7.7.0 to 7.7.1 (#15333)
chore
diff --git a/package.json b/package.json index ceb249975e900d..789aaed804e3e3 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,7 @@ "@types/title": "3.4.3", "@types/tough-cookie": "4.0.5", "@types/uuid": "9.0.8", - "@typescript-eslint/eslint-plugin": "7.7.0", + "@typescript-eslint/eslint-plugin": "7.7.1", "@typescript-eslint/parser": "7.7.1", "@vercel/nft": "0.26.4", "@vitest/coverage-v8": "1.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 627fa14d136ba3..8d0ace5b416a5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -314,8 +314,8 @@ devDependencies: specifier: 9.0.8 version: 9.0.8 '@typescript-eslint/eslint-plugin': - specifier: 7.7.0 - version: 7.7.0(@typescript-eslint/[email protected])([email protected])([email protected]) + specifier: 7.7.1 + version: 7.7.1(@typescript-eslint/[email protected])([email protected])([email protected]) '@typescript-eslint/parser': specifier: 7.7.1 version: 7.7.1([email protected])([email protected]) @@ -3073,8 +3073,8 @@ packages: dev: false optional: true - /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): - resolution: {integrity: sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ==} + /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): + resolution: {integrity: sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -3086,10 +3086,10 @@ packages: dependencies: '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 7.7.1([email protected])([email protected]) - '@typescript-eslint/scope-manager': 7.7.0 - '@typescript-eslint/type-utils': 7.7.0([email protected])([email protected]) - '@typescript-eslint/utils': 7.7.0([email protected])([email protected]) - '@typescript-eslint/visitor-keys': 7.7.0 + '@typescript-eslint/scope-manager': 7.7.1 + '@typescript-eslint/type-utils': 7.7.1([email protected])([email protected]) + '@typescript-eslint/utils': 7.7.1([email protected])([email protected]) + '@typescript-eslint/visitor-keys': 7.7.1 debug: 4.3.4 eslint: 8.57.0 graphemer: 1.4.0 @@ -3131,14 +3131,6 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true - /@typescript-eslint/[email protected]: - resolution: {integrity: sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.7.0 - '@typescript-eslint/visitor-keys': 7.7.0 - dev: true - /@typescript-eslint/[email protected]: resolution: {integrity: sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -3147,8 +3139,8 @@ packages: '@typescript-eslint/visitor-keys': 7.7.1 dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: {integrity: sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg==} + /@typescript-eslint/[email protected]([email protected])([email protected]): + resolution: {integrity: sha512-ZksJLW3WF7o75zaBPScdW1Gbkwhd/lyeXGf1kQCxJaOeITscoSl0MjynVvCzuV5boUz/3fOI06Lz8La55mu29Q==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -3157,8 +3149,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.7.0([email protected]) - '@typescript-eslint/utils': 7.7.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 7.7.1([email protected]) + '@typescript-eslint/utils': 7.7.1([email protected])([email protected]) debug: 4.3.4 eslint: 8.57.0 ts-api-utils: 1.3.0([email protected]) @@ -3172,11 +3164,6 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/[email protected]: - resolution: {integrity: sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: true - /@typescript-eslint/[email protected]: resolution: {integrity: sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==} engines: {node: ^18.18.0 || >=20.0.0} @@ -3204,28 +3191,6 @@ packages: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected]): - resolution: {integrity: sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.7.0 - '@typescript-eslint/visitor-keys': 7.7.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -3267,8 +3232,8 @@ packages: - typescript dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: {integrity: sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig==} + /@typescript-eslint/[email protected]([email protected])([email protected]): + resolution: {integrity: sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -3276,9 +3241,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.7.0 - '@typescript-eslint/types': 7.7.0 - '@typescript-eslint/typescript-estree': 7.7.0([email protected]) + '@typescript-eslint/scope-manager': 7.7.1 + '@typescript-eslint/types': 7.7.1 + '@typescript-eslint/typescript-estree': 7.7.1([email protected]) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -3294,14 +3259,6 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/[email protected]: - resolution: {integrity: sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.7.0 - eslint-visitor-keys: 3.4.3 - dev: true - /@typescript-eslint/[email protected]: resolution: {integrity: sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==} engines: {node: ^18.18.0 || >=20.0.0}
7035c394ec52324a69a6bc4937f2bd16b775b1c1
2023-03-05 17:56:44
Evan
feat(route): Bellroy new releases (#12038)
false
Bellroy new releases (#12038)
feat
diff --git a/docs/en/shopping.md b/docs/en/shopping.md index ff10fa365c1c71..248a787ba66d2e 100644 --- a/docs/en/shopping.md +++ b/docs/en/shopping.md @@ -36,6 +36,12 @@ Parameter `time` only works when `mostwanted` is chosen as the category. </RouteEn> +## Bellroy + +### New Releases + +<RouteEn author="NavePnow" example="/bellroy/new-releases" path="/bellroy/new-releases" /> + ## booth.pm ### Shop @@ -129,22 +135,22 @@ Category Language -| Id | Language | -| -- | ---------- | -| | en | -| de | Deutsch | -| es | Español | -| fi | Suomeksi | -| fr | Français | -| it | Italiano | -| ja | 日本語 | -| nl | Nederlands | -| no | Norsk | -| pl | Polski | -| pt | Português | -| ru | Русский | -| sv | Svenska | -| zh | 中文 | +| Id | Language | +| --- | ---------- | +| | en | +| de | Deutsch | +| es | Español | +| fi | Suomeksi | +| fr | Français | +| it | Italiano | +| ja | 日本語 | +| nl | Nederlands | +| no | Norsk | +| pl | Polski | +| pt | Português | +| ru | Русский | +| sv | Svenska | +| zh | 中文 | </RouteEn> diff --git a/docs/shopping.md b/docs/shopping.md index 64f21d2fa7bba6..2cb24e10df75b6 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -48,6 +48,12 @@ pageClass: routes </Route> +## Bellroy + +### 新发布 + +<Route author="NavePnow" example="/bellroy/new-releases" path="/bellroy/new-releases" /> + ## booth.pm ### 店铺 diff --git a/lib/v2/bellroy/maintainer.js b/lib/v2/bellroy/maintainer.js new file mode 100644 index 00000000000000..844916e7c8b471 --- /dev/null +++ b/lib/v2/bellroy/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/new-releases': ['NavePnow'], +}; diff --git a/lib/v2/bellroy/new-releases.js b/lib/v2/bellroy/new-releases.js new file mode 100644 index 00000000000000..1a459e8bd8ebf3 --- /dev/null +++ b/lib/v2/bellroy/new-releases.js @@ -0,0 +1,26 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const host = 'https://bellroy.com'; + const url = 'https://production.products.boobook-services.com/products'; + const response = await got({ + method: 'get', + url, + searchParams: { + currency_identifier: '1abe985632a1392e6a94b885fe193d5943b7c213', + price_group: 'bellroy.com', + 'filter[dimensions][web_new_release]': 'new_style', + }, + }); + const data = response.data.products; + + ctx.state.data = { + title: 'Bellroy - New Releases', + link: 'https://bellroy.com/collection/new-releases', + description: 'Bellroy - New Releases', + item: data.map((item) => ({ + title: item.attributes.name + ' - ' + item.attributes.dimensions.color, + link: host + item.attributes.canonical_uri, + })), + }; +}; diff --git a/lib/v2/bellroy/radar.js b/lib/v2/bellroy/radar.js new file mode 100644 index 00000000000000..21881388874cd4 --- /dev/null +++ b/lib/v2/bellroy/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'bellroy.com': { + _name: 'Bellroy', + '.': [ + { + title: '新发布', + docs: 'https://docs.rsshub.app/shopping.html#bellroy', + source: ['/collection/new-releases', '/'], + target: '/bellroy/new-releases', + }, + ], + }, +}; diff --git a/lib/v2/bellroy/router.js b/lib/v2/bellroy/router.js new file mode 100644 index 00000000000000..82ed7d7bb66084 --- /dev/null +++ b/lib/v2/bellroy/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/new-releases', require('./new-releases')); +};
2f72a46af83445f5a992a11365c403f3005cf020
2021-02-14 00:18:00
Ethan Shen
feat: add 美国劳工联合会-产业工会联合会博客 (#6906)
false
add 美国劳工联合会-产业工会联合会博客 (#6906)
feat
diff --git a/docs/en/new-media.md b/docs/en/new-media.md index f06929a6050df3..79f5347040b140 100644 --- a/docs/en/new-media.md +++ b/docs/en/new-media.md @@ -41,6 +41,12 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more <RouteEn author="nczitzk" example="/asml/press-releases" path="/asml/press-releases"/> +## American Federation of Labor and Congress of Industrial Organizations + +### Blog + +<RouteEn author="nczitzk" example="/aflcio/blog" path="/aflcio/blog"/> + ## Bell Labs ### Event and News diff --git a/docs/new-media.md b/docs/new-media.md index 4edde1593908e5..43952076cd82a1 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1522,6 +1522,12 @@ column 为 third 时可选的 category: </Route> +## 美国劳工联合会 - 产业工会联合会 + +### 博客 + +<Route author="nczitzk" example="/aflcio/blog" path="/aflcio/blog"/> + ## 梅花网 ### 作品 diff --git a/lib/router.js b/lib/router.js index dbf0677a40ca3e..62b2ee020057b2 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3927,4 +3927,7 @@ router.get('/kenshin/:category?/:type?', require('./routes/kenshin/index')); router.get('/av01/actor/:name/:type?', require('./routes/av01/actor')); router.get('/av01/tag/:name/:type?', require('./routes/av01/tag')); +// 美国劳工联合会-产业工会联合会 +router.get('/aflcio/blog', require('./routes/aflcio/blog')); + module.exports = router; diff --git a/lib/routes/aflcio/blog.js b/lib/routes/aflcio/blog.js new file mode 100644 index 00000000000000..68001e2148c589 --- /dev/null +++ b/lib/routes/aflcio/blog.js @@ -0,0 +1,49 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = 'https://aflcio.org'; + const currentUrl = `${rootUrl}/blog`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('article') + .map((_, item) => { + item = $(item); + const title = item.find('h1 a'); + return { + title: title.text(), + link: `${rootUrl}${title.attr('href')}`, + pubDate: new Date(item.find('time').attr('datetime')).toUTCString(), + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.description = content('.section-article-body').html(); + item.author = detailResponse.data.match(/entityName":"(.*)","entityType"/)[1]; + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +};
0d69ffde651144b788c264022464b634501d64b9
2023-09-06 18:40:57
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/lib/v2/udn/breaking-news.js b/lib/v2/udn/breaking-news.js index 1e636a211699be..c894c311d5001e 100644 --- a/lib/v2/udn/breaking-news.js +++ b/lib/v2/udn/breaking-news.js @@ -30,7 +30,7 @@ module.exports = async (ctx) => { } const $ = cheerio.load(result.data); - const metadata = $('script[type="application/ld+json"]').eq(0).text().trim().replaceAll(/[\b]/g, ""); + const metadata = $('script[type="application/ld+json"]').eq(0).text().trim().replaceAll(/[\b]/g, ''); const data = metadata.startsWith('[') ? JSON.parse(metadata)[0] : JSON.parse(metadata); // e.g. https://udn.com/news/story/7331/6576320 const content = $('.article-content__editor');
8a3e8d86d40142c65bedf4093bd44eb218d3e279
2024-06-24 18:31:07
dependabot[bot]
chore(deps): bump @tonyrl/rand-user-agent from 2.0.68 to 2.0.69 (#15977)
false
bump @tonyrl/rand-user-agent from 2.0.68 to 2.0.69 (#15977)
chore
diff --git a/package.json b/package.json index 0ea6fd6d53f1c6..9cf020022c5635 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@postlight/parser": "2.2.3", "@scalar/hono-api-reference": "0.5.76", "@sentry/node": "7.116.0", - "@tonyrl/rand-user-agent": "2.0.68", + "@tonyrl/rand-user-agent": "2.0.69", "aes-js": "3.1.2", "art-template": "4.13.2", "bbcodejs": "0.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e6fcbadae8ea1..89fef53f43f4ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: specifier: 7.116.0 version: 7.116.0 '@tonyrl/rand-user-agent': - specifier: 2.0.68 - version: 2.0.68 + specifier: 2.0.69 + version: 2.0.69 aes-js: specifier: 3.1.2 version: 3.1.2 @@ -1066,8 +1066,8 @@ packages: '@codemirror/[email protected]': resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==} - '@codemirror/[email protected]': - resolution: {integrity: sha512-BUWr+zCJpMkA/u69HlJmR+YkV4yPpM81HeMkOMZuwFa8iM5uJdEPKAs1icIRZKkKmy0Ub1x9/G3PQLTXdpBxrQ==} + '@codemirror/[email protected]': + resolution: {integrity: sha512-A3DmyVfjgPsGIjiJqM/zvODUAPQdQl3ci0ghehYNnbt5x+o76xq+dL5+mMBuysDXnI3kapgOkoeJ0sbtL/3qPw==} '@colors/[email protected]': resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} @@ -1748,11 +1748,11 @@ packages: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} - '@tanstack/[email protected]': - resolution: {integrity: sha512-hQERxVckATdWMCk7uEyq0pLaLGtQTZzgmDrpHivJZra8p3Gw3ANH5SURitYiqrBD5JUHCjwp7h7BnWU7FNkv4w==} + '@tanstack/[email protected]': + resolution: {integrity: sha512-p0CWuqn+n8iZmsL7/l0Xg7kbyIKnHNqkEJkMDOkg4x3Ni3LohszmnJY8FPhTgG7Ad9ZFGcdKmn1R1mKUGEh9Xg==} - '@tanstack/[email protected]': - resolution: {integrity: sha512-AfKwREqqI+kRodDBv7nApcNBRNNT2EJYrzTTwiutkS0qDs+yqpuSjJmdMnnG1sSYSZ8MW5yl5q/WCmqWcfGpvw==} + '@tanstack/[email protected]': + resolution: {integrity: sha512-RkSrajvJpV1RdJKgZnPgzyzVVx76QjPAu+spgdAms+SZRcSbYMUKlcjusnHjhszck5ngHXSXbSBp45ycF1nlDw==} peerDependencies: vue: ^2.7.0 || ^3.0.0 @@ -1787,8 +1787,8 @@ packages: peerDependencies: '@testing-library/dom': '>=7.21.4' - '@tonyrl/[email protected]': - resolution: {integrity: sha512-Y3MD0nrEGzZoy67evy3XhYPabHDcNgB/OF/RE0IitvEGETeh8Xdbpk6kcnKc/Q+Y2UM+LkVFbT1lVls5jnQvFw==} + '@tonyrl/[email protected]': + resolution: {integrity: sha512-yw+SCKzSMLnpL7k4HsRFj8F6YbxMGlcV0o4rSY/ggQSTC6fhbbiupi+Jm9bGVJc0AvKHknRsC83nwduZfdgD+g==} engines: {node: '>=14.16'} '@tootallnate/[email protected]': @@ -2102,37 +2102,37 @@ packages: '@vitest/[email protected]': resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} - '@vue/[email protected]': - resolution: {integrity: sha512-TFKiRkKKsRCKvg/jTSSKK7mYLJEQdUiUfykbG49rubC9SfDyvT2JrzTReopWlz2MxqeLyxh9UZhvxEIBgAhtrg==} + '@vue/[email protected]': + resolution: {integrity: sha512-ZL8y4Xxdh8O6PSwfdZ1IpQ24PjTAieOz3jXb/MDTfDtANcKBMxg1KLm6OX2jofsaQGYfIVzd3BAG22i56/cF1w==} - '@vue/[email protected]': - resolution: {integrity: sha512-A6+iZ2fKIEGnfPJejdB7b1FlJzgiD+Y/sxxKwJWg1EbJu6ZPgzaPQQ51ESGNv0CP6jm6Z7/pO6Ia8Ze6IKrX7w==} + '@vue/[email protected]': + resolution: {integrity: sha512-+16Sd8lYr5j/owCbr9dowcNfrHd+pz+w2/b5Lt26Oz/kB90C9yNbxQ3bYOvt7rI2bxk0nqda39hVcwDFw85c2Q==} - '@vue/[email protected]': - resolution: {integrity: sha512-zygDcEtn8ZimDlrEQyLUovoWgKQic6aEQqRXce2WXBvSeHbEbcAsXyCk9oG33ZkyWH4sl9D3tkYc1idoOkdqZQ==} + '@vue/[email protected]': + resolution: {integrity: sha512-8vElKklHn/UY8+FgUFlQrYAPbtiSB2zcgeRKW7HkpSRn/JjMRmZvuOtwDx036D1aqKNSTtXkWRfqx53Qb+HmMg==} - '@vue/[email protected]': - resolution: {integrity: sha512-rFbwCmxJ16tDp3N8XCx5xSQzjhidYjXllvEcqX/lopkoznlNPz3jyy0WGJCyhAaVQK677WWFt3YO/WUEkMMUFQ==} + '@vue/[email protected]': + resolution: {integrity: sha512-ZJ56YZGXJDd6jky4mmM0rNaNP6kIbQu9LTKZDhcpddGe/3QIalB1WHHmZ6iZfFNyj5mSypTa4+qDJa5VIuxMSg==} '@vue/[email protected]': resolution: {integrity: sha512-0MiMsFma/HqA6g3KLKn+AGpL1kgKhFWszC9U29NfpWK5LE7bjeXxySWJrOJ77hBz+TBrBQ7o4QJqbPbqbs8rJw==} - '@vue/[email protected]': - resolution: {integrity: sha512-w8+KV+mb1a8ornnGQitnMdLfE0kXmteaxLdccm2XwdFxXst4q/Z7SEboCV5SqJNpZbKFeaRBBJBhW24aJyGINg==} + '@vue/[email protected]': + resolution: {integrity: sha512-bVJurnCe3LS0JII8PPoAA63Zd2MBzcKrEzwdQl92eHCcxtIbxD2fhNwJpa+KkM3Y/A4T5FUnmdhgKwOf6BfbcA==} - '@vue/[email protected]': - resolution: {integrity: sha512-s8fmX3YVR/Rk5ig0ic0NuzTNjK2M7iLuVSZyMmCzN/+Mjuqqif1JasCtEtmtoJWF32pAtUjyuT2ljNKNLeOmnQ==} + '@vue/[email protected]': + resolution: {integrity: sha512-qaFEbnNpGz+tlnkaualomogzN8vBLkgzK55uuWjYXbYn039eOBZrWxyXWq/7qh9Bz2FPifZqGjVDl/FXiq9L2g==} - '@vue/[email protected]': - resolution: {integrity: sha512-gI10atCrtOLf/2MPPMM+dpz3NGulo9ZZR9d1dWo4fYvm+xkfvRrw1ZmJ7mkWtiJVXSsdmPbcK1p5dZzOCKDN0g==} + '@vue/[email protected]': + resolution: {integrity: sha512-tV6B4YiZRj5QsaJgw2THCy5C1H+2UeywO9tqgWEc21tn85qHEERndHN/CxlyXvSBFrpmlexCIdnqPuR9RM9thw==} - '@vue/[email protected]': - resolution: {integrity: sha512-HMLCmPI2j/k8PVkSBysrA2RxcxC5DgBiCdj7n7H2QtR8bQQPqKAe8qoaxLcInzouBmzwJ+J0x20ygN/B5mYBng==} + '@vue/[email protected]': + resolution: {integrity: sha512-TBD3eqR1DeDc0cMrXS/vEs/PWzq1uXxnvjoqQuDGFIEHFIwuDTX/KWAQKIBjyMWLFHEeTDGYVsYci85z2UbTDg==} peerDependencies: - vue: 3.4.29 + vue: 3.4.30 - '@vue/[email protected]': - resolution: {integrity: sha512-hQ2gAQcBO/CDpC82DCrinJNgOHI2v+FA7BDW4lMSPeBpQ7sRe2OLHWe5cph1s7D8DUQAwRt18dBDfJJ220APEA==} + '@vue/[email protected]': + resolution: {integrity: sha512-CLg+f8RQCHQnKvuHY9adMsMaQOcqclh6Z5V9TaoMgy0ut0tz848joZ7/CYFFyF/yZ5i2yaw7Fn498C+CNZVHIg==} '@vueuse/[email protected]': resolution: {integrity: sha512-x3sD4Mkm7PJ+pcq3HX8PLPBadXCAlSDR/waK87dz0gQE+qJnaaFhc/dZVfJz+IUYzTMVGum2QlR7ImiJQN4s6g==} @@ -3044,8 +3044,8 @@ packages: engines: {node: '>=14'} hasBin: true - [email protected]: - resolution: {integrity: sha512-kSmJl2ZwhNf/bcIuCH/imtNOKlpkLDn2jqT5FJ+/0CXjhnFaOa9cOe9gHKKy71eM49izwuQjZhKk+lWQ1JxB7A==} + [email protected]: + resolution: {integrity: sha512-Kaxhu4T7SJGpRQx99tq216gCq2nMxJo+uuT6uzz9l8TVN2stL7M06MIIXAtr9jsrLs2Glflgf2vMQRepxawOdQ==} [email protected]: resolution: {integrity: sha512-5gxbEjcb/Z2n6TTmXZx9wVi3N/DOzE7RXY3Xg9dakDuhX/izwumB9rGjeWUV6dTA0D0+juvo+JonZgNR9sgA5A==} @@ -3635,8 +3635,8 @@ packages: [email protected]: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - [email protected]: - resolution: {integrity: sha512-cvVIBILwuoSyD54U4cF/UXDh5yAobhNV/tPygI4lZhgOIJQE/WLWC4waBRb4I6bDVYb3OVx3lfHbaQOEoUD5sg==} + [email protected]: + resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} [email protected]: @@ -4355,8 +4355,8 @@ packages: engines: {node: '>=18.12.0'} hasBin: true - [email protected]: - resolution: {integrity: sha512-sy0dq+JPS+RAFiFk2K8Nbub7khNmeeoFALNUJ4Wzk34wZKAzaOhEXqGWs4RA5aui0RaM6Hgn7VEKhCj0mlKNLA==} + [email protected]: + resolution: {integrity: sha512-Lllokma2mtoniUOS94CcOErHWAug5iu7HOmDrvWgpw8jyQH2fomgB+7lZS4HWZxytUuQwkGOwe49FvwVaA85Xw==} engines: {node: '>=18.0.0'} [email protected]: @@ -4896,8 +4896,9 @@ packages: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} - [email protected]: - resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + [email protected]: + resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} + engines: {node: '>= 0.4'} [email protected]: resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} @@ -6016,8 +6017,8 @@ packages: resolution: {integrity: sha512-lNov5nt5/xw6nK00gtoQSA2I4HcpAnot1TMJccTNw2rtL5jdLN26h3f+mT8VF4JBv5/rBNXyuUPWcogceyKJJw==} hasBin: true - [email protected]: - resolution: {integrity: sha512-MJIfu8oVA4GVEuZKxk1GaaLpdq45w8b/UoWwuq3k+oIWbFBFtFG37xCTe3qz7D/ZBcHFZ2LmQb66grE1/Q93Hw==} + [email protected]: + resolution: {integrity: sha512-ZhgwrF9P697hrsO8PZ4dFL8UZLLmczYcFwiknsPEk81BTC0xauqQfepPefIfS/YK2z2VVRQmyg0hZujShTlH7A==} [email protected]: resolution: {integrity: sha512-SgZym5i5CL02CV6WrsjdNjk0pwsxHb5uKA8Mjo8g01HrcJnqab6r45igjbx30aacGfWGpVKXHMLeM/Ux+hha3g==} @@ -6411,16 +6412,16 @@ packages: '@vue/composition-api': optional: true - [email protected]: - resolution: {integrity: sha512-8Q+u+WP4N2SXY38FDcF2H1dUEbYVHVPtPCPZj/GTZx8RCbiB8AtJP9+YIxn4Vs0svMTNQcLIzka4GH7Utkx9xQ==} + [email protected]: + resolution: {integrity: sha512-HB+t2p611aIZraV2aPSRNXf0Z/oLZFrlygJm+sZbdJaW6lcFqEDQwnzUBXn+DApw+/QzDU/I9TeWx9izEjTmsA==} peerDependencies: vue: ^3.2.0 [email protected]: resolution: {integrity: sha512-6I+5GNobKvE2nR5MPhO+T59d4j2LXRQoc/ZCmGtCoBWKDQr5nzSqjFaOOdPysHFI2p42wNLhQMafd0N540UW9Q==} - [email protected]: - resolution: {integrity: sha512-8QUYfRcYzNlYuzKPfge1UWC6nF9ym0lx7mpGVPJYNhddxEf3DD0+kU07NTL0sXuiT2HuJuKr/iEO8WvXvT0RSQ==} + [email protected]: + resolution: {integrity: sha512-NcxtKCwkdf1zPsr7Y8+QlDBCGqxvjLXF2EX+yi76rV5rrz90Y6gK1cq0olIhdWGgrlhs9ElHuhi9t3+W5sG5Xw==} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -7482,23 +7483,23 @@ snapshots: dependencies: statuses: 2.0.1 - '@codemirror/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])': + '@codemirror/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])': dependencies: '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@lezer/common': 1.2.1 '@codemirror/[email protected]': dependencies: '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@lezer/common': 1.2.1 - '@codemirror/[email protected](@codemirror/[email protected])': + '@codemirror/[email protected](@codemirror/[email protected])': dependencies: - '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) + '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 '@lezer/common': 1.2.1 @@ -7508,23 +7509,23 @@ snapshots: '@codemirror/[email protected]': dependencies: - '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) - '@codemirror/lang-css': 6.2.1(@codemirror/[email protected]) + '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) + '@codemirror/lang-css': 6.2.1(@codemirror/[email protected]) '@codemirror/lang-javascript': 6.2.2 '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@lezer/common': 1.2.1 '@lezer/css': 1.1.8 '@lezer/html': 1.3.10 '@codemirror/[email protected]': dependencies: - '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) + '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) '@codemirror/language': 6.10.2 '@codemirror/lint': 6.8.1 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@lezer/common': 1.2.1 '@lezer/javascript': 1.4.17 @@ -7533,9 +7534,9 @@ snapshots: '@codemirror/language': 6.10.2 '@lezer/json': 1.0.2 - '@codemirror/[email protected](@codemirror/[email protected])': + '@codemirror/[email protected](@codemirror/[email protected])': dependencies: - '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) + '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 '@lezer/common': 1.2.1 @@ -7547,7 +7548,7 @@ snapshots: '@codemirror/[email protected]': dependencies: '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@lezer/common': 1.2.1 '@lezer/highlight': 1.2.0 '@lezer/lr': 1.4.1 @@ -7556,18 +7557,18 @@ snapshots: '@codemirror/[email protected]': dependencies: '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 crelt: 1.0.6 '@codemirror/[email protected]': dependencies: '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 crelt: 1.0.6 '@codemirror/[email protected]': {} - '@codemirror/[email protected]': + '@codemirror/[email protected]': dependencies: '@codemirror/state': 6.4.1 style-mod: 4.1.2 @@ -7700,11 +7701,11 @@ snapshots: '@floating-ui/[email protected]': {} - '@floating-ui/[email protected]([email protected]([email protected]))': + '@floating-ui/[email protected]([email protected]([email protected]))': dependencies: '@floating-ui/dom': 1.6.5 '@floating-ui/utils': 0.2.2 - vue-demi: 0.14.8([email protected]([email protected])) + vue-demi: 0.14.8([email protected]([email protected])) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -7713,10 +7714,10 @@ snapshots: dependencies: tailwindcss: 3.4.4 - '@headlessui/[email protected]([email protected]([email protected]))': + '@headlessui/[email protected]([email protected]([email protected]))': dependencies: - '@tanstack/vue-virtual': 3.6.0([email protected]([email protected])) - vue: 3.4.29([email protected]) + '@tanstack/vue-virtual': 3.7.0([email protected]([email protected])) + vue: 3.4.30([email protected]) '@hono/[email protected]': {} @@ -8003,11 +8004,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@replit/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])': + '@replit/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])': dependencies: '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@rollup/[email protected]': dependencies: @@ -8067,8 +8068,8 @@ snapshots: '@scalar/client-app': 0.1.9([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/components': 0.11.6([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/oas-utils': 0.2.3 - vue: 3.4.29([email protected]) - vue-router: 4.3.3([email protected]([email protected])) + vue: 3.4.30([email protected]) + vue-router: 4.4.0([email protected]([email protected])) transitivePeerDependencies: - '@jest/globals' - '@types/bun' @@ -8083,8 +8084,8 @@ snapshots: '@scalar/[email protected]([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: - '@floating-ui/vue': 1.0.6([email protected]([email protected])) - '@headlessui/vue': 1.7.22([email protected]([email protected])) + '@floating-ui/vue': 1.0.6([email protected]([email protected])) + '@headlessui/vue': 1.7.22([email protected]([email protected])) '@scalar/components': 0.11.6([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/oas-utils': 0.2.3 '@scalar/openapi-parser': 0.7.1 @@ -8092,13 +8093,13 @@ snapshots: '@scalar/use-codemirror': 0.11.2([email protected]) '@scalar/use-toasts': 0.7.2([email protected]) '@scalar/use-tooltip': 0.7.3([email protected]) - '@vueuse/core': 10.11.0([email protected]([email protected])) + '@vueuse/core': 10.11.0([email protected]([email protected])) axios: 1.7.2 httpsnippet-lite: 3.0.5 nanoid: 5.0.7 pretty-bytes: 6.1.1 pretty-ms: 8.0.0 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) transitivePeerDependencies: - '@jest/globals' - '@types/bun' @@ -8112,7 +8113,7 @@ snapshots: '@scalar/[email protected]([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: - '@headlessui/vue': 1.7.22([email protected]([email protected])) + '@headlessui/vue': 1.7.22([email protected]([email protected])) '@scalar/api-client': 1.3.14([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/api-client-modal': 0.0.11([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/components': 0.11.6([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) @@ -8123,8 +8124,8 @@ snapshots: '@scalar/use-toasts': 0.7.2([email protected]) '@scalar/use-tooltip': 0.7.3([email protected]) '@unhead/schema': 1.9.14 - '@unhead/vue': 1.9.14([email protected]([email protected])) - '@vueuse/core': 10.11.0([email protected]([email protected])) + '@unhead/vue': 1.9.14([email protected]([email protected])) + '@vueuse/core': 10.11.0([email protected]([email protected])) axios: 1.7.2 fuse.js: 7.0.0 github-slugger: 2.0.0 @@ -8132,7 +8133,7 @@ snapshots: postcss-nested: 6.0.1([email protected]) unhead: 1.9.14 unified: 11.0.5 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) transitivePeerDependencies: - '@jest/globals' - '@types/bun' @@ -8149,7 +8150,7 @@ snapshots: '@scalar/[email protected]([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: '@headlessui/tailwindcss': 0.2.1([email protected]) - '@headlessui/vue': 1.7.22([email protected]([email protected])) + '@headlessui/vue': 1.7.22([email protected]([email protected])) '@scalar/components': 0.11.6([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/draggable': 0.1.2([email protected]) '@scalar/oas-utils': 0.2.3 @@ -8157,14 +8158,14 @@ snapshots: '@scalar/openapi-parser': 0.7.1 '@scalar/use-toasts': 0.7.2([email protected]) '@scalar/use-tooltip': 0.7.3([email protected]) - '@vueuse/core': 10.11.0([email protected]([email protected])) + '@vueuse/core': 10.11.0([email protected]([email protected])) axios: 1.7.2 cva: 1.0.0-beta.1([email protected]) nanoid: 5.0.7 pretty-bytes: 6.1.1 pretty-ms: 8.0.0 - vue: 3.4.29([email protected]) - vue-router: 4.3.3([email protected]([email protected])) + vue: 3.4.30([email protected]) + vue-router: 4.4.0([email protected]([email protected])) zod: 3.23.8 transitivePeerDependencies: - '@jest/globals' @@ -8203,16 +8204,16 @@ snapshots: '@scalar/[email protected]([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: '@floating-ui/utils': 0.2.2 - '@floating-ui/vue': 1.0.6([email protected]([email protected])) - '@headlessui/vue': 1.7.22([email protected]([email protected])) + '@floating-ui/vue': 1.0.6([email protected]([email protected])) + '@headlessui/vue': 1.7.22([email protected]([email protected])) '@scalar/code-highlight': 0.0.4 '@scalar/oas-utils': 0.2.3 '@storybook/test': 8.1.10([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) - '@vueuse/core': 10.11.0([email protected]([email protected])) + '@vueuse/core': 10.11.0([email protected]([email protected])) cva: 1.0.0-beta.1([email protected]) nanoid: 5.0.7 tailwind-merge: 2.3.0 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) transitivePeerDependencies: - '@jest/globals' - '@types/bun' @@ -8226,7 +8227,7 @@ snapshots: '@scalar/[email protected]([email protected])': dependencies: - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) transitivePeerDependencies: - typescript @@ -8304,30 +8305,30 @@ snapshots: '@scalar/[email protected]([email protected])': dependencies: - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) transitivePeerDependencies: - typescript '@scalar/[email protected]([email protected])': dependencies: - '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) + '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) '@codemirror/commands': 6.6.0 - '@codemirror/lang-css': 6.2.1(@codemirror/[email protected]) + '@codemirror/lang-css': 6.2.1(@codemirror/[email protected]) '@codemirror/lang-html': 6.4.9 '@codemirror/lang-json': 6.0.1 - '@codemirror/lang-yaml': 6.1.1(@codemirror/[email protected]) + '@codemirror/lang-yaml': 6.1.1(@codemirror/[email protected]) '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@lezer/common': 1.2.1 '@lezer/highlight': 1.2.0 '@lezer/lr': 1.4.1 - '@replit/codemirror-css-color-picker': 6.1.1(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]) - '@uiw/codemirror-themes': 4.22.2(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]) + '@replit/codemirror-css-color-picker': 6.1.1(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]) + '@uiw/codemirror-themes': 4.22.2(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]) codemirror: 6.0.1(@lezer/[email protected]) - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) optionalDependencies: - y-codemirror.next: 0.3.5(@codemirror/[email protected])(@codemirror/[email protected])([email protected]) + y-codemirror.next: 0.3.5(@codemirror/[email protected])(@codemirror/[email protected])([email protected]) yjs: 13.6.18 transitivePeerDependencies: - typescript @@ -8335,7 +8336,7 @@ snapshots: '@scalar/[email protected]([email protected])': dependencies: nanoid: 5.0.7 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) vue-sonner: 1.1.3 transitivePeerDependencies: - typescript @@ -8343,7 +8344,7 @@ snapshots: '@scalar/[email protected]([email protected])': dependencies: tippy.js: 6.3.7 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) transitivePeerDependencies: - typescript @@ -8518,12 +8519,12 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tanstack/[email protected]': {} + '@tanstack/[email protected]': {} - '@tanstack/[email protected]([email protected]([email protected]))': + '@tanstack/[email protected]([email protected]([email protected]))': dependencies: - '@tanstack/virtual-core': 3.6.0 - vue: 3.4.29([email protected]) + '@tanstack/virtual-core': 3.7.0 + vue: 3.4.30([email protected]) '@testing-library/[email protected]': dependencies: @@ -8553,7 +8554,7 @@ snapshots: dependencies: '@testing-library/dom': 9.3.4 - '@tonyrl/[email protected]': {} + '@tonyrl/[email protected]': {} '@tootallnate/[email protected]': {} @@ -8843,11 +8844,11 @@ snapshots: '@typescript-eslint/types': 7.13.1 eslint-visitor-keys: 3.4.3 - '@uiw/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])': + '@uiw/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])': dependencies: '@codemirror/language': 6.10.2 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 '@ungap/[email protected]': {} @@ -8865,13 +8866,13 @@ snapshots: dependencies: '@unhead/schema': 1.9.14 - '@unhead/[email protected]([email protected]([email protected]))': + '@unhead/[email protected]([email protected]([email protected]))': dependencies: '@unhead/schema': 1.9.14 '@unhead/shared': 1.9.14 hookable: 5.5.3 unhead: 1.9.14 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) '@vercel/[email protected]': dependencies: @@ -8956,77 +8957,77 @@ snapshots: loupe: 2.3.7 pretty-format: 29.7.0 - '@vue/[email protected]': + '@vue/[email protected]': dependencies: '@babel/parser': 7.24.7 - '@vue/shared': 3.4.29 + '@vue/shared': 3.4.30 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.2.0 - '@vue/[email protected]': + '@vue/[email protected]': dependencies: - '@vue/compiler-core': 3.4.29 - '@vue/shared': 3.4.29 + '@vue/compiler-core': 3.4.30 + '@vue/shared': 3.4.30 - '@vue/[email protected]': + '@vue/[email protected]': dependencies: '@babel/parser': 7.24.7 - '@vue/compiler-core': 3.4.29 - '@vue/compiler-dom': 3.4.29 - '@vue/compiler-ssr': 3.4.29 - '@vue/shared': 3.4.29 + '@vue/compiler-core': 3.4.30 + '@vue/compiler-dom': 3.4.30 + '@vue/compiler-ssr': 3.4.30 + '@vue/shared': 3.4.30 estree-walker: 2.0.2 magic-string: 0.30.10 postcss: 8.4.38 source-map-js: 1.2.0 - '@vue/[email protected]': + '@vue/[email protected]': dependencies: - '@vue/compiler-dom': 3.4.29 - '@vue/shared': 3.4.29 + '@vue/compiler-dom': 3.4.30 + '@vue/shared': 3.4.30 '@vue/[email protected]': {} - '@vue/[email protected]': + '@vue/[email protected]': dependencies: - '@vue/shared': 3.4.29 + '@vue/shared': 3.4.30 - '@vue/[email protected]': + '@vue/[email protected]': dependencies: - '@vue/reactivity': 3.4.29 - '@vue/shared': 3.4.29 + '@vue/reactivity': 3.4.30 + '@vue/shared': 3.4.30 - '@vue/[email protected]': + '@vue/[email protected]': dependencies: - '@vue/reactivity': 3.4.29 - '@vue/runtime-core': 3.4.29 - '@vue/shared': 3.4.29 + '@vue/reactivity': 3.4.30 + '@vue/runtime-core': 3.4.30 + '@vue/shared': 3.4.30 csstype: 3.1.3 - '@vue/[email protected]([email protected]([email protected]))': + '@vue/[email protected]([email protected]([email protected]))': dependencies: - '@vue/compiler-ssr': 3.4.29 - '@vue/shared': 3.4.29 - vue: 3.4.29([email protected]) + '@vue/compiler-ssr': 3.4.30 + '@vue/shared': 3.4.30 + vue: 3.4.30([email protected]) - '@vue/[email protected]': {} + '@vue/[email protected]': {} - '@vueuse/[email protected]([email protected]([email protected]))': + '@vueuse/[email protected]([email protected]([email protected]))': dependencies: '@types/web-bluetooth': 0.0.20 '@vueuse/metadata': 10.11.0 - '@vueuse/shared': 10.11.0([email protected]([email protected])) - vue-demi: 0.14.8([email protected]([email protected])) + '@vueuse/shared': 10.11.0([email protected]([email protected])) + vue-demi: 0.14.8([email protected]([email protected])) transitivePeerDependencies: - '@vue/composition-api' - vue '@vueuse/[email protected]': {} - '@vueuse/[email protected]([email protected]([email protected]))': + '@vueuse/[email protected]([email protected]([email protected]))': dependencies: - vue-demi: 0.14.8([email protected]([email protected])) + vue-demi: 0.14.8([email protected]([email protected])) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -9316,7 +9317,7 @@ snapshots: [email protected]: dependencies: caniuse-lite: 1.0.30001636 - electron-to-chromium: 1.4.807 + electron-to-chromium: 1.4.810 node-releases: 2.0.14 update-browserslist-db: 1.0.16([email protected]) @@ -9579,13 +9580,13 @@ snapshots: [email protected](@lezer/[email protected]): dependencies: - '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) + '@codemirror/autocomplete': 6.16.3(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]) '@codemirror/commands': 6.6.0 '@codemirror/language': 6.10.2 '@codemirror/lint': 6.8.1 '@codemirror/search': 6.5.6 '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 transitivePeerDependencies: - '@lezer/common' @@ -9957,7 +9958,7 @@ snapshots: minimatch: 9.0.1 semver: 7.6.2 - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -10705,7 +10706,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies: @@ -11496,7 +11497,7 @@ snapshots: debug: 4.3.5 execa: 8.0.1 lilconfig: 3.1.2 - listr2: 8.2.2 + listr2: 8.2.3 micromatch: 4.0.7 pidtree: 0.6.0 string-argv: 0.3.2 @@ -11504,7 +11505,7 @@ snapshots: transitivePeerDependencies: - supports-color - [email protected]: + [email protected]: dependencies: cli-truncate: 4.0.0 colorette: 2.0.20 @@ -12094,7 +12095,7 @@ snapshots: '@types/cookie': 0.6.0 '@types/statuses': 2.0.5 chalk: 4.1.2 - graphql: 16.8.2 + graphql: 16.9.0 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.2 @@ -12206,7 +12207,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies: @@ -13086,7 +13087,7 @@ snapshots: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 - object-inspect: 1.13.1 + object-inspect: 1.13.2 [email protected]: {} @@ -13478,11 +13479,11 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies: - tldts-core: 6.1.28 + tldts-core: 6.1.29 [email protected]: dependencies: @@ -13833,24 +13834,24 @@ snapshots: - supports-color - terser - [email protected]([email protected]([email protected])): + [email protected]([email protected]([email protected])): dependencies: - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) - [email protected]([email protected]([email protected])): + [email protected]([email protected]([email protected])): dependencies: '@vue/devtools-api': 6.6.3 - vue: 3.4.29([email protected]) + vue: 3.4.30([email protected]) [email protected]: {} - [email protected]([email protected]): + [email protected]([email protected]): dependencies: - '@vue/compiler-dom': 3.4.29 - '@vue/compiler-sfc': 3.4.29 - '@vue/runtime-dom': 3.4.29 - '@vue/server-renderer': 3.4.29([email protected]([email protected])) - '@vue/shared': 3.4.29 + '@vue/compiler-dom': 3.4.30 + '@vue/compiler-sfc': 3.4.30 + '@vue/runtime-dom': 3.4.30 + '@vue/server-renderer': 3.4.30([email protected]([email protected])) + '@vue/shared': 3.4.30 optionalDependencies: typescript: 5.5.2 @@ -14020,10 +14021,10 @@ snapshots: [email protected]: {} - [email protected](@codemirror/[email protected])(@codemirror/[email protected])([email protected]): + [email protected](@codemirror/[email protected])(@codemirror/[email protected])([email protected]): dependencies: '@codemirror/state': 6.4.1 - '@codemirror/view': 6.28.1 + '@codemirror/view': 6.28.2 lib0: 0.2.94 yjs: 13.6.18 optional: true
75c196d68027fdf3670f0dbc6dabf9c8a7ec031a
2024-07-09 15:51:50
dependabot[bot]
chore(deps-dev): bump @typescript-eslint/parser from 7.15.0 to 7.16.0 (#16126)
false
bump @typescript-eslint/parser from 7.15.0 to 7.16.0 (#16126)
chore
diff --git a/package.json b/package.json index 8e5c33090e8e1c..a8aa3ed78165bd 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ "@types/tough-cookie": "4.0.5", "@types/uuid": "10.0.0", "@typescript-eslint/eslint-plugin": "7.15.0", - "@typescript-eslint/parser": "7.15.0", + "@typescript-eslint/parser": "7.16.0", "@vercel/nft": "0.27.2", "@vitest/coverage-v8": "1.6.0", "eslint": "9.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ccd27e9c9b6b3c..a7fa75bdfc15d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -344,10 +344,10 @@ importers: version: 10.0.0 '@typescript-eslint/eslint-plugin': specifier: 7.15.0 - version: 7.15.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) + version: 7.15.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) '@typescript-eslint/parser': - specifier: 7.15.0 - version: 7.15.0([email protected])([email protected]) + specifier: 7.16.0 + version: 7.16.0([email protected])([email protected]) '@vercel/nft': specifier: 0.27.2 version: 0.27.2 @@ -2130,8 +2130,8 @@ packages: typescript: optional: true - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-k9fYuQNnypLFcqORNClRykkGOMOj+pV6V91R4GO/l1FDGwpqmSwoOQrOHo3cGaH63e+D3ZiCAOsuS/D2c99j/A==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -8933,10 +8933,10 @@ snapshots: '@types/node': 20.14.10 optional: true - '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': + '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.15.0([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.15.0 '@typescript-eslint/type-utils': 7.15.0([email protected])([email protected]) '@typescript-eslint/utils': 7.15.0([email protected])([email protected]) @@ -8951,12 +8951,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/[email protected]([email protected])([email protected])': + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: - '@typescript-eslint/scope-manager': 7.15.0 - '@typescript-eslint/types': 7.15.0 - '@typescript-eslint/typescript-estree': 7.15.0([email protected]) - '@typescript-eslint/visitor-keys': 7.15.0 + '@typescript-eslint/scope-manager': 7.16.0 + '@typescript-eslint/types': 7.16.0 + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/visitor-keys': 7.16.0 debug: 4.3.5 eslint: 9.6.0 optionalDependencies:
264bd1d21f35013b1abafd2f1472472707aa48e5
2025-03-01 00:10:27
Tsuyumi25
feat(route): add news route for toranoana.jp (#18479)
false
add news route for toranoana.jp (#18479)
feat
diff --git a/lib/routes/toranoana/namespace.ts b/lib/routes/toranoana/namespace.ts new file mode 100644 index 00000000000000..3d48496571ca86 --- /dev/null +++ b/lib/routes/toranoana/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'とらのあな', + url: 'toranoana.jp', + lang: 'ja', +}; diff --git a/lib/routes/toranoana/news.ts b/lib/routes/toranoana/news.ts new file mode 100644 index 00000000000000..404c1f513f5a54 --- /dev/null +++ b/lib/routes/toranoana/news.ts @@ -0,0 +1,110 @@ +import { Route, Data, DataItem } from '@/types'; +import ofetch from '@/utils/ofetch'; +import { parseDate } from '@/utils/parse-date'; +import { load } from 'cheerio'; + +export const route: Route = { + path: '/news/:category?', + categories: ['anime'], + example: '/toranoana/news/toragen', + parameters: { category: 'category' }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Category', + maintainers: ['Tsuyumi25'], + handler, + radar: [ + { + title: '総合新着記事', + source: ['news.toranoana.jp'], + target: '/news', + }, + { + title: '女性向け', + source: ['news.toranoana.jp/joshi'], + target: '/news/joshi', + }, + { + title: 'イラスト展', + source: ['news.toranoana.jp/exhibitions'], + target: '/news/exhibition', + }, + { + source: ['news.toranoana.jp/category/:category'], + target: '/news/:category', + }, + ], + description: ` +::: warning TIP +[総合新着記事](https://news.toranoana.jp)→\`/toranoana/news\` +[女性向け](https://news.toranoana.jp/joshi)→\`/toranoana/news/joshi\` +[イラスト展](https://news.toranoana.jp/exhibitions)→\`/toranoana/news/exhibition\` +[\`https://news.toranoana.jp/category/media\`](https://news.toranoana.jp/category/media)→\`/toranoana/news/media\` +:::`, +}; + +async function handler(ctx): Promise<Data> { + const { category = '' } = ctx.req.param(); + let apiUrl = 'https://news.toranoana.jp/wp-json/wp/v2/posts'; + + if (category) { + const categoryResponse = await ofetch(`https://news.toranoana.jp/wp-json/wp/v2/categories?slug=${category}`); + if (categoryResponse && categoryResponse.length > 0) { + apiUrl += `?categories=${categoryResponse[0].id}`; + } + } else { + // exclude category-joshi to get result of general + apiUrl += `?categories_exclude=1598`; + } + + const posts = await ofetch(apiUrl, { + query: { + per_page: 20, + _embed: 'wp:featuredmedia', + }, + }); + + if (!posts || !posts.length) { + throw new Error('No posts found'); + } + + const items = posts.map((post) => { + const $ = load(post.content.rendered); + + // remove unnecessary title + $('h1').first().remove(); + $('h2').first().remove(); + + let thumbnail = ''; + if (post._embedded && post._embedded['wp:featuredmedia'][0].source_url) { + thumbnail = post._embedded['wp:featuredmedia'][0].source_url; + } + + if (thumbnail) { + $('body').prepend(`<img src="${thumbnail}" alt="${post.title.rendered}" />`); + } + + return { + title: post.title.rendered, + link: post.link, + description: $.html(), + pubDate: parseDate(post.date_gmt), + guid: post.link, + author: 'とらのあな', + }; + }); + + return { + title: category ? `とらのあな総合インフォメーション - ${category}` : 'とらのあな総合インフォメーション', + link: category ? `https://news.toranoana.jp/category/${category}` : 'https://news.toranoana.jp/', + description: 'とらのあなの最新情報をお届け!同人誌、書籍、コミック、店舗フェア、イラスト展、とらのあな限定版、キャンペーンなど…スペシャルでお得な情報をいち早くチェック!', + item: items.filter(Boolean) as DataItem[], + language: 'ja', + }; +}
106341f4e62860642739207da9690a60dbbad559
2022-08-17 02:38:11
dependabot[bot]
chore(deps): bump puppeteer from 16.1.0 to 16.1.1 (#10502)
false
bump puppeteer from 16.1.0 to 16.1.1 (#10502)
chore
diff --git a/package.json b/package.json index 46df0a33908f04..8cba7826d9be79 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "parse-torrent": "9.1.5", "pidusage": "3.0.0", "plist": "3.0.6", - "puppeteer": "16.1.0", + "puppeteer": "16.1.1", "puppeteer-extra": "3.3.4", "puppeteer-extra-plugin-stealth": "2.11.1", "query-string": "7.1.1", diff --git a/yarn.lock b/yarn.lock index ed7a4b0aa8c4c0..1fc0df53b7b596 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11559,10 +11559,10 @@ [email protected]: debug "^4.1.1" deepmerge "^4.2.2" [email protected]: - version "16.1.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-16.1.0.tgz#06a32dc347c94642601017fbf83e1d37379b9651" - integrity sha512-lhykJLbH2bbBaP3NfYI2Vj0T4ctrdfVdEVf8glZITPnLfqrJ0nfUzAYuIz5YcA79k5lmFKANIhEXex+jQChU3g== [email protected]: + version "16.1.1" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-16.1.1.tgz#1bb8ec3b86f755c34b913421b81e9cd2cfad3588" + integrity sha512-lBneizsNF0zi1/iog9c0ogVnvDHJG4IWpkdIAgE2oiDKhr0MJRV8JeM2xbhUwCwhDJXjjVS2TNCZdLsMp9Ojdg== dependencies: cross-fetch "3.1.5" debug "4.3.4"
3d828400f28305141014b4f382e9976737bd7902
2025-02-24 10:19:57
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/lib/routes/2048/index.ts b/lib/routes/2048/index.ts index 9db0cde6111ab8..db9644d7ace38e 100644 --- a/lib/routes/2048/index.ts +++ b/lib/routes/2048/index.ts @@ -74,13 +74,16 @@ async function handler(ctx) { const onclickValue = $('.button').first().attr('onclick'); const targetUrl = onclickValue.match(/window\.open\('([^']+)'/)[1]; - return {url: targetUrl}; - })) as { url: string}; + return { url: targetUrl }; + })) as { url: string }; // 获取重定向后的url和safeid const redirectResponse = await ofetch.raw(domainInfo.url); const currentUrl = `${redirectResponse.url}thread.php?fid-${id}.html`; const redirectPageContent = load(redirectResponse._data); - const safeId = redirectPageContent('script').text().match(/var safeid='(.*?)',/)?.[1] ?? ''; + const safeId = + redirectPageContent('script') + .text() + .match(/var safeid='(.*?)',/)?.[1] ?? ''; const response = await ofetch.raw(currentUrl, { headers: {
472073d2fc0e392d5c99cd38cf1126324804341e
2024-04-26 21:15:32
Tony
chore: use cache in tsx dev
false
use cache in tsx dev
chore
diff --git a/package.json b/package.json index 49347779594825..00b11ad9c93d9c 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "scripts": { "build": "tsx scripts/workflow/build-routes.ts", "build:docs": "tsx scripts/workflow/build-docs.ts", - "dev": "cross-env NODE_ENV=dev tsx watch --no-cache lib/index.ts", - "dev:cache": "cross-env NODE_ENV=production tsx watch lib/index.ts", + "dev": "cross-env NODE_ENV=dev tsx watch --clear-screen=false lib/index.ts", + "dev:cache": "cross-env NODE_ENV=production tsx watch --clear-screen=false lib/index.ts", "format": "prettier \"**/*.{ts,tsx,js,json}\" --write && eslint --cache --fix \"**/*.{ts,tsx,js,yml}\"", "format:check": "prettier \"**/*.{ts,tsx,js,json}\" --check && eslint --cache \"**/*.{ts,tsx,js,yml}\"", "format:staged": "lint-staged",
ababfbc7ffb33281e26b9606df46150819dc7eda
2023-09-05 17:49:10
dependabot[bot]
chore(deps): bump @notionhq/client from 2.2.12 to 2.2.13 (#13212)
false
bump @notionhq/client from 2.2.12 to 2.2.13 (#13212)
chore
diff --git a/package.json b/package.json index 2c37b3ee4c6f84..4770e13dca12ba 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ }, "dependencies": { "@koa/router": "12.0.0", - "@notionhq/client": "2.2.12", + "@notionhq/client": "2.2.13", "@postlight/parser": "2.2.3", "@sentry/node": "7.66.0", "aes-js": "3.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5d25db0da655fb..2c1fac099db243 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: 12.0.0 version: 12.0.0 '@notionhq/client': - specifier: 2.2.12 - version: 2.2.12 + specifier: 2.2.13 + version: 2.2.13 '@postlight/parser': specifier: 2.2.3 version: 2.2.3 @@ -1038,8 +1038,8 @@ packages: fastq: 1.15.0 dev: true - /@notionhq/[email protected]: - resolution: {integrity: sha512-LCzbOyVjVtui9GQPFEuvFd8JIWZbY/tgyCqrmxzGSjpGCwqjsEldeNC4qYjsMzVB4MIbP5y1vlWzLsUw/M9QAQ==} + /@notionhq/[email protected]: + resolution: {integrity: sha512-wJpEl30QUSy2K3/Q2c2knNiZlLXJ17JnQgaIiFbN68IMJy+2TE9fXLxvV1N/cMVs2+SpteAa6PlyrUgfGdlmDg==} engines: {node: '>=12'} dependencies: '@types/node-fetch': 2.6.4
6041624252dbf9cba198b1504518c722d99af11c
2020-10-13 15:58:16
Ethan Shen
feat: add 中国工程科技知识中心产业政策 (#5864)
false
add 中国工程科技知识中心产业政策 (#5864)
feat
diff --git a/docs/other.md b/docs/other.md index 2eace247d81248..c4820a18ad80d6 100644 --- a/docs/other.md +++ b/docs/other.md @@ -825,6 +825,10 @@ type 为 all 时,category 参数不支持 cost 和 free </Route> +### 产业政策 + +<Route author="nczitzk" example="/cktest/policy" path="/cktest/policy"/> + ## 中国银行 ### 中国银行外汇牌价 diff --git a/lib/router.js b/lib/router.js index 38a1e811915241..f4d5276ab2719e 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3292,6 +3292,7 @@ router.get('/95mm/category/:category', require('./routes/95mm/category')); // 中国工程科技知识中心 router.get('/cktest/app/:ctgroup?/:domain?', require('./routes/cktest/app')); +router.get('/cktest/policy', require('./routes/cktest/policy')); // 妈咪帮 router.get('/mamibuy/:caty?/:age?/:sort?', require('./routes/mamibuy/index')); diff --git a/lib/routes/cktest/policy.js b/lib/routes/cktest/policy.js new file mode 100644 index 00000000000000..ce0727bd6a5c54 --- /dev/null +++ b/lib/routes/cktest/policy.js @@ -0,0 +1,44 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = '1005'; + + const rootUrl = `http://mall.ckcest.cn/mall/listContent.ilf?dbId=${id}&text=&express=&secondSearchExpress=&order=3&page=1&limit=10`; + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const list = response.data.results.datas.map((item) => ({ + link: item.detail_url, + })); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + const dateArray = content('meta[name="firstpublishedtime"]').attr('content').split('-'); + const time = dateArray.pop(); + + item.pubDate = `${dateArray.join('-')} ${time}`; + item.title = content('title').text().split('_')[0]; + item.description = content('.wrap').html() || content('.policyLibraryOverview_content').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: '产业政策 - 中国工程科技知识中心', + link: rootUrl, + item: items, + }; +};
dc46f703933434f2520d79e85f9b2f9540f0627c
2023-05-30 20:07:15
Tony
fix(route): youtube get channel id from user handle (#12579)
false
youtube get channel id from user handle (#12579)
fix
diff --git a/lib/v2/youtube/user.js b/lib/v2/youtube/user.js index 3ef438ef4cbdd0..e84a86359ad5f2 100644 --- a/lib/v2/youtube/user.js +++ b/lib/v2/youtube/user.js @@ -17,7 +17,7 @@ module.exports = async (ctx) => { const link = `https://www.youtube.com/${username}`; const response = await got(link); const $ = cheerio.load(response.data); - const channelId = $('meta[itemprop="channelId"]').attr('content'); + const channelId = $('meta[itemprop="identifier"]').attr('content'); channelName = $('meta[itemprop="name"]').attr('content'); playlistId = (await utils.getChannelWithId(channelId, 'contentDetails', ctx.cache)).data.items[0].contentDetails.relatedPlaylists.uploads; }
2dcd9c00836a2f69fb524fdbb7e864950c894001
2025-01-31 14:30:05
dependabot[bot]
chore(deps): bump @hono/node-server from 1.13.7 to 1.13.8 (#18248)
false
bump @hono/node-server from 1.13.7 to 1.13.8 (#18248)
chore
diff --git a/package.json b/package.json index be2f997b3e8bef..def0f257ef4bf5 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "dependencies": { "@bbob/html": "4.2.0", "@bbob/preset-html5": "4.2.0", - "@hono/node-server": "1.13.7", + "@hono/node-server": "1.13.8", "@hono/zod-openapi": "0.18.3", "@notionhq/client": "2.2.15", "@opentelemetry/api": "1.9.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fdca6fd43680ab..9deab097c4b6c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,8 +22,8 @@ importers: specifier: 4.2.0 version: 4.2.0 '@hono/node-server': - specifier: 1.13.7 - version: 1.13.7([email protected]) + specifier: 1.13.8 + version: 1.13.8([email protected]) '@hono/zod-openapi': specifier: 0.18.3 version: 0.18.3([email protected])([email protected]) @@ -1415,8 +1415,8 @@ packages: resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@hono/[email protected]': - resolution: {integrity: sha512-kTfUMsoloVKtRA2fLiGSd9qBddmru9KadNyhJCwgKBxTiNkaAJEwkVN9KV/rS4HtmmNRtUh6P+YpmjRMl0d9vQ==} + '@hono/[email protected]': + resolution: {integrity: sha512-fsn8ucecsAXUoVxrUil0m13kOEq4mkX4/4QozCqmY+HpGfKl74OYSn8JcMA8GnG0ClfdRI4/ZSeG7zhFaVg+wg==} engines: {node: '>=18.14.1'} peerDependencies: hono: ^4 @@ -6852,7 +6852,7 @@ snapshots: '@eslint/core': 0.10.0 levn: 0.4.1 - '@hono/[email protected]([email protected])': + '@hono/[email protected]([email protected])': dependencies: hono: 4.6.19
633c072a523183968b41c99a881442e3cbdfb3ec
2024-06-11 00:24:46
Lfish
feat(route): 优化少数派系列路由每篇文章的封面图片,增加了每日必应路由两个控制参数 (#15859)
false
优化少数派系列路由每篇文章的封面图片,增加了每日必应路由两个控制参数 (#15859)
feat
diff --git a/lib/routes/bing/daily-wallpaper.ts b/lib/routes/bing/daily-wallpaper.ts index 10b1460ac643f8..2a6a3d9072c9ff 100644 --- a/lib/routes/bing/daily-wallpaper.ts +++ b/lib/routes/bing/daily-wallpaper.ts @@ -4,38 +4,77 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; export const route: Route = { - path: '/', + path: '/:routeParams?', + parameters: { + routeParams: '额外参数type,story和lang:请参阅以下说明和表格', + }, radar: [ { - source: ['cn.bing.com/'], + source: ['www.bing.com/', 'cn.bing.com/'], target: '', }, ], name: '每日壁纸', - maintainers: ['FHYunCai'], + maintainers: ['FHYunCai', 'LLLLLFish'], handler, - url: 'cn.bing.com/', + url: 'www.bing.com/', + example: '/bing/type=UHD&story=1&lang=zh-CN', + description: `| 参数 | 含义 | 接受的值 | 默认值 | 备注 | +|-------|--------------------|-----------------------------------------------------------|-----------|--------------------------------------------------------| +| type | 输出壁纸的像素类型 | UHD/1920x1080/1920x1200/768x1366/1080x1920/1080x1920_logo | 1920x1080 | 1920x1200与1080x1920_logo带有水印,输入的值不在接受范围内都会输出成1920x1080 | +| story | 是否输出壁纸的故事 | 1/0 | 0 | 输入的值不为1都不会输出故事 | +| lang | 输出壁纸图文的地区(中文或者是英文) | zh/en | zh | zh/en输出的壁纸图文不一定是一样的;如果en不生效,试着部署到其他地方 | +`, }; async function handler(ctx) { - const response = await ofetch('HPImageArchive.aspx', { - baseURL: 'https://cn.bing.com', + const routeParams = new URLSearchParams(ctx.req.param('routeParams')); + let type = routeParams.get('type') || '1920x1080'; + let lang = routeParams.get('lang'); + let apiUrl = ''; + const allowedTypes = ['UHD', '1920x1080', '1920x1200', '768x1366', '1080x1920', '1080x1920_logo']; + if (lang !== 'zh' && lang !== 'en') { + lang = 'zh'; + } + if (lang === 'zh') { + lang = 'zh-CN'; + apiUrl = 'https://cn.bing.com'; + } else { + lang = 'en-US'; + apiUrl = 'https://www.bing.com'; + } + if (!allowedTypes.includes(type)) { + type = '1920x1080'; + } + const story = routeParams.get('story') === '1'; + const resp = await ofetch('/hp/api/model', { + baseURL: apiUrl, + method: 'GET', query: { - format: 'js', - idx: 0, - n: ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 7, - mkt: 'zh-CN', + mtk: lang, }, }); - const data = response; + const items = resp.MediaContents.map((item) => { + const ssd = item.Ssd; + const link = `${apiUrl}${item.ImageContent.Image.Url.match(/\/th\?id=[^_]+_[^_]+/)[0].replace(/(_\d+x\d+\.webp)$/i, '')}_${type}.jpg`; + let description = `<img src="${link}" alt="Article Cover Image" style="display: block; margin: 0 auto;"><br>`; + if (story) { + description += `<b>${item.ImageContent.Headline}</b>`; + description += `<i>${item.ImageContent.QuickFact.MainText}</i><br>`; + description += `<p>${item.ImageContent.Description}<p>`; + } + return { + title: item.ImageContent.Title, + description, + link: `${apiUrl}${item.ImageContent.BackstageUrl}`, + author: item.ImageContent.Copyright, + pubDate: timezone(parseDate(ssd, 'YYYYMMDD_HHmm'), 0), + }; + }); return { title: 'Bing每日壁纸', - link: 'https://cn.bing.com/', - item: data.images.map((item) => ({ - title: item.copyright, - description: `<img src="https://cn.bing.com${item.url}">`, - link: item.copyrightlink, - pubDate: timezone(parseDate(item.fullstartdate), 0), - })), + link: apiUrl, + description: 'Bing每日壁纸', + item: items, }; } diff --git a/lib/routes/sspai/author.ts b/lib/routes/sspai/author.ts index fced3b0cfee885..f9d3666b9a8d3d 100644 --- a/lib/routes/sspai/author.ts +++ b/lib/routes/sspai/author.ts @@ -61,7 +61,13 @@ async function handler(ctx) { const key = `sspai: ${item.id}`; return cache.tryGet(key, async () => { const response = await got(link); - description = response.data.data.body; + // description = response.data.data.body; + const articleData = response.data.data; + const banner = articleData.promote_image; + if (banner) { + description = `<img src="${banner}" alt="Article Cover Image" style="display: block; margin: 0 auto;"><br>`; + } + description += articleData.body; return { title: item.title.trim(), diff --git a/lib/routes/sspai/index.ts b/lib/routes/sspai/index.ts index ad27475f82f84f..6216d0011adeab 100644 --- a/lib/routes/sspai/index.ts +++ b/lib/routes/sspai/index.ts @@ -42,10 +42,7 @@ async function handler() { return cache.tryGet(key, async () => { const response = await got({ method: 'get', url: link }); const articleData = response.data.data; - let banner = articleData.banner; - if (articleData.keywords.includes('派早报')) { - banner = `https://cdnfile.sspai.com/${banner}`; - } + const banner = articleData.promote_image; if (banner) { description = `<img src="${banner}" alt="Article Cover Image" style="display: block; margin: 0 auto;"><br>`; } diff --git a/lib/routes/sspai/matrix.ts b/lib/routes/sspai/matrix.ts index 2ade91768fdb70..0adfd5c3f690f8 100644 --- a/lib/routes/sspai/matrix.ts +++ b/lib/routes/sspai/matrix.ts @@ -42,7 +42,13 @@ async function handler() { const key = `sspai: ${item.id}`; return cache.tryGet(key, async () => { const response = await got(link); - description = response.data.data.body; + // description = response.data.data.body; + const articleData = response.data.data; + const banner = articleData.promote_image; + if (banner) { + description = `<img src="${banner}" alt="Article Cover Image" style="display: block; margin: 0 auto;"><br>`; + } + description += articleData.body; return { title: item.title.trim(), diff --git a/lib/routes/sspai/tag.ts b/lib/routes/sspai/tag.ts index 5e4c40e7f93932..b56547b8f0696f 100644 --- a/lib/routes/sspai/tag.ts +++ b/lib/routes/sspai/tag.ts @@ -46,7 +46,13 @@ async function handler(ctx) { const key = `sspai: ${item.id}`; return cache.tryGet(key, async () => { const response = await got({ method: 'get', url: link, headers: { Referer: host } }); - description = response.data.data.body; + // description = response.data.data.body; + const articleData = response.data.data; + const banner = articleData.promote_image; + if (banner) { + description = `<img src="${banner}" alt="Article Cover Image" style="display: block; margin: 0 auto;"><br>`; + } + description += articleData.body; return { title: item.title.trim(), diff --git a/lib/routes/sspai/topic.ts b/lib/routes/sspai/topic.ts index 5ca450d5e35aa6..bb90ece1901a08 100644 --- a/lib/routes/sspai/topic.ts +++ b/lib/routes/sspai/topic.ts @@ -52,7 +52,13 @@ async function handler(ctx) { } return cache.tryGet(`sspai: ${item.id}`, async () => { const response = await got(link); - const description = response.data.data.body; + let description = ''; + const articleData = response.data.data; + const banner = articleData.promote_image; + if (banner) { + description = `<img src="${banner}" alt="Article Cover Image" style="display: block; margin: 0 auto;"><br>`; + } + description += articleData.body; const single = { title, diff --git a/lib/routes/sspai/topics.ts b/lib/routes/sspai/topics.ts index c23b96df72588a..90d7ecfd7db717 100644 --- a/lib/routes/sspai/topics.ts +++ b/lib/routes/sspai/topics.ts @@ -42,7 +42,7 @@ async function handler() { const key = `sspai:topics:${item.id}`; return cache.tryGet(key, () => { - description = `${item.intro}<br><img src="https://cdn.sspai.com/${item.banner}" /><br>如有兴趣,请复制链接订阅 <br> <h3>https://rsshub.app/sspai/topic/${item.id}</h3>`; + description = `<br><img src="https://cdnfile.sspai.com/${item.banner}" alt="Article Cover Image" style="display: block; margin: 0 auto;"/>${item.intro}<br>如有兴趣,请复制链接订阅 <br> <h3>https://rsshub.app/sspai/topic/${item.id}</h3>`; return { title: item.title.trim(),
7198b21b39f326d52ffbe7fe2b24786efcc145bf
2021-03-08 22:07:58
dependabot-preview[bot]
chore(deps): [security] bump elliptic from 6.5.3 to 6.5.4
false
[security] bump elliptic from 6.5.3 to 6.5.4
chore
diff --git a/yarn.lock b/yarn.lock index 6ca6a202200425..6add8c752fd075 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2894,10 +2894,10 @@ bluebird@^3.1.1, bluebird@^3.1.5, bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3. resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.9" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" - integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== [email protected]: version "1.19.0" @@ -2977,7 +2977,7 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brorand@^1.0.1: +brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= @@ -4781,17 +4781,17 @@ [email protected]: integrity sha1-nUNoLUS5GtFuvYQmisEDFwplU/g= elliptic@^6.0.0: - version "6.5.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" - integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" + bn.js "^4.11.9" + brorand "^1.1.0" hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" emailjs-addressparser@^2.0.2: version "2.0.2" @@ -6282,7 +6282,7 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -hmac-drbg@^1.0.0: +hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= @@ -8740,7 +8740,7 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: +minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
1b4b3c5c2841106dff2a53ba0a82ceb129714ef0
2022-02-09 18:27:08
dependabot[bot]
chore(deps): bump ioredis from 4.28.1 to 4.28.5 (#9018)
false
bump ioredis from 4.28.1 to 4.28.5 (#9018)
chore
diff --git a/package.json b/package.json index 6d15464ada3efb..44c2ee3de5b323 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "https-proxy-agent": "5.0.0", "iconv-lite": "0.6.3", "instagram-private-api": "1.45.2", - "ioredis": "4.28.1", + "ioredis": "4.28.5", "ip": "*", "ip-regex": "4.3.0", "is-localhost-ip": "1.4.0", diff --git a/yarn.lock b/yarn.lock index ddcaa934b909b8..1217c87a3fa6c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7108,10 +7108,10 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== [email protected]: - version "4.28.1" - resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.1.tgz#c2a7038d6a187e020d7045e11d6a677e8b51f785" - integrity sha512-7gcrUJEcPHWy+eEyq6wIZpXtfHt8crhbc5+z0sqrnHUkwBblXinygfamj+/jx83Qo+2LW3q87Nj2VsuH6BF2BA== [email protected]: + version "4.28.5" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.5.tgz#5c149e6a8d76a7f8fa8a504ffc85b7d5b6797f9f" + integrity sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A== dependencies: cluster-key-slot "^1.1.0" debug "^4.3.1"
8855bee45bb807558b16a06ba419c3fe366de8fb
2019-04-23 12:17:34
DIYgod
docs: mark bt and podcast routes
false
mark bt and podcast routes
docs
diff --git a/docs/.vuepress/components/Route.vue b/docs/.vuepress/components/Route.vue index dc8cfa15570165..75ddbcc91b7e5f 100644 --- a/docs/.vuepress/components/Route.vue +++ b/docs/.vuepress/components/Route.vue @@ -1,6 +1,6 @@ <template> <div class="routeBlock" :id="path"> - <h4 class="name">{{name}} <Badge text="反爬严格" type="warn" v-if="crawlerBadge"/> <Author :uid=author /> + <h4 class="name">{{name}} <Badge text="支持 BT" type="tip" v-if="supportBT"/> <Badge text="支持播客" type="tip" v-if="supportPodcast"/> <Author :uid=author /> <Badge text="反爬严格" type="warn" v-if="crawlerBadge"/> <a :href="'#'+path" aria-hidden="true" class="header-anchor">#</a> </h4> <p class="example"> @@ -48,6 +48,14 @@ export default { crawlerBadge: { type: String, default: null + }, + supportBT: { + type: String, + default: null + }, + supportPodcast: { + type: String, + default: null } }, methods: { @@ -67,4 +75,7 @@ li.params p { .routeBlock { margin: 1rem 0 2rem; } +#app .page .badge.tip { + background-color: #FFD6A6; +} </style> diff --git a/docs/multimedia.md b/docs/multimedia.md index c208928a069bd2..093cf1578ca934 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -20,7 +20,7 @@ <Route name="歌手专辑" author="metowolf" example="/ncm/artist/2116" path="/ncm/artist/:id" :paramsDesc="[' 歌手 id, 可在歌手详情页 URL 中找到']"/> -<Route name="电台节目" author="magic-akari" example="/ncm/djradio/347317067" path="/ncm/djradio/:id" :paramsDesc="['节目 id, 可在电台节目页 URL 中找到']"/> +<Route name="电台节目" author="magic-akari" example="/ncm/djradio/347317067" path="/ncm/djradio/:id" :paramsDesc="['节目 id, 可在电台节目页 URL 中找到']"/ supportPodcast="1"> ## 爱奇艺 @@ -32,7 +32,7 @@ ## 喜马拉雅 -<Route name="专辑(支持泛用型播客订阅)" author="lengthmin jjeejj" example="/ximalaya/album/299146" path="/ximalaya/album/:id/:all?" :paramsDesc="['专辑 id, 可在对应专辑页面的 URL 中找到','是否需要获取全部节目,默认不获取,填入该字段则视为获取']"> +<Route name="专辑" author="lengthmin jjeejj" example="/ximalaya/album/299146" path="/ximalaya/album/:id/:all?" :paramsDesc="['专辑 id, 可在对应专辑页面的 URL 中找到','是否需要获取全部节目,默认不获取,填入该字段则视为获取']" supportPodcast="1"> ::: warning 注意 专辑 id 是跟在**分类拼音**后的那个 id, 不要输成某集的 id 了 @@ -108,7 +108,7 @@ ## 电影天堂 -<Route name="新片精品" author="imgss" example="/dytt" path="/dytt"/> +<Route name="新片精品" author="imgss" example="/dytt" path="/dytt" supportBT="1"/> ## rs05 人生 05 电影 @@ -137,7 +137,7 @@ ::: -<Route name="影视" author="DIYgod" example="/zimuzu/resource/37031" path="/zimuzu/resource/:id?" :paramsDesc="['影视 id,对应影视的 URL 中找到,为空时输出最近更新']"/> +<Route name="影视" author="DIYgod" example="/zimuzu/resource/37031" path="/zimuzu/resource/:id?" :paramsDesc="['影视 id,对应影视的 URL 中找到,为空时输出最近更新']" supportBT="1"/> ## Sankaku Complex @@ -188,7 +188,7 @@ | ------ | ------ | ------ | ------ | ------ | ------ | | 剧情片 | 战争片 | 国产剧 | 港台剧 | 日韩剧 | 欧美剧 | -<Route name="资源" author="SettingDust" example="/mp4ba/1" path="/mp4ba/:param" :paramsDesc="['类型/关键字']"/> +<Route name="资源" author="SettingDust" example="/mp4ba/1" path="/mp4ba/:param" :paramsDesc="['类型/关键字']" supportBT="1"/> ## 中国高清网 diff --git a/docs/other.md b/docs/other.md index 1031bfbeb0b49d..a55555cd273d79 100644 --- a/docs/other.md +++ b/docs/other.md @@ -420,7 +420,7 @@ type 为 all 时,category 参数不支持 cost 和 free ## 播客 IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ -<Route name="IBC岩手放送|IBCラジオ イヤーマイッタマイッタ" author="fengkx" example="/maitta" path="/maitta" /> +<Route name="IBC岩手放送|IBCラジオ イヤーマイッタマイッタ" author="fengkx" example="/maitta" path="/maitta" supportPodcast="1" /> ## 博客: 敬维
1d7b470fa97619c33c436611bc893c7b538a15ad
2025-01-14 20:55:17
cnk
fix(routes/hrbust/jwzx): fix img was accidently removed (#18122)
false
fix img was accidently removed (#18122)
fix
diff --git a/lib/routes/hrbust/jwzx.ts b/lib/routes/hrbust/jwzx.ts index 971f88e5befc4a..233a2c7beb431b 100644 --- a/lib/routes/hrbust/jwzx.ts +++ b/lib/routes/hrbust/jwzx.ts @@ -76,7 +76,6 @@ async function handler(ctx) { const body = $('div.body'); body.find('[style]').removeAttr('style'); body.find('font').contents().unwrap(); - body.find(':empty').remove(); body.html(body.html()?.replaceAll('&nbsp;', '')); body.find('[align]').removeAttr('align'); item.description = body.html();
1d61677e761f6cfc2723609b7c496b80205acdda
2019-11-21 08:29:21
junbaor
feat: 添加饭否用户时间线、当前登录用户的时间线、用户收藏、热门话题、搜索 (#3427)
false
添加饭否用户时间线、当前登录用户的时间线、用户收藏、热门话题、搜索 (#3427)
feat
diff --git a/docs/install/README.md b/docs/install/README.md index 0700d7252a1006..85b3b7508beac9 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -425,3 +425,10 @@ RSSHub 支持 `memory` 和 `redis` 两种缓存方式 - `WEIBO_APP_KEY`: 微博 App Key - `WEIBO_APP_SECRET`: 微博 App Secret - `WEIBO_REDIRECT_URL`: 微博登录授权回调地址,默认为 `RSSHub地址/weibo/timeline/0`,自定义回调地址请确保最后可以转跳到 `RSSHub地址/weibo/timeline/0?code=xxx` + +- 饭否 全部路由: [申请地址](https://github.com/FanfouAPI/FanFouAPIDoc/wiki/Oauth) + + - `FANFOU_CONSUMER_KEY`: 饭否 Consumer Key + - `FANFOU_CONSUMER_SECRET`: 饭否 Consumer Secret + - `FANFOU_USERNAME`: 饭否登录用户名、邮箱、手机号 + - `FANFOU_PASSWORD`: 饭否密码 diff --git a/docs/social-media.md b/docs/social-media.md index 67fba73cab8b24..43ffda8fd4b541 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -510,6 +510,32 @@ pageClass: routes <Route author="xyqfer" example="/douyin/like/93610979153" path="/douyin/like/:id" :paramsDesc="['用户 id, 可在 分享出去获得的用户主页 URL 中找到']"/> +## 饭否 + +::: warning 注意 +部署时需要申请并配置饭否 Consumer Key、Consumer Secret、用户名和密码,具体见部署文档 +::: + +### 用户动态 + +<Route author="junbaor" example="/fanfou/user_timeline/wangxing" path="/fanfou/user_timeline/:uid" :paramsDesc="['用户的uid']" anticrawler="1"/> + +### 当前登录用户的时间线 + +<Route author="junbaor" example="/fanfou/home_timeline" path="/fanfou/home_timeline" anticrawler="1"/> + +### 用户收藏 + +<Route author="junbaor" example="/fanfou/favorites/wangxing" path="/fanfou/favorites/:uid" :paramsDesc="['用户的uid']" anticrawler="1"/> + +### 热门话题 + +<Route author="junbaor" example="/fanfou/trends" path="/fanfou/trends" anticrawler="1"/> + +### 饭否搜索 + +<Route author="junbaor" example="/fanfou/public_timeline/冬天" path="/fanfou/public_timeline/:keyword" :paramsDesc="['关键字']" anticrawler="1"/> + ## 方格子 ### 出版專題 diff --git a/lib/config.js b/lib/config.js index f5302a62053f01..a1f39b6423ad38 100644 --- a/lib/config.js +++ b/lib/config.js @@ -100,6 +100,12 @@ const calculateValue = () => { app_secret: envs.WEIBO_APP_SECRET, redirect_url: envs.WEIBO_REDIRECT_URL, }, + fanfou: { + consumer_key: envs.FANFOU_CONSUMER_KEY, + consumer_secret: envs.FANFOU_CONSUMER_SECRET, + username: envs.FANFOU_USERNAME, + password: envs.FANFOU_PASSWORD, + }, }; }; calculateValue(); diff --git a/lib/router.js b/lib/router.js index 542632b4a93f6a..53443f5997530f 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1953,4 +1953,11 @@ router.get('/alter-cn/news', require('./routes/alter-cn/news')); // Visual Studio Code Marketplace router.get('/vscode/marketplace/:type?', require('./routes/vscode/marketplace')); +// 饭否 +router.get('/fanfou/user_timeline/:uid', require('./routes/fanfou/user_timeline')); +router.get('/fanfou/home_timeline', require('./routes/fanfou/home_timeline')); +router.get('/fanfou/favorites/:uid', require('./routes/fanfou/favorites')); +router.get('/fanfou/trends', require('./routes/fanfou/trends')); +router.get('/fanfou/public_timeline/:keyword', require('./routes/fanfou/public_timeline')); + module.exports = router; diff --git a/lib/routes/fanfou/favorites.js b/lib/routes/fanfou/favorites.js new file mode 100644 index 00000000000000..49161c63f9f5f7 --- /dev/null +++ b/lib/routes/fanfou/favorites.js @@ -0,0 +1,39 @@ +const config = require('@/config').value; +const utils = require('./utils'); + +module.exports = async (ctx) => { + if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { + throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>'; + } + + const uid = ctx.params.uid; + const fanfou = await utils.getFanfou(); + const timeline = await fanfou.get(`/favorites/${uid}`, { id: uid, mode: 'lite', format: 'html' }); + + const result = await Promise.all( + timeline.map(async (item) => { + let img_html = ''; + if (item.photo) { + img_html = `<br/><img src="${item.photo.largeurl}" alt="饭否动态图片"/>`; + } + const voItem = { + title: item.text, + author: item.user.name, + description: item.text + img_html, + pubDate: item.created_at, + link: `https://fanfou.com/statuses/${item.id}`, + }; + return Promise.resolve(voItem); + }) + ); + + const users = await fanfou.get(`/users/show`, { id: uid }); + const authorName = users.screen_name; + + ctx.state.data = { + title: `${authorName}的饭否收藏`, + link: `https://fanfou.com/favorites/${uid}`, + description: `${authorName}的饭否收藏`, + item: result, + }; +}; diff --git a/lib/routes/fanfou/home_timeline.js b/lib/routes/fanfou/home_timeline.js new file mode 100644 index 00000000000000..9ff4b7b8ae41cf --- /dev/null +++ b/lib/routes/fanfou/home_timeline.js @@ -0,0 +1,35 @@ +const config = require('@/config').value; +const utils = require('./utils'); + +module.exports = async (ctx) => { + if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { + throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>'; + } + + const fanfou = await utils.getFanfou(); + const timeline = await fanfou.get('/statuses/home_timeline', { mode: 'lite', format: 'html' }); + + const result = await Promise.all( + timeline.map(async (item) => { + let img_html = ''; + if (item.photo) { + img_html = `<br/><img src="${item.photo.originurl}" alt="饭否动态图片"/>`; + } + const voItem = { + title: item.plain_text, + author: item.user.name, + description: item.text + img_html, + pubDate: item.created_at, + link: `http://fanfou.com/statuses/${item.id}`, + }; + return Promise.resolve(voItem); + }) + ); + + ctx.state.data = { + title: `我的饭否动态`, + link: `https://fanfou.com/home`, + description: `我的饭否动态`, + item: result, + }; +}; diff --git a/lib/routes/fanfou/public_timeline.js b/lib/routes/fanfou/public_timeline.js new file mode 100644 index 00000000000000..e04f649c166d98 --- /dev/null +++ b/lib/routes/fanfou/public_timeline.js @@ -0,0 +1,36 @@ +const config = require('@/config').value; +const utils = require('./utils'); + +module.exports = async (ctx) => { + if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { + throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>'; + } + + const keyword = ctx.params.keyword; + const fanfou = await utils.getFanfou(); + const timeline = await fanfou.get('/search/public_timeline', { q: keyword, mode: 'lite', format: 'html' }); + + const result = await Promise.all( + timeline.map(async (item) => { + let img_html = ''; + if (item.photo) { + img_html = `<br/><img src="${item.photo.originurl}" alt="饭否动态图片"/>`; + } + const voItem = { + title: item.plain_text, + author: item.user.name, + description: item.text + img_html, + pubDate: item.created_at, + link: `https://fanfou.com/statuses/${item.id}`, + }; + return Promise.resolve(voItem); + }) + ); + + ctx.state.data = { + title: `饭否搜索-${keyword}`, + link: `https://fanfou.com/q/${keyword}`, + description: `饭否搜索-${keyword}`, + item: result, + }; +}; diff --git a/lib/routes/fanfou/trends.js b/lib/routes/fanfou/trends.js new file mode 100644 index 00000000000000..68f63429454367 --- /dev/null +++ b/lib/routes/fanfou/trends.js @@ -0,0 +1,25 @@ +const utils = require('./utils'); + +module.exports = async (ctx) => { + const fanfou = await utils.getFanfou(); + const response = await fanfou.get(`/trends/list`); + + const result = await Promise.all( + response.trends.map(async (item) => { + const voItem = { + title: item.name, + description: item.name, + pubDate: new Date(), + link: item.url, + }; + return Promise.resolve(voItem); + }) + ); + + ctx.state.data = { + title: `饭否热门话题`, + link: `https://fanfou.com/q/`, + description: `饭否热门话题`, + item: result, + }; +}; diff --git a/lib/routes/fanfou/user_timeline.js b/lib/routes/fanfou/user_timeline.js new file mode 100644 index 00000000000000..f28260959f08c6 --- /dev/null +++ b/lib/routes/fanfou/user_timeline.js @@ -0,0 +1,38 @@ +const config = require('@/config').value; +const utils = require('./utils'); + +module.exports = async (ctx) => { + if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { + throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>'; + } + + const uid = ctx.params.uid; + const fanfou = await utils.getFanfou(); + const timeline = await fanfou.get('/statuses/user_timeline', { id: uid, mode: 'lite', format: 'html' }); + + const result = await Promise.all( + timeline.map(async (item) => { + let img_html = ''; + if (item.photo) { + img_html = `<br/><img src="${item.photo.originurl}" alt="饭否动态图片"/>`; + } + const voItem = { + title: item.plain_text, + author: item.user.name, + description: item.text + img_html, + pubDate: item.created_at, + link: `https://fanfou.com/statuses/${item.id}`, + }; + return Promise.resolve(voItem); + }) + ); + + const authorName = result[0].author; + + ctx.state.data = { + title: `${authorName}的饭否`, + link: `https://fanfou.com/${uid}`, + description: `${authorName}的饭否`, + item: result, + }; +}; diff --git a/lib/routes/fanfou/utils.js b/lib/routes/fanfou/utils.js new file mode 100644 index 00000000000000..a1353e385a12ad --- /dev/null +++ b/lib/routes/fanfou/utils.js @@ -0,0 +1,34 @@ +const logger = require('@/utils/logger'); +const config = require('@/config').value; +const Fanfou = require('fanfou-sdk'); + +const consumerKey = config.fanfou.consumer_key; +const consumerSecret = config.fanfou.consumer_secret; +const username = config.fanfou.username; +const password = config.fanfou.password; + +let fanfou_client; +let authed = false; + +const getFanfou = async () => { + if (authed === true) { + return fanfou_client; + } else { + fanfou_client = new Fanfou({ + consumerKey, + consumerSecret, + username, + password, + }); + + await fanfou_client.xauth(); + logger.info('Fanfou login success.'); + + authed = true; + return fanfou_client; + } +}; + +module.exports = { + getFanfou, +}; diff --git a/package.json b/package.json index 5b8cef5470250b..a7d366b8102f7a 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "dotenv": "8.2.0", "emailjs-imap-client": "3.0.7", "etag": "1.8.1", + "fanfou-sdk": "4.0.5", "form-data": "3.0.0", "git-rev-sync": "1.12.0", "googleapis": "45.0.0", diff --git a/yarn.lock b/yarn.lock index cafbdb6eda77a6..b57acade2090b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4458,6 +4458,18 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= [email protected]: + version "4.0.5" + resolved "https://registry.yarnpkg.com/fanfou-sdk/-/fanfou-sdk-4.0.5.tgz#5b3f2ab5ee8a383fc21ab58bc6c1ed97cbce7113" + integrity sha512-s3Ec5D3Am5daLQtu9IwkVWPSV40Tg//jPJVAYbLVMITLvCgq58H2ufJ5bgfsQAJrQXVL0ZhkN+mwhgp/4BJzXA== + dependencies: + form-data "^2.3.3" + got "^9.5.1" + he "^1.1.1" + hmacsha1 "^1.0.0" + oauth-1.0a "^2.2.5" + query-string "^6.2.0" + fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" @@ -4682,7 +4694,7 @@ [email protected]: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^2.3.1, form-data@^2.5.0: +form-data@^2.3.1, form-data@^2.3.3, form-data@^2.5.0: version "2.5.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== @@ -5046,7 +5058,7 @@ [email protected]: google-auth-library "^5.2.0" googleapis-common "^3.1.0" [email protected]: [email protected], got@^9.5.1: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== @@ -5225,7 +5237,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" [email protected], [email protected], he@^1.1.0, he@^1.2.0: [email protected], [email protected], he@^1.1.0, he@^1.1.1, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -5249,6 +5261,11 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +hmacsha1@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hmacsha1/-/hmacsha1-1.0.0.tgz#c1b7ae03a4ea116348090af14f8148c12938a917" + integrity sha1-wbeuA6TqEWNICQrxT4FIwSk4qRc= + hogan.js@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd" @@ -7871,6 +7888,11 @@ nwsapi@^2.0.7, nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== +oauth-1.0a@^2.2.5: + version "2.2.6" + resolved "https://registry.yarnpkg.com/oauth-1.0a/-/oauth-1.0a-2.2.6.tgz#eadbccdb3bceea412d24586e6f39b2b412f0e491" + integrity sha512-6bkxv3N4Gu5lty4viIcIAnq5GbxECviMBeKR3WX/q87SPQ8E8aursPZUtsXDnxCs787af09WPRBLqYrf/lwoYQ== + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -9039,7 +9061,7 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== [email protected]: [email protected], query-string@^6.2.0: version "6.9.0" resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.9.0.tgz#1c3b727c370cf00f177c99f328fda2108f8fa3dd" integrity sha512-KG4bhCFYapExLsUHrFt+kQVEegF2agm4cpF/VNc6pZVthIfCc/GK8t8VyNIE3nyXG9DK3Tf2EGkxjR6/uRdYsA==
c8afd2088f40544c602b6648205d2039e37c9ab0
2020-02-07 00:59:59
junfengP
fix: missing item in javlibrary/:uid/userposts (#3904)
false
missing item in javlibrary/:uid/userposts (#3904)
fix
diff --git a/lib/routes/javlibrary/userposts.js b/lib/routes/javlibrary/userposts.js index 046f85ca25293e..06a00c4c667e83 100644 --- a/lib/routes/javlibrary/userposts.js +++ b/lib/routes/javlibrary/userposts.js @@ -7,7 +7,7 @@ module.exports = async (ctx) => { const link = `http://www.javlibrary.com/cn/userposts.php?u=${uid}`; const response = await cloudscraper.get(link); const $ = cheerio.load(response); - const list = $('div#rightcolumn table.comment'); + const list = $('#video_comments > table'); ctx.state.data = { title: `Javlibrary - ${uid} 发表的文章`, @@ -18,15 +18,17 @@ module.exports = async (ctx) => { .map((index, item) => { item = $(item); // 文章内容只能抓取到 td.t textarea,若含有图片则替换[img]image-link[/img] => <img src="image-link" /> - let comments = item.find('td.t textarea').text(); + let comments = item.find('textarea').text(); comments = comments.replace(new RegExp('\\[img\\]', 'g'), '<img src="').replace(new RegExp('\\[\\/img\\]', 'g'), '" />'); return { - title: item.find('td > strong').text(), - link: item.find('td > strong > a').attr('href'), - description: `<table>${item.find('table.videoinfo').html()}</table> - <p>${comments}</p>`, - pubDate: dateUtil(item.find('td.date')), - guid: item.find('td > strong > a').attr('href'), + title: item.find('tbody > tr:nth-child(1) > td:nth-child(2)').text(), + link: item.find('tbody > tr:nth-child(1) > td:nth-child(2) > a').attr('href'), + description: ` + <table><tbody> + <tr><td>${item.find('tbody > tr:nth-child(1) > td:nth-child(2)').html()}</td></tr> + <tr><td>${comments}</td></tr> + </tbody></table>`, + pubDate: dateUtil(item.find('tbody > tr:nth-child(3) > td.date')), }; }) .get(),
144296f1f46cc390fc90be181d12e3d74315dca3
2018-08-31 13:08:08
DIYgod
fix: twitter user url
false
twitter user url
fix
diff --git a/routes/twitter/user.js b/routes/twitter/user.js index ac380e80ea7bd2..1049ac4c9cde04 100644 --- a/routes/twitter/user.js +++ b/routes/twitter/user.js @@ -19,14 +19,19 @@ module.exports = async (ctx) => { description: data[0].user.description, item: data.map((item) => { item = item.retweeted_status || item; + item.full_text = item.full_text.replace(/https:\/\/t\.co(.*)$/, ''); let img = ''; item.extended_entities && item.extended_entities.media.forEach((item) => { img += `<br>${item.type === 'video' ? 'Video: ' : ''}<img referrerpolicy="no-referrer" src="${item.media_url_https}">`; }); + let url = ''; + item.entities.urls.forEach((u) => { + url += `<a href="${u.expanded_url}" target="_blank"></a>`; + }); return { title: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.full_text.length > 30 ? item.full_text.slice(0, 30) + '...' : item.full_text}`, - description: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.full_text}${img}`, + description: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.full_text}${url}${img}`, pubDate: new Date(item.created_at).toUTCString(), link: `https://twitter.com/${id}/status/${item.id_str}`, };
982268b42be5c0e133386373ad13ca1ba51bd928
2019-07-24 09:29:25
Kiokh
feat: Rss feed for Final Fantasy XIV (CN) (#2678)
false
Rss feed for Final Fantasy XIV (CN) (#2678)
feat
diff --git a/docs/game.md b/docs/game.md index 6fc6ca7f694f14..695fb5c6869aee 100644 --- a/docs/game.md +++ b/docs/game.md @@ -265,6 +265,16 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 <Route author="alizeegod" example="/lolapp/recommend" path="/lolapp/recommend"/> +## 最终幻想 14 + +### 最终幻想 14 国服 + +<Route author="Kiotlin" example="/ff14/ff14_zh/news" path="/ff14/ff14_zh/:type" :paramsDesc="['分类名']"/> + +| 新闻 | 公告 | 活动 | 广告 | 所有 | +| ---- | -------- | ------ | --------- | ---- | +| news | announce | events | advertise | all | + ## きららファンタジア|奇拉拉幻想曲 ### 公告 diff --git a/lib/router.js b/lib/router.js index 42ebc8742520de..b89cbddee75ff6 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1538,6 +1538,9 @@ router.get('/afdian/dynamic/:uid', require('./routes/afdian/dynamic')); // 《明日方舟》游戏 router.get('/arknights/news', require('./routes/arknights/news')); +// ff14 +router.get('/ff14/ff14_zh/:type', require('./routes/ff14/ff14_zh')); + // 学堂在线 router.get('/xuetangx/course/:cid/:type', require('./routes/xuetangx/course_info')); router.get('/xuetangx/course/list/:mode/:credential/:status/:type?', require('./routes/xuetangx/course_list')); diff --git a/lib/routes/ff14/ff14_zh.js b/lib/routes/ff14/ff14_zh.js new file mode 100644 index 00000000000000..919ccf29a15156 --- /dev/null +++ b/lib/routes/ff14/ff14_zh.js @@ -0,0 +1,38 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const referer = 'http://ff.sdo.com/web8/index.html'; + const type = ctx.params.type; + + const type_number = { + news: '5310', + announce: '5312', + events: '5311', + advertise: '5313', + all: '5310,5312,5311,5313,5309', + }; + + const response = await got({ + method: 'get', + url: `http://api.act.sdo.com/UnionNews/List?gameCode=ma&category=${type_number[type]}&pageIndex=0&pageSize=50`, + headers: { + Referer: referer, + }, + }); + + const data = response.data.Data; + + ctx.state.data = { + title: '最终幻想14(国服)新闻中心', + link: referer + '#/newstab/newslist', + description: '《最终幻想14》是史克威尔艾尼克斯出品的全球经典游戏品牌FINAL FANTASY系列的最新作品,IGN获得9.2高分!全球累计用户突破1600万!', + item: data.map(({ Title, Summary, Author, PublishDate, HomeImagePath }) => ({ + title: Title, + link: Author, + description: ` + <img referrerpolicy="no-referrer" src="${HomeImagePath}"><br> + ${Summary}<br> + ${PublishDate}`, + })), + }; +};
05fe33293bf8c436b42c59c1559a63412ed571a4
2024-05-11 23:51:07
CaoMeiYouRen
fix(route): 修复 pixiv 排行榜/关注 路由缺失 简介的问题 (#15559)
false
修复 pixiv 排行榜/关注 路由缺失 简介的问题 (#15559)
fix
diff --git a/lib/routes/pixiv/illustfollow.ts b/lib/routes/pixiv/illustfollow.ts index 4fb4e6dc7a2855..ce32b04c4981b7 100644 --- a/lib/routes/pixiv/illustfollow.ts +++ b/lib/routes/pixiv/illustfollow.ts @@ -61,8 +61,9 @@ async function handler() { title: illust.title, author: illust.user.name, pubDate: parseDate(illust.create_date), - description: `<p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p>${images.join('')}`, + description: `${illust.caption}<br><p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p>${images.join('')}`, link: `https://www.pixiv.net/artworks/${illust.id}`, + category: illust.tags.map((tag) => tag.name), }; }), }; diff --git a/lib/routes/pixiv/ranking.ts b/lib/routes/pixiv/ranking.ts index a1fd17eb8242ba..2b231df377e318 100644 --- a/lib/routes/pixiv/ranking.ts +++ b/lib/routes/pixiv/ranking.ts @@ -111,7 +111,7 @@ async function handler(ctx) { return { title: `#${index + 1} ${illust.title}`, pubDate: parseDate(illust.create_date), - description: `<p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p><br>${images.join('')}`, + description: `${illust.caption}<br><p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p><br>${images.join('')}`, link: `https://www.pixiv.net/artworks/${illust.id}`, author: illust.user.name, category: illust.tags.map((tag) => tag.name),
95c1290e2d77bd7b6aca1e238c992b402f6b5222
2019-06-13 13:18:38
DIYgod
refactor: format
false
format
refactor
diff --git a/docs/other.md b/docs/other.md index d463418932a2c3..956fd14e838be4 100644 --- a/docs/other.md +++ b/docs/other.md @@ -16,12 +16,6 @@ pageClass: routes <Route author="xyqfer" example="/36kr/search/article/8%E7%82%B91%E6%B0%AA" path="/36kr/search/article/:keyword" :paramsDesc="['关键字']" /> -## 汇通网 - -### 7x24 小时快讯 - -<Route author="occupy5" example="/fx678/kx" path="/fx678/kx" /> - ## 99% Invisible ### Transcript @@ -476,6 +470,12 @@ type 为 all 时,category 参数不支持 cost 和 free <Route author="HenryQW" example="/huxiu/author/29318" path="/huxiu/author/:id" :paramsDesc="['用户 id']" /> +## 汇通网 + +### 7x24 小时快讯 + +<Route author="occupy5" example="/fx678/kx" path="/fx678/kx" /> + ## 惠誉评级 ### 板块信息
9706affa70bb8aae8a56b2453f0070498ed24f22
2021-01-12 07:21:33
NeverBehave
docs: bilibili cookie name
false
bilibili cookie name
docs
diff --git a/docs/install/README.md b/docs/install/README.md index 7df0eb514d5973..87af9dcc158db3 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -520,7 +520,7 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 - `BILIBILI_COOKIE_{uid}`: 对应 uid 的 b 站用户登录后的 Cookie 值,`{uid}` 替换为 uid,如 `BILIBILI_COOKIE_2267573`,获取方式: 1. 打开 <https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=0&type=8> 2. 打开控制台,切换到 Network 面板,刷新 - 3. 点击 dynamic_new 请求,找到 Cookie + 3. 点击 dynamic_new 请求,找到 Cookie。(Key:`SESSDATA`) - 语雀 全部路由:[注册地址](https://www.yuque.com/register)
b56792ea3cbe7a9caec74e5e9206a4db723c73ca
2024-03-19 14:34:34
dependabot[bot]
chore(deps-dev): bump eslint-plugin-yml from 1.13.0 to 1.13.1 (#14850)
false
bump eslint-plugin-yml from 1.13.0 to 1.13.1 (#14850)
chore
diff --git a/package.json b/package.json index dceb4ac2d2d756..19ee3913e2faa5 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "eslint-plugin-n": "16.6.2", "eslint-plugin-prettier": "5.1.3", "eslint-plugin-unicorn": "51.0.1", - "eslint-plugin-yml": "1.13.0", + "eslint-plugin-yml": "1.13.1", "fs-extra": "11.2.0", "husky": "9.0.11", "lint-staged": "15.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d3a4235034287d..5a25d198642345 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -320,8 +320,8 @@ devDependencies: specifier: 51.0.1 version: 51.0.1([email protected]) eslint-plugin-yml: - specifier: 1.13.0 - version: 1.13.0([email protected]) + specifier: 1.13.1 + version: 1.13.1([email protected]) fs-extra: specifier: 11.2.0 version: 11.2.0 @@ -4570,8 +4570,8 @@ packages: - supports-color dev: true - /[email protected]([email protected]): - resolution: {integrity: sha512-B87P32E8ugeeUnFxZvPsn72TyeZauA5ZXe6XmWDf0CKwN+9iLaepi6matyvikMWZf1ZeH9xdKggxQvQzLXlfzw==} + /[email protected]([email protected]): + resolution: {integrity: sha512-J1gNca5cWUIlo6ilQJBlPwap2ggVuc7gaOxiCdYjmncyWN8aNHErEhk2ICFj6shr8Jz27c3AU1Ie7i6HqVa4Hw==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0'
5c17b8512de7ab81e83b67f7e645fff4bed5a769
2025-03-25 17:30:07
KazooTTT
feat(asianfanfics): 添加文章描述信息 (#18686)
false
添加文章描述信息 (#18686)
feat
diff --git a/lib/routes/asianfanfics/tag.ts b/lib/routes/asianfanfics/tag.ts index 64486f2643210f..e83463092829d1 100644 --- a/lib/routes/asianfanfics/tag.ts +++ b/lib/routes/asianfanfics/tag.ts @@ -72,12 +72,14 @@ async function handler(ctx) { const link = 'https://www.asianfanfics.com' + $element.find('.excerpt__title a').attr('href'); const author = $element.find('.excerpt__meta__name a').text().trim(); const pubDate = parseDate($element.find('time').attr('datetime') || ''); + const description = $element.find('.excerpt__text').html(); return { title, link, author, pubDate, + description, }; }); diff --git a/lib/routes/asianfanfics/text-search.ts b/lib/routes/asianfanfics/text-search.ts index 56f7b2dd5dc608..d6b8fb0041a7f7 100644 --- a/lib/routes/asianfanfics/text-search.ts +++ b/lib/routes/asianfanfics/text-search.ts @@ -51,12 +51,14 @@ async function handler(ctx) { const link = 'https://www.asianfanfics.com' + $element.find('.excerpt__title a').attr('href'); const author = $element.find('.excerpt__meta__name a').text().trim(); const pubDate = parseDate($element.find('time').attr('datetime') || ''); + const description = $element.find('.excerpt__text').html(); return { title, link, author, pubDate, + description, }; });
a54608cba273284d45b0bf5a9482acc4cbce2706
2020-02-02 13:06:03
DIYgod
fix: /coronavirus/qq/fact
false
/coronavirus/qq/fact
fix
diff --git a/lib/router.js b/lib/router.js index 0f3c0fefc938d8..1b2f3b141ef49d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2162,7 +2162,7 @@ router.get('/coronavirus/dxy', require('./routes/coronavirus/dxy')); router.get('/coronavirus/scmp', require('./routes/coronavirus/scmp')); router.get('/coronavirus/nhc', require('./routes/coronavirus/nhc')); router.get('/coronavirus/mogov-2019ncov/:lang', require('./routes/coronavirus/mogov-2019ncov')); -router.get('/coronavirus/qq/fact', require('./routes/coronavirus/qq-fact')); +router.get('/coronavirus/qq/fact', require('./routes/tencent/factcheck')); // 南京林业大学教务处 router.get('/njfu/jwc/:category?', require('./routes/universities/njfu/jwc')); diff --git a/lib/routes/coronavirus/qq-fact.js b/lib/routes/coronavirus/qq-fact.js deleted file mode 100644 index dca2e7f8609372..00000000000000 --- a/lib/routes/coronavirus/qq-fact.js +++ /dev/null @@ -1,42 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'https://vp.fact.qq.com/loadmore?artnum=0&page=0', - headers: { - Referer: 'https://vp.fact.qq.com/home', - }, - }); - - const data = response.data.content; - - const items = await Promise.all( - (data || []).map(async (item) => { - const link = `https://vp.fact.qq.com/article?id=${item.id}`; - const simple = { - title: `【${item.explain}】${item.title}`, - description: `<img src="${item.cover}">${item.abstract}`, - pubDate: new Date(item.date).toUTCString(), - author: item.author, - link: link, - }; - - const details = await ctx.cache.tryGet(link, async () => { - const response = await got.get(link); - const $ = cheerio.load(response.data); - return { - description: `<img src="${item.cover}">${$('.check_content_points').html()}`, - }; - }); - return Promise.resolve(Object.assign({}, simple, details)); - }) - ); - - ctx.state.data = { - title: '新型冠状病毒肺炎实时辟谣-腾讯新闻', - link: 'https://vp.fact.qq.com/home', - item: items, - }; -}; diff --git a/lib/routes/tencent/factcheck/index.js b/lib/routes/tencent/factcheck/index.js index 7ecbf620ac67f6..2fc7ff19025f6a 100644 --- a/lib/routes/tencent/factcheck/index.js +++ b/lib/routes/tencent/factcheck/index.js @@ -2,61 +2,41 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const url = 'https://vp.fact.qq.com/loadmore?artnum=0&page=0&callback='; - - const list_res = await got.get(url); - const list = list_res.data.content; - - const parseContent = (htmlString) => { - const $ = cheerio.load(htmlString); - let content = cheerio.load('<div></div>'); - content = content('div'); - $('.subtitle.text').appendTo(content); - $('.check_content.text').appendTo(content); - $('.information').appendTo(content); - content.find('.point_num').remove(); - content.find('.check_content_bottom').remove(); - content.find('li').removeAttr('style'); - return { - description: content.html(), - }; - }; - - const out = await Promise.all( - list.map(async (item) => { - const title = `${item.result}/${item.explain} - ${item.title}`; + const response = await got({ + method: 'get', + url: 'https://vp.fact.qq.com/loadmore?artnum=0&page=0', + headers: { + Referer: 'https://vp.fact.qq.com/home', + }, + }); + + const data = response.data.content; + + const items = await Promise.all( + (data || []).map(async (item) => { const link = `https://vp.fact.qq.com/article?id=${item.id}`; - - const cache = await ctx.cache.get(link); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - const rssitem = { - title: title, - link: link, + const simple = { + title: `【${item.explain}】${item.title}`, + description: `<img src="${item.cover}">${item.abstract}`, + pubDate: new Date(item.date).toUTCString(), author: item.author, - pubDate: new Date(item.date), + link: link, }; - try { + const details = await ctx.cache.tryGet(link, async () => { const response = await got.get(link); - const result = parseContent(response.data); - if (!result.description) { - return Promise.resolve(''); - } - rssitem.description = result.description; - } catch (err) { - return Promise.resolve(''); - } - ctx.cache.set(link, JSON.stringify(rssitem)); - return Promise.resolve(rssitem); + const $ = cheerio.load(response.data); + return { + description: `<img src="${item.cover}">${$('.check_content_points').html()}`, + }; + }); + return Promise.resolve(Object.assign({}, simple, details)); }) ); ctx.state.data = { - title: '腾讯新闻较真查证平台', - link: 'https://vp.fact.qq.com/', - item: out.filter((item) => item !== ''), + title: '较真查证平台-腾讯新闻', + link: 'https://vp.fact.qq.com/home', + item: items, }; };
565321416921708c51362347ea7123136d65f922
2022-07-21 15:51:51
Ethan Shen
feat(route): add ImageMagick Changelog (#10265)
false
add ImageMagick Changelog (#10265)
feat
diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 721a2a12e89192..8bfa1a7b992db3 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -222,6 +222,12 @@ Language <RouteEn author="maokwen" example="/hugo/releases" path="/hugo/releases"/> +## ImageMagick + +### Changelog + +<RouteEn author="nczitzk" example="/imagemagick/changelog" path="/imagemagick/changelog"/> + ## IPSW.me ### Apple Firmware Update-IPSWs/OTAs version diff --git a/docs/program-update.md b/docs/program-update.md index 3578ce8f38f17d..f7db033a04ca8f 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -264,6 +264,12 @@ pageClass: routes <Route author="maokwen" example="/hugo/releases" path="/hugo/releases"/> +## ImageMagick + +### Changelog + +<Route author="nczitzk" example="/imagemagick/changelog" path="/imagemagick/changelog"/> + ## IPSW\.me ### 苹果固件更新 - IPSWs/OTAs 版本 diff --git a/lib/v2/imagemagick/changelog.js b/lib/v2/imagemagick/changelog.js new file mode 100644 index 00000000000000..b02cf550a8d26d --- /dev/null +++ b/lib/v2/imagemagick/changelog.js @@ -0,0 +1,46 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const md = require('markdown-it')({ + html: true, +}); + +module.exports = async (ctx) => { + const rootUrl = 'https://imagemagick.org'; + const currentUrl = `${rootUrl}/script/download.php`; + const logUrl = 'https://github.com/ImageMagick/Website/blob/main/ChangeLog.md'; + const rawLogUrl = 'https://raw.githubusercontent.com/ImageMagick/Website/main/ChangeLog.md'; + + const response = await got({ + method: 'get', + url: rawLogUrl, + }); + + const $ = cheerio.load(md.render(response.data)); + + const items = $('h2') + .toArray() + .map((item) => { + item = $(item); + + const title = item.text(); + + let description = ''; + item.nextUntil('h2').each(function () { + description += $(this).html(); + }); + + return { + title, + description, + link: `${logUrl}#${title.replace(/\s+/g, '-').replace(/\./g, '')}`, + pubDate: parseDate(title.match(/- (\d{4}-\d{2}-\d{2})/)[1]), + }; + }); + + ctx.state.data = { + title: 'ImageMagick - ChangeLog', + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/imagemagick/maintainer.js b/lib/v2/imagemagick/maintainer.js new file mode 100644 index 00000000000000..03dc2c65d4c758 --- /dev/null +++ b/lib/v2/imagemagick/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/changelog': ['nczitzk'], +}; diff --git a/lib/v2/imagemagick/radar.js b/lib/v2/imagemagick/radar.js new file mode 100644 index 00000000000000..5277a6ff4cd2eb --- /dev/null +++ b/lib/v2/imagemagick/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'imagemagick.org': { + _name: 'Changelog', + '.': [ + { + title: 'ChangeLog', + docs: 'https://docs.rsshub.app/program-update.html#imagemagick-changelog', + source: ['/script/download.php', '/script', '/'], + target: '/imagemagick/changelog', + }, + ], + }, +}; diff --git a/lib/v2/imagemagick/router.js b/lib/v2/imagemagick/router.js new file mode 100644 index 00000000000000..e2c06b65ec4ce5 --- /dev/null +++ b/lib/v2/imagemagick/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/changelog', require('./changelog')); +};
1d81a4a9ce8ebad75f53c0f6dfaec06a38dd2e90
2019-07-01 08:54:38
Cloud
feat: add wechat uread channel (#2515)
false
add wechat uread channel (#2515)
feat
diff --git a/docs/social-media.md b/docs/social-media.md index bcacf90a7993b4..cb141f7b5aa805 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -680,6 +680,10 @@ pageClass: routes ::: </Route> +### 公众号 (优读来源) + +<Route author="kt286" example="/wechat/uread/shensing" path="/wechat/uread/:userid" :paramsDesc="['公众号ID, 可在 优读APP 中找到']"/> + ### 公众平台系统公告栏目 <Route author="xyqfer" example="/wechat/announce" path="/wechat/announce" /> diff --git a/lib/router.js b/lib/router.js index 76552e897b7b29..85c0f9af874e8a 100644 --- a/lib/router.js +++ b/lib/router.js @@ -447,6 +447,7 @@ router.get('/wechat/csm/:id', require('./routes/tencent/wechat/csm')); router.get('/wechat/announce', require('./routes/tencent/wechat/announce')); router.get('/wechat/miniprogram/plugins', require('./routes/tencent/wechat/miniprogram/plugins')); router.get('/wechat/tgchannel/:id', require('./routes/tencent/wechat/tgchannel')); +router.get('/wechat/uread/:userid', require('./routes/tencent/wechat/uread')); // All the Flight Deals router.get('/atfd/:locations/:nearby?', require('./routes/atfd/index')); diff --git a/lib/routes/tencent/wechat/uread.js b/lib/routes/tencent/wechat/uread.js new file mode 100644 index 00000000000000..8283342ebe348c --- /dev/null +++ b/lib/routes/tencent/wechat/uread.js @@ -0,0 +1,51 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const userid = ctx.params.userid; + const url = `http://119.29.146.143:8080/reading/subscription/account/recent?uid=${userid}`; + const response = await got({ + method: 'get', + url: url, + }); + const data = response.data; + + const ProcessFeed = (data) => { + const $ = cheerio.load(data); + return $('.rich_media_content').html(); + }; + + const items = await Promise.all( + data.data.map(async (item) => { + const link = item.url; + + const cache = await ctx.cache.get(link); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + + const response = await got({ + method: 'get', + url: link, + }); + + const description = ProcessFeed(response.data); + + const single = { + title: item.title, + description, + link: link, + author: item.official_account, + pubDate: item.publish_time, + }; + ctx.cache.set(link, JSON.stringify(single)); + return Promise.resolve(single); + }) + ); + + ctx.state.data = { + title: `优读 - ${userid}`, + link: 'https://uread.ai/', + item: items, + }; +};
9755975629e43f8c4defcca9fd2721748e586935
2019-09-18 08:25:02
HuanCheng Bai
feat: 微信开放平台 - 微信小程序问答 (#3101)
false
微信开放平台 - 微信小程序问答 (#3101)
feat
diff --git a/docs/programming.md b/docs/programming.md index 96ad8e0c1bce2d..254a463c2cde7f 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -516,6 +516,16 @@ GitHub 官方也提供了一些 RSS: <Route author="phantomk" example="/wechat-open/community/pay-announce" path="/wechat-open/community/pay-announce"/> +### 微信开放社区-小程序问答 + +<Route author="bestony" example="/wechat-open/community/xcx-question/new" path="/wechat-open/community/xcx-question/:tag" :paramsDesc="['new','hot','topic']"> + +| 最新 | 最热 | 热门话题 | +| ---- | ---- | -------- | +| new | hot | topic | + +</Route> + ### 微信支付-商户平台公告 <Route author="phantomk" example="/wechat-open/pay/announce" path="/wechat-open/pay/announce"/> diff --git a/lib/router.js b/lib/router.js index 5aa87478a2fa21..3ab705ee1a9ac6 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1648,7 +1648,7 @@ router.get('/wechat-open/community/xcx-announce', require('./routes/wechat-open/ router.get('/wechat-open/community/xyx-announce', require('./routes/wechat-open/community/xyx-announce')); router.get('/wechat-open/community/pay-announce', require('./routes/wechat-open/community/pay-announce')); router.get('/wechat-open/pay/announce', require('./routes/wechat-open/pay/announce')); - +router.get('/wechat-open/community/xcx-question/:tag', require('./routes/wechat-open/community/xcx-question')); // 微店 router.get('/weidian/goods/:id', require('./routes/weidian/goods')); diff --git a/lib/routes/wechat-open/community/xcx-question.js b/lib/routes/wechat-open/community/xcx-question.js new file mode 100644 index 00000000000000..2be10d023acde7 --- /dev/null +++ b/lib/routes/wechat-open/community/xcx-question.js @@ -0,0 +1,35 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const tag = ctx.params.tag; + + const response = await got({ + method: 'get', + url: `https://developers.weixin.qq.com/community/ngi/question/list?page=1&tag=${tag}`, + headers: { + Referer: `https://developers.weixin.qq.com/community/develop/question`, + }, + }); + + const data = response.data.data; + + ctx.state.data = { + // 源标题 + title: `微信开放社区的小程序问题 - ${tag}`, + // 源链接 + link: `https://developers.weixin.qq.com/community/develop/question?tag=${tag}`, + // 源说明 + description: `微信开放社区的小程序问题 - ${tag}`, + // 遍历此前获取的数据 + item: data.rows.map((item) => ({ + // 文章标题 + title: item.Title, + // 文章正文 + description: `${item.Content}`, + // 文章发布时间 + pubDate: new Date(item.CreateTime * 1000).toUTCString(), + // 文章链接 + link: `https://developers.weixin.qq.com/community/develop/doc/${item.DocId}`, + })), + }; +};
936045ae97655f76884f5a9a4f43c3dac4986afd
2024-12-11 19:32:57
dependabot[bot]
chore(deps): bump zod from 3.23.8 to 3.24.1 (#17865)
false
bump zod from 3.23.8 to 3.24.1 (#17865)
chore
diff --git a/package.json b/package.json index 34704162a3d7b2..176bf4ba9fe485 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "uuid": "11.0.3", "winston": "3.17.0", "xxhash-wasm": "1.1.0", - "zod": "3.23.8" + "zod": "3.24.1" }, "devDependencies": { "@babel/preset-env": "7.26.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca89f571d1cddb..c8778aa20e3a42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,7 +26,7 @@ importers: version: 1.13.7([email protected]) '@hono/zod-openapi': specifier: 0.18.3 - version: 0.18.3([email protected])([email protected]) + version: 0.18.3([email protected])([email protected]) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -271,8 +271,8 @@ importers: specifier: 1.1.0 version: 1.1.0 zod: - specifier: 3.23.8 - version: 3.23.8 + specifier: 3.24.1 + version: 3.24.1 devDependencies: '@babel/preset-env': specifier: 7.26.0 @@ -5701,8 +5701,8 @@ packages: [email protected]: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} - [email protected]: - resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + [email protected]: + resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} snapshots: @@ -5711,10 +5711,10 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@asteasolutions/[email protected]([email protected])': + '@asteasolutions/[email protected]([email protected])': dependencies: openapi3-ts: 4.4.0 - zod: 3.23.8 + zod: 3.24.1 '@babel/[email protected]': dependencies: @@ -6685,17 +6685,17 @@ snapshots: dependencies: hono: 4.6.13 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: - '@asteasolutions/zod-to-openapi': 7.2.0([email protected]) - '@hono/zod-validator': 0.4.1([email protected])([email protected]) + '@asteasolutions/zod-to-openapi': 7.2.0([email protected]) + '@hono/zod-validator': 0.4.1([email protected])([email protected]) hono: 4.6.13 - zod: 3.23.8 + zod: 3.24.1 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: hono: 4.6.13 - zod: 3.23.8 + zod: 3.24.1 '@humanfs/[email protected]': {} @@ -11458,4 +11458,4 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {}
9c6c93e5ded6f5c2c109d0556155775ff81b2f41
2020-02-24 21:51:24
Henry Wang
feat: 雪球股票标题包括股票代码 (#4076)
false
雪球股票标题包括股票代码 (#4076)
feat
diff --git a/lib/routes/xueqiu/stock_info.js b/lib/routes/xueqiu/stock_info.js index 1f82981db2e071..c7f1213627fca0 100644 --- a/lib/routes/xueqiu/stock_info.js +++ b/lib/routes/xueqiu/stock_info.js @@ -22,8 +22,7 @@ module.exports = async (ctx) => { const token = res1.headers['set-cookie'].find((s) => s.startsWith('xq_a_token=')).split(';')[0]; const $ = cheerio.load(res1.data); // 使用 cheerio 加载返回的 HTML - const html_title = $('title').text(); - const stock_name = html_title.split('(')[0]; + const stock_name = $('.stock-name').text(); let query_url = 'https://xueqiu.com/statuses'; if (source === 'all') { @@ -53,9 +52,9 @@ module.exports = async (ctx) => { const data = res2.data.list; ctx.state.data = { - title: `${stock_name}的${source}`, + title: `${stock_name} - ${source}`, link: `https://xueqiu.com/S/${id}`, - description: `${stock_name} 的${source}`, + description: `${stock_name} - ${source}`, item: data.map((item) => ({ title: item.title !== '' ? item.title : item.description.replace(/<[^>]+>/g, ''), description: item.description,
4434f8765ecfb3b136100945c2853100bc24a8de
2022-09-07 02:14:38
Tony
fix(route): gamme lazy load img (#10729)
false
gamme lazy load img (#10729)
fix
diff --git a/lib/v2/gamme/category.js b/lib/v2/gamme/category.js index 692087cd3d0c43..fba6fe5ddb790c 100644 --- a/lib/v2/gamme/category.js +++ b/lib/v2/gamme/category.js @@ -14,9 +14,10 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); $('.entry img').each((_, img) => { - if (img.attribs['data-original']) { - img.attribs.src = img.attribs['data-original']; + if (img.attribs['data-original'] || img.attribs['data-src']) { + img.attribs.src = img.attribs['data-original'] || img.attribs['data-src']; delete img.attribs['data-original']; + delete img.attribs['data-src']; } }); diff --git a/lib/v2/gamme/tag.js b/lib/v2/gamme/tag.js index 95271bf5f72726..35e5f716732bb7 100644 --- a/lib/v2/gamme/tag.js +++ b/lib/v2/gamme/tag.js @@ -27,9 +27,10 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); $('.entry img').each((_, img) => { - if (img.attribs['data-original']) { - img.attribs.src = img.attribs['data-original']; + if (img.attribs['data-original'] || img.attribs['data-src']) { + img.attribs.src = img.attribs['data-original'] || img.attribs['data-src']; delete img.attribs['data-original']; + delete img.attribs['data-src']; } });
ff57adb08986417cac3ec5dfbd9374ebfe161a54
2022-09-02 23:24:37
dependabot[bot]
chore(deps-dev): bump @vercel/nft from 0.21.0 to 0.22.1 (#10675)
false
bump @vercel/nft from 0.21.0 to 0.22.1 (#10675)
chore
diff --git a/docs/en/install/README.md b/docs/en/install/README.md index 16c8ff433f039b..07b6c6405d3b06 100644 --- a/docs/en/install/README.md +++ b/docs/en/install/README.md @@ -307,8 +307,6 @@ Heroku [no longer](https://blog.heroku.com/next-chapter) offers free product pla [![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/DIYgod/RSSHub) -After finishing the first deployment, you need to add the environment variable `VERCEL_CLI_VERSION` and its value `[email protected]` to your project settings following the instructions in [Vercel](https://vercel.com/docs/concepts/projects/environment-variables) and **redeploy**. - ## Deploy to Google App Engine(GAE) ### Before You Begin diff --git a/docs/install/README.md b/docs/install/README.md index 8dec080e17059a..aa0ae1d534b111 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -312,8 +312,6 @@ Heroku [不再](https://blog.heroku.com/next-chapter) 提供免费服务。 [![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/DIYgod/RSSHub) -完成第一次部署后,你需要按照 [Vercel](https://vercel.com/docs/concepts/projects/environment-variables) 中的说明,将环境变量 `VERCEL_CLI_VERSION` 及其数值 `[email protected]` 添加到你的项目设定然后**重新部署**。 - ## 部署到 Google App Engine ### 准备 diff --git a/package.json b/package.json index f9e4e798177db6..e6748d0fea3072 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "devDependencies": { "@napi-rs/pinyin": "1.7.0", "@types/koa": "2.13.5", - "@vercel/nft": "0.21.0", + "@vercel/nft": "0.22.1", "@vuepress/plugin-back-to-top": "1.9.7", "@vuepress/plugin-google-analytics": "1.9.7", "@vuepress/plugin-pwa": "1.9.7", diff --git a/scripts/docker/minify-docker.js b/scripts/docker/minify-docker.js index 6dacbdc7158def..c12274a6018df1 100644 --- a/scripts/docker/minify-docker.js +++ b/scripts/docker/minify-docker.js @@ -12,7 +12,6 @@ const files = ['lib/index.js', 'api/vercel.js'].map((file) => path.join(projectR console.log('Start analyzing, project root:', projectRoot); const { fileList: fileSet } = await nodeFileTrace(files, { base: projectRoot, - fileIOConcurrency: 2048, }); let fileList = Array.from(fileSet); console.log('Total touchable files:', fileList.length); diff --git a/yarn.lock b/yarn.lock index c1d7f8d3db6bb2..5ef45f5fa5ddb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2069,10 +2069,10 @@ dependencies: "@types/node" "*" -"@vercel/[email protected]": - version "0.21.0" - resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.21.0.tgz#e0715b1997cd7021a7c7c48b584ef2295fd4b810" - integrity sha512-hFCAETfI5cG8l5iAiLhMC2bReC5K7SIybzrxGorv+eGspIbIFsVw7Vg85GovXm/LxA08pIDrAlrhR6GN36XB/Q== +"@vercel/[email protected]": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.22.1.tgz#0d91d2a21e3a7f0b23ce1550da9870eac4942828" + integrity sha512-lYYZIoxRurqDOSoVIdBicGnpUIpfyaS5qVjdPq+EfI285WqtZK3NK/dyCkiyBul+X2U2OEhRyeMdXPCHGJbohw== dependencies: "@mapbox/node-pre-gyp" "^1.0.5" acorn "^8.6.0"
2294e6f8cfc0b9c6dd0f9bd65f79fe2dda4f1b33
2025-02-18 15:44:26
dependabot[bot]
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#18390)
false
bump @typescript-eslint/eslint-plugin (#18390)
chore
diff --git a/package.json b/package.json index 2190b8fa85f202..19501bfa0e897a 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "@types/tiny-async-pool": "2.0.3", "@types/title": "3.4.3", "@types/uuid": "10.0.0", - "@typescript-eslint/eslint-plugin": "8.24.0", + "@typescript-eslint/eslint-plugin": "8.24.1", "@typescript-eslint/parser": "8.24.0", "@vercel/nft": "0.29.1", "@vitest/coverage-v8": "2.1.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 627662e4cfc1ac..f098c7e15f061f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -364,8 +364,8 @@ importers: specifier: 10.0.0 version: 10.0.0 '@typescript-eslint/eslint-plugin': - specifier: 8.24.0 - version: 8.24.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) + specifier: 8.24.1 + version: 8.24.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) '@typescript-eslint/parser': specifier: 8.24.0 version: 8.24.0([email protected])([email protected]) @@ -2033,8 +2033,8 @@ packages: '@types/[email protected]': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -2052,8 +2052,12 @@ packages: resolution: {integrity: sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -2063,12 +2067,22 @@ packages: resolution: {integrity: sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.8.0' + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <5.8.0' + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2076,10 +2090,21 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@ungap/[email protected]': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} @@ -7481,14 +7506,14 @@ snapshots: '@types/node': 22.13.4 optional: true - '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': + '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': dependencies: '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 8.24.0([email protected])([email protected]) - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/type-utils': 8.24.0([email protected])([email protected]) - '@typescript-eslint/utils': 8.24.0([email protected])([email protected]) - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/scope-manager': 8.24.1 + '@typescript-eslint/type-utils': 8.24.1([email protected])([email protected]) + '@typescript-eslint/utils': 8.24.1([email protected])([email protected]) + '@typescript-eslint/visitor-keys': 8.24.1 eslint: 9.20.1 graphemer: 1.4.0 ignore: 5.3.2 @@ -7515,10 +7540,15 @@ snapshots: '@typescript-eslint/types': 8.24.0 '@typescript-eslint/visitor-keys': 8.24.0 - '@typescript-eslint/[email protected]([email protected])([email protected])': + '@typescript-eslint/[email protected]': dependencies: - '@typescript-eslint/typescript-estree': 8.24.0([email protected]) - '@typescript-eslint/utils': 8.24.0([email protected])([email protected]) + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/visitor-keys': 8.24.1 + + '@typescript-eslint/[email protected]([email protected])([email protected])': + dependencies: + '@typescript-eslint/typescript-estree': 8.24.1([email protected]) + '@typescript-eslint/utils': 8.24.1([email protected])([email protected]) debug: 4.4.0 eslint: 9.20.1 ts-api-utils: 2.0.1([email protected]) @@ -7528,6 +7558,8 @@ snapshots: '@typescript-eslint/[email protected]': {} + '@typescript-eslint/[email protected]': {} + '@typescript-eslint/[email protected]([email protected])': dependencies: '@typescript-eslint/types': 8.24.0 @@ -7542,6 +7574,20 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/[email protected]([email protected])': + dependencies: + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/visitor-keys': 8.24.1 + debug: 4.4.0 + fast-glob: 3.3.3 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.7.1 + ts-api-utils: 2.0.1([email protected]) + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: '@eslint-community/eslint-utils': 4.4.1([email protected]) @@ -7553,11 +7599,27 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/[email protected]([email protected])([email protected])': + dependencies: + '@eslint-community/eslint-utils': 4.4.1([email protected]) + '@typescript-eslint/scope-manager': 8.24.1 + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/typescript-estree': 8.24.1([email protected]) + eslint: 9.20.1 + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/[email protected]': dependencies: '@typescript-eslint/types': 8.24.0 eslint-visitor-keys: 4.2.0 + '@typescript-eslint/[email protected]': + dependencies: + '@typescript-eslint/types': 8.24.1 + eslint-visitor-keys: 4.2.0 + '@ungap/[email protected]': {} '@unhead/[email protected]': @@ -8806,7 +8868,7 @@ snapshots: [email protected]: dependencies: - debug: 4.3.4 + debug: 4.4.0 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -10489,7 +10551,7 @@ snapshots: [email protected]: dependencies: agent-base: 7.1.3 - debug: 4.3.4 + debug: 4.4.0 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 lru-cache: 7.18.3
e1a5409035485b252cc9b5ae75ab6856709dcc4c
2024-11-08 19:01:35
dependabot[bot]
chore(deps): bump @opentelemetry/exporter-trace-otlp-http (#17509)
false
bump @opentelemetry/exporter-trace-otlp-http (#17509)
chore
diff --git a/package.json b/package.json index cc61c5c07d3945..98718e6956a547 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@notionhq/client": "2.2.15", "@opentelemetry/api": "1.9.0", "@opentelemetry/exporter-prometheus": "0.54.1", - "@opentelemetry/exporter-trace-otlp-http": "0.54.1", + "@opentelemetry/exporter-trace-otlp-http": "0.54.2", "@opentelemetry/resources": "1.27.0", "@opentelemetry/sdk-metrics": "1.27.0", "@opentelemetry/sdk-trace-base": "1.27.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbb2f8fc3c9b6d..af0726c4bf6b56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: 0.54.1 version: 0.54.1(@opentelemetry/[email protected]) '@opentelemetry/exporter-trace-otlp-http': - specifier: 0.54.1 - version: 0.54.1(@opentelemetry/[email protected]) + specifier: 0.54.2 + version: 0.54.2(@opentelemetry/[email protected]) '@opentelemetry/resources': specifier: 1.27.0 version: 1.27.0(@opentelemetry/[email protected]) @@ -1495,8 +1495,8 @@ packages: '@open-draft/[email protected]': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@opentelemetry/[email protected]': - resolution: {integrity: sha512-tFOyYT8tFRSuUc+pEXnHG99270y7K8MSBLQSPiYBJ/0cgCp+8KmSej4joBfah0JoXAwbPzMCom3ri0xsiYbLvg==} + '@opentelemetry/[email protected]': + resolution: {integrity: sha512-4MTVwwmLgUh5QrJnZpYo6YRO5IBLAggf2h8gWDblwRagDStY13aEvt7gGk3jewrMaPlHiF83fENhIx0HO97/cQ==} engines: {node: '>=14'} '@opentelemetry/[email protected]': @@ -1515,20 +1515,20 @@ packages: peerDependencies: '@opentelemetry/api': ^1.3.0 - '@opentelemetry/[email protected]': - resolution: {integrity: sha512-yencb6HQ0ImSuMsR8RR+FtxkzJcJhy759/oAPDRUFowbncJHRK7vlty35hQeOhdzi3F/TzQhkzaCa8QGm/VTUw==} + '@opentelemetry/[email protected]': + resolution: {integrity: sha512-BgWKKyD/h2zpISdmYHN/sapwTjvt1P4p5yx4xeBV8XAEqh4OQUhOtSGFG80+nPQ1F8of3mKOT1DDoDbJp1u25w==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.3.0 - '@opentelemetry/[email protected]': - resolution: {integrity: sha512-cqX2uAg8UVzpEq9BrMhn6jQGp480Ykf0gQR4nOwpBkQ0BzoKHnu5GIhAuhHH4laVym0KrUVgWZWrdT52WrSXVA==} + '@opentelemetry/[email protected]': + resolution: {integrity: sha512-NrNyxu6R/bGAwanhz1HI0aJWKR6xUED4TjCH4iWMlAfyRukGbI9Kt/Akd2sYLwRKNhfS+sKetKGCUQPMDyYYMA==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.3.0 - '@opentelemetry/[email protected]': - resolution: {integrity: sha512-8aleigiRCeo3S1IqB88EFlYu9WlZmJOMcAse9U9yB/CdGiLN5g5jjMHEO47+YspTwVlc9U3B/Vj+oG/OFPSfDQ==} + '@opentelemetry/[email protected]': + resolution: {integrity: sha512-2tIjahJlMRRUz0A2SeE+qBkeBXBFkSjR0wqJ08kuOqaL8HNGan5iZf+A8cfrfmZzPUuMKCyY9I+okzFuFs6gKQ==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.3.0 @@ -1539,8 +1539,8 @@ packages: peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' - '@opentelemetry/[email protected]': - resolution: {integrity: sha512-FoHgzFT9XHt1NdLNwNzqZCCWT7XF1aSxXuSRlGdfwmkhFjB0F3t0a7pngChejIP7ugc9XTIaKlboloe5DlGHzw==} + '@opentelemetry/[email protected]': + resolution: {integrity: sha512-yIbYqDLS/AtBbPjCjh6eSToGNRMqW2VR8RrKEy+G+J7dFG7pKoptTH5T+XlKPleP9NY8JZYIpgJBlI+Osi0rFw==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': '>=1.4.0 <1.10.0' @@ -7042,7 +7042,7 @@ snapshots: '@open-draft/[email protected]': {} - '@opentelemetry/[email protected]': + '@opentelemetry/[email protected]': dependencies: '@opentelemetry/api': 1.9.0 @@ -7060,28 +7060,28 @@ snapshots: '@opentelemetry/resources': 1.27.0(@opentelemetry/[email protected]) '@opentelemetry/sdk-metrics': 1.27.0(@opentelemetry/[email protected]) - '@opentelemetry/[email protected](@opentelemetry/[email protected])': + '@opentelemetry/[email protected](@opentelemetry/[email protected])': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected]) - '@opentelemetry/otlp-exporter-base': 0.54.1(@opentelemetry/[email protected]) - '@opentelemetry/otlp-transformer': 0.54.1(@opentelemetry/[email protected]) + '@opentelemetry/otlp-exporter-base': 0.54.2(@opentelemetry/[email protected]) + '@opentelemetry/otlp-transformer': 0.54.2(@opentelemetry/[email protected]) '@opentelemetry/resources': 1.27.0(@opentelemetry/[email protected]) '@opentelemetry/sdk-trace-base': 1.27.0(@opentelemetry/[email protected]) - '@opentelemetry/[email protected](@opentelemetry/[email protected])': + '@opentelemetry/[email protected](@opentelemetry/[email protected])': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected]) - '@opentelemetry/otlp-transformer': 0.54.1(@opentelemetry/[email protected]) + '@opentelemetry/otlp-transformer': 0.54.2(@opentelemetry/[email protected]) - '@opentelemetry/[email protected](@opentelemetry/[email protected])': + '@opentelemetry/[email protected](@opentelemetry/[email protected])': dependencies: '@opentelemetry/api': 1.9.0 - '@opentelemetry/api-logs': 0.54.1 + '@opentelemetry/api-logs': 0.54.2 '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected]) '@opentelemetry/resources': 1.27.0(@opentelemetry/[email protected]) - '@opentelemetry/sdk-logs': 0.54.1(@opentelemetry/[email protected]) + '@opentelemetry/sdk-logs': 0.54.2(@opentelemetry/[email protected]) '@opentelemetry/sdk-metrics': 1.27.0(@opentelemetry/[email protected]) '@opentelemetry/sdk-trace-base': 1.27.0(@opentelemetry/[email protected]) protobufjs: 7.4.0 @@ -7092,10 +7092,10 @@ snapshots: '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected]) '@opentelemetry/semantic-conventions': 1.27.0 - '@opentelemetry/[email protected](@opentelemetry/[email protected])': + '@opentelemetry/[email protected](@opentelemetry/[email protected])': dependencies: '@opentelemetry/api': 1.9.0 - '@opentelemetry/api-logs': 0.54.1 + '@opentelemetry/api-logs': 0.54.2 '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected]) '@opentelemetry/resources': 1.27.0(@opentelemetry/[email protected])
3ef4ca09609fb86a59a82e547cf904264694845e
2019-08-21 16:49:06
kouchao
fix: 修复 飞冰title不正确 (#2904)
false
修复 飞冰title不正确 (#2904)
fix
diff --git a/lib/routes/jskou/index.js b/lib/routes/jskou/index.js index 606e6e75f631f5..a3f8523997d235 100644 --- a/lib/routes/jskou/index.js +++ b/lib/routes/jskou/index.js @@ -13,7 +13,7 @@ module.exports = async (ctx) => { }; }); ctx.state.data = { - title: type ? '前端艺术家每日资讯整理' : '飞冰早报整理', + title: type === '0' ? '前端艺术家每日资讯整理' : '飞冰早报整理', link: 'http://fe.jskou.com/', description: '前端艺术家1群每日资讯,飞冰早报', item,
0f48b6b0f695e410a3ebb27c78ee5a14c2dff457
2021-01-03 20:27:59
nczitzk
feat: add 留园网社区分站
false
add 留园网社区分站
feat
diff --git a/docs/new-media.md b/docs/new-media.md index dea896d5733aca..09555ab561d8c5 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1339,13 +1339,67 @@ column 为 third 时可选的 category: ### 首页 <Route author="xyqfer" example="/laosiji/feed" path="/laosiji/feed"/> -### 24小时热门 + +### 24 小时热门 <Route author="xyqfer" example="/laosiji/hot" path="/laosiji/hot"/> + ### 节目 <Route author="xyqfer" example="/laosiji/hotshow/128" path="/laosiji/hotshow/:id" :paramsDesc="['节目 id']"/> +## 留园网 + +### 分站 + +<Route author="nczitzk" example="/6park" path="/6park/:id?" :paramsDesc="['分站,见下表,默认为史海钩沉']"> + +| 婚姻家庭 | 魅力时尚 | 女性频道 | 生活百态 | 美食厨房 | 非常影音 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| life9 | life1 | chan10 | life2 | life6 | fr | + +| 车迷沙龙 | 游戏天地 | 卡通漫画 | 体坛纵横 | 运动健身 | 电脑前线 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| enter7 | enter3 | enter6 | enter5 | sport | know1 | + +| 数码家电 | 旅游风向 | 摄影部落 | 奇珍异宝 | 笑口常开 | 娱乐八卦 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| chan6 | life7 | chan8 | page | enter1 | enter8 | + +| 吃喝玩乐 | 文化长廊 | 军事纵横 | 百家论坛 | 科技频道 | 爱子情怀 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| netstar | life10 | nz | other | chan2 | chan5 | + +| 健康人生 | 博论天下 | 史海钩沉 | 网际谈兵 | 经济观察 | 谈股论金 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| life5 | bolun | chan1 | military | finance | chan4 | + +| 杂论闲侃 | 唯美乐园 | 学习园地 | 命理玄机 | 宠物情缘 | 网络歌坛 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| pk | gz1 | gz2 | gz3 | life8 | chan7 | + +| 音乐殿堂 | 情感世界 | +| -------- | -------- | +| enter4 | life3 | + +::: tip 提示 + +酷 18 文档参见 [此处](https://docs.rsshub.app/picture.html#ku-18) + +禁忌书屋文档参见 [此处](https://docs.rsshub.app/reading.html#jin-ji-shu-wu) + +::: + +</Route> + +### 精华区 + +<Route author="nczitzk" example="/6park/chan1/gold" path="/6park/:id/gold" :paramsDesc="['分站,见上表']"/> + +### 搜索关键字 + +<Route author="nczitzk" example="/6park/chan1/keywords/都市" path="/6park/:id/keywords/:keyword?" :paramsDesc="['分站,见上表', '关键字']"/> + ## 妈咪帮 <Route author="nczitzk" example="/mamibuy" path="/mamibuy/:caty?/:age?/:sort?" :paramsDesc="['分类,见下表,默认为全分類', '岁数,见下表,默认为不限', '排序,见下表,默认为最新']"> diff --git a/docs/picture.md b/docs/picture.md index 3ea243e1df38db..2c095474f3bde2 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -358,6 +358,8 @@ R18 显示 ::: tip 提示 +留园网文档参见 [此处](https://docs.rsshub.app/new-media.html#liu-yuan-wang) + 禁忌书屋文档参见 [此处](https://docs.rsshub.app/reading.html#jin-ji-shu-wu) ::: diff --git a/lib/router.js b/lib/router.js index 5bb0f656c3395c..24268d6a4879d6 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3780,4 +3780,7 @@ router.get('/nace/blog/:sort?', require('./routes/nace/blog')); // Caixin Latest router.get('/caixin/latest', require('./routes/caixin/latest')); +// 留园网 +router.get('/6park/:id?/:type?/:keyword?', require('./routes/6park/index')); + module.exports = router; diff --git a/lib/routes/6park/index.js b/lib/routes/6park/index.js new file mode 100644 index 00000000000000..43346464192cf9 --- /dev/null +++ b/lib/routes/6park/index.js @@ -0,0 +1,58 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id || 'chan1'; + const type = ctx.params.type || ''; + const keyword = ctx.params.keyword || ''; + + const rootUrl = 'https://club.6parkbbs.com'; + const indexUrl = `${rootUrl}/${id}/index.php`; + const currentUrl = `${indexUrl}${type === '' || keyword === '' ? '' : type === 'gold' ? '?app=forum&act=gold' : `?action=search&act=threadsearch&app=forum&${type}=${keyword}&submit=${type === 'type' ? '查询' : '栏目搜索'}`}`; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('#d_list ul li, #thread_list li, .t_l .t_subject') + .slice(0, 10) + .map((_, item) => { + item = $(item); + const a = item.find('a').eq(0); + return { + link: `${rootUrl}/${id}/${a.attr('href')}`, + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.title = content('title').text().replace(' -6park.com', ''); + item.author = detailResponse.data.match(/送交者: .*>(.*)<.*\[/)[1]; + item.pubDate = new Date(detailResponse.data.match(/于 (.*) 已读/)[1]).toUTCString(); + item.description = content('pre') + .html() + .replace(/<font color="#E6E6DD">6park.com<\/font>/g, ''); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +};
43afea73a2138e320dd5997302d53a2ecb06b62a
2020-12-04 21:13:13
FlashWingShadow
feat: add 西瓜视频 (#6258)
false
add 西瓜视频 (#6258)
feat
diff --git a/docs/multimedia.md b/docs/multimedia.md index 2569ab4609d2b6..67f1a6c396d9ca 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -703,6 +703,18 @@ pageClass: routes <Route author="magic-akari" example="/ncm/djradio/347317067" path="/ncm/djradio/:id" :paramsDesc="['节目 id, 可在电台节目页 URL 中找到']" supportPodcast="1" /> +## 西瓜视频 + +::: tip Tiny Tiny RSS 用户请注意 + +Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性,导致无法加载西瓜视频内嵌视频,如果需要使用内嵌视频请为 Tiny Tiny RSS 安装 [remove_iframe_sandbox](https://github.com/DIYgod/ttrss-plugin-remove-iframe-sandbox) 插件 + +::: + +### 用户视频投稿 + +<Route author="FlashWingShadow" example="/ixigua/user/video/4234740937" path="/ixigua/user/video/:uid/:disableEmbed?" :paramsDesc="['用户 id, 可在用户主页中找到', '默认为开启内嵌视频, 任意值为关闭']"/> + ## 喜马拉雅 ### 专辑 diff --git a/lib/router.js b/lib/router.js index 48005cb7033a58..8877f6c06ab329 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3595,6 +3595,9 @@ router.get('/youdao/latest', require('./routes/youdao/latest')); router.get('/yinxiang/note', require('./routes/yinxiang/note')); router.get('/yinxiang/card/:id?', require('./routes/yinxiang/card')); +// 西瓜视频 +router.get('/ixigua/user/video/:uid/:disableEmbed?', require('./routes/ixigua/userVideo')); + // 遠見 gvm.com.tw router.get('/gvm/index/:category?', require('./routes/gvm/index')); diff --git a/lib/routes/ixigua/userVideo.js b/lib/routes/ixigua/userVideo.js new file mode 100644 index 00000000000000..95390c962068b4 --- /dev/null +++ b/lib/routes/ixigua/userVideo.js @@ -0,0 +1,35 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const uid = ctx.params.uid; + const disableEmbed = ctx.params.disableEmbed; + const homeUrl = 'https://www.ixigua.com'; + const videoApiUrl = `${homeUrl}/api/videov2/author/video?&author_id=${uid}&type=video&max_time=0`; + const resp = await got(videoApiUrl, { headers: { referer: homeUrl } }); + const jsonData = resp.data; + + if (jsonData.code !== 200) { + throw Error(`xigua video API: code = ${jsonData.code}, message = ${jsonData.data.message}`); + } + if (jsonData.data.data.length === 0) { + throw Error('xigua video API: data is empty'); + } + + const videoInfos = jsonData.data.data; + const userInfo = videoInfos[0].user_info; + + ctx.state.data = { + title: `${userInfo.name} 的西瓜视频`, + link: `${homeUrl}/home/${uid}`, + description: userInfo.author_desc, + item: videoInfos.map((i) => ({ + title: i.title, + description: + (disableEmbed ? '' : `<iframe width="720" height="405" frameborder="0" allowfullscreen src="https://www.ixigua.com/iframe/${i.gid}?autoplay=0&startTime=0"></iframe><br>`) + + `<img src="${i.middle_image.url}" /><p>${i.abstract}</p>`, + link: `${homeUrl}/${i.gid}`, + pubDate: i.publish_time * 1000, + author: userInfo.name, + })), + }; +};
ef670174baf7c14205f0292327224abd171430aa
2022-08-14 17:26:15
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/lib/v2/polkadot/home.js b/lib/v2/polkadot/home.js index 4a6828e35b3bd6..b037a500eb1e8e 100644 --- a/lib/v2/polkadot/home.js +++ b/lib/v2/polkadot/home.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { .map((_, originItem) => { const item = { title: $(originItem).find('h5').text().trim(), - link: 'https://polkadot.network' + $(originItem).attr('href') + link: 'https://polkadot.network' + $(originItem).attr('href'), }; return ctx.cache.tryGet(item.link, async () => { const detailResponse = await got(item.link); diff --git a/lib/v2/polkadot/router.js b/lib/v2/polkadot/router.js index 394431f713957a..3234e414c9868a 100644 --- a/lib/v2/polkadot/router.js +++ b/lib/v2/polkadot/router.js @@ -1,3 +1,3 @@ module.exports = function (router) { router.get('/blog', require('./home')); -}; \ No newline at end of file +};
1a806b41d0e09d805a86c0f20ad16d7c6e41e0e1
2019-07-26 08:23:23
junfengP
fix: 色花堂 (#2685)
false
色花堂 (#2685)
fix
diff --git a/lib/routes/dsndsht23/index.js b/lib/routes/dsndsht23/index.js index 59a160f3c3ec5b..864d462e3da673 100644 --- a/lib/routes/dsndsht23/index.js +++ b/lib/routes/dsndsht23/index.js @@ -1,7 +1,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const host = 'https://www.dsndsht23.com/'; +const host = 'https://www.sehuatang.net/'; const map = { mrhj: 'forum-106-1.html', @@ -20,7 +20,7 @@ const map = { module.exports = async (ctx) => { const subforumid = ctx.params.subforumid || 'gqzwzm'; - const link = `https://www.dsndsht23.com/${map[subforumid]}`; + const link = `${host}${map[subforumid]}`; const response = await got.get(link); const $ = cheerio.load(response.data); @@ -29,7 +29,7 @@ module.exports = async (ctx) => { .filter(function() { // 去除置顶帖子和分割线 const threadID = $(this).attr('id'); - return threadID !== 'separatorline' && !threadID.startsWith('stickthread'); + return typeof threadID !== 'undefined' && threadID !== 'separatorline' && !threadID.startsWith('stickthread'); }) .map(function() { const info = { diff --git a/lib/routes/dsndsht23/pictures.js b/lib/routes/dsndsht23/pictures.js index be0f99040e123f..6d2027db007972 100644 --- a/lib/routes/dsndsht23/pictures.js +++ b/lib/routes/dsndsht23/pictures.js @@ -1,6 +1,6 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const host = 'https://www.dsndsht23.com/'; +const host = 'https://www.sehuatang.net/'; const map = { hrxazp: 'forum-98-1.html', @@ -13,7 +13,7 @@ const map = { module.exports = async (ctx) => { const subforumid = ctx.params.subforumid || 'hrxazp'; - const link = `https://www.dsndsht23.com/${map[subforumid]}`; + const link = `${host}${map[subforumid]}`; const response = await got.get(link); const $ = cheerio.load(response.body); @@ -22,7 +22,7 @@ module.exports = async (ctx) => { .filter(function() { // 去除置顶帖子和分割线 const threadID = $(this).attr('id'); - return threadID !== 'separatorline' && !threadID.startsWith('stickthread'); + return typeof threadID !== 'undefined' && threadID !== 'separatorline' && !threadID.startsWith('stickthread'); }) .map(function() { const info = {
5921d8aba848f39401fc68efdd34f6b9820c5a57
2023-12-05 23:37:52
incubator4
docs(deploy): Implement helm chart deploy docs. (#13962)
false
Implement helm chart deploy docs. (#13962)
docs
diff --git a/website/docs/install/README.md b/website/docs/install/README.md index c1caa3be3e3de9..107f7b826c8235 100644 --- a/website/docs/install/README.md +++ b/website/docs/install/README.md @@ -142,6 +142,118 @@ This deployment method does not include puppeteer (unless using `diygod/rsshub:c To configure more options please refer to [Configuration](#configuration). +## Kubernetes Deployment (Helm) + +RSSHub can be installed in Kubernetes using the Helm Chart from [RSSHub Helm Chart](https://github.com/NaturalSelectionLabs/helm-charts/tree/main/charts/rsshub) + +Ensure that the following requirements are met: + +- Kubernetes 1.16+ +- Helm version 3.9+ is [installed](https://helm.sh/docs/intro/install/) + +### Install + +Add NaturalSelection Labs chart repository to Helm: + +```bash +helm repo add nsl https://naturalselectionlabs.github.io/helm-charts +``` + +You can update the chart repository by running: + +```bash +helm repo update +``` + +And install it with the `helm` command line: + +```bash +helm install my-release nsl/rsshub +``` + +### Update + +To upgrade the my-release RSSHub deployment: + +```bash +helm upgade my-release nsl/rsshub +``` + +### Uninstall + +To uninstall/delete the my-release RSSHub deployment: + +```bash +helm delete my-release +``` + +### Installing with custom values + +<Tabs groupId="package-manager"> +<TabItem value="using-helm-cli" label="Using Helm CLI" default> + +```bash +helm install my-release nsl/rsshub \ + --set="image.tag=2023-12-04" \ + --set="replicaCount=2" +``` + +</TabItem> +<TabItem value="with-a-custom-values-file" label="With a custom values file"> + +```yaml +# File custom-values.yml +## Install with "helm install my-release nsl/rsshub -f ./custom-values.yml +image: + tag: "2023-12-04" +replicaCount: 2 +``` + +</TabItem> +</Tabs> + +### Install with HA mode + +<Tabs groupId="package-manager"> +<TabItem value="ha-mode-without-autoscaling" label="HA mode without autoscaling" default> + +```yaml +replicaCount: 3 + +puppeteer: + replicaCount: 2 +``` + +</TabItem> +<TabItem value="ha-mode-with-autoscaling" label="HA mode with autoscaling"> + +```yaml +autoscaling: + enabled: true + minReplicas: 3 + +puppeteer: + autoscaling: + enabled: true + minReplicas: 2 +``` + +</TabItem> +</Tabs> + +### Install with external Redis + +```yaml +redis: + # -- Disable internal redis + enabled: false +env: + # -- other env -- + REDIS_URL: redis://external-redis:6379/ +``` + +To configure more values please refer to [RSSHub Helm Chart](https://github.com/NaturalSelectionLabs/helm-charts/tree/main/charts/rsshub). + ## Ansible Deployment This Ansible playbook includes RSSHub, Redis, browserless (uses Docker) and Caddy 2 diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md index 04ba9762444d96..b5cd1decac2e4c 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md @@ -142,6 +142,118 @@ $ docker run -d --name rsshub -p 1200:1200 -e CACHE_EXPIRE=3600 -e GITHUB_ACCESS 更多配置项请看 [#配置](#pei-zhi) +## Kubernetes 部署 (Helm) + +RSSHub 可以使用来自 [RSSHub Helm Chart](https://github.com/NaturalSelectionLabs/helm-charts/tree/main/charts/rsshub) 的 Helm Chart 在 Kubernetes 中安装 + +确保满足以下要求: + +- Kubernetes 1.16+ +- 已经 [安装](https://helm.sh/docs/intro/install/) Helm 版本 3.9+ + +### 安装 + +将 NaturalSelection Labs Chart 仓库添加到 Helm: + +```bash +helm repo add nsl https://naturalselectionlabs.github.io/helm-charts +``` + +你可以通过运行以下命令更新 Chart 仓库: + +```bash +helm repo update +``` + +然后使用 `helm` 命令行安装: + +```bash +helm install my-release nsl/rsshub +``` + +### 更新 + +要升级 my-release RSSHub 部署: + +```bash +helm upgade my-release nsl/rsshub +``` + +### 移除 + +如要删除 my-release RSSHub 部署: + +```bash +helm delete my-release +``` + +### 使用自定义配置安装 + +<Tabs groupId="package-manager"> +<TabItem value="using-helm-cli" label="使用 Helm CLI" default> + +```bash +helm install my-release nsl/rsshub \ + --set="image.tag=2023-12-04" \ + --set="replicaCount=2" +``` + +</TabItem> +<TabItem value="with-a-custom-values-file" label="使用自定义配置文件"> + +```yaml +# custom-values.yml 文件 +## 使用 "helm install my-release nsl/rsshub -f ./custom-values.yml" 安装 +image: + tag: "2023-12-04" +replicaCount: 2 +``` + +</TabItem> +</Tabs> + +### 使用 HA 模式安装 + +<Tabs groupId="package-manager"> +<TabItem value="ha-mode-without-autoscaling" label="不使用自动扩缩的 HA 模式" default> + +```yaml +replicaCount: 3 + +puppeteer: + replicaCount: 2 +``` + +</TabItem> +<TabItem value="ha-mode-with-autoscaling" label="使用自动扩缩的 HA 模式"> + +```yaml +autoscaling: + enabled: true + minReplicas: 3 + +puppeteer: + autoscaling: + enabled: true + minReplicas: 2 +``` + +</TabItem> +</Tabs> + +### 使用外部 Redis 安装 + +```yaml +redis: + # -- 禁用内部 redis + enabled: false +env: + # -- 其他环境变量 -- + REDIS_URL: redis://external-redis:6379/ +``` + +要配置更多值,请参阅 [RSSHub Helm Chart](https://github.com/NaturalSelectionLabs/helm-charts/tree/main/charts/rsshub)。 + ## Ansible 部署 这个 Ansible playbook 包括了 RSSHub, Redis, browserless (依赖 Docker) 以及 Caddy 2
39cf9274a6edd43ee4a7f9022409cb8e03f381f4
2023-12-13 21:17:07
James Tsang
fix(route): fix Yuque book route (#14022)
false
fix Yuque book route (#14022)
fix
diff --git a/lib/v2/yuque/book.js b/lib/v2/yuque/book.js index aa6ba0fd8b7e18..f66380cf7a37ac 100644 --- a/lib/v2/yuque/book.js +++ b/lib/v2/yuque/book.js @@ -2,15 +2,19 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); const { card2Html } = require('./utils'); +const { CookieJar } = require('tough-cookie'); const APP_DATA_REGEX = /window\.appData = JSON\.parse\(decodeURIComponent\("(.+?)"\)\);/; const baseUrl = 'https://www.yuque.com'; module.exports = async (ctx) => { + const cookieJar = new CookieJar(); const { name, book } = ctx.params; const bookUrl = `${baseUrl}/${name}/${book}`; - const { data: bookHtml } = await got(bookUrl); + const { data: bookHtml } = await got(bookUrl, { + cookieJar, + }); const $ = cheerio.load(bookHtml); const appData = JSON.parse(decodeURIComponent($('script').text().match(APP_DATA_REGEX)[1])); @@ -22,6 +26,7 @@ module.exports = async (ctx) => { searchParams: { book_id: bookId, }, + cookieJar, }); const list = docs.map((item) => ({ diff --git a/lib/v2/yuque/utils.js b/lib/v2/yuque/utils.js index af5565dd648b1e..0e65363e9d234b 100644 --- a/lib/v2/yuque/utils.js +++ b/lib/v2/yuque/utils.js @@ -14,6 +14,7 @@ const card2Html = (elem, link) => { break; case 'bookmarkInline': case 'bookmarklink': + case 'yuqueinline': html = `<a href='${value.src}'>${value.detail.title}</a>`; break; case 'checkbox': @@ -32,6 +33,9 @@ const card2Html = (elem, link) => { case 'hr': html = '<hr>'; break; + case 'label': + html = `<b>${value.label}</b>`; + break; case 'mention': html = `<a href='https://www.yuque.com/${value.login}'>${value.name}</a>`; break; @@ -46,14 +50,26 @@ const card2Html = (elem, link) => { html = `<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" height=66 src="${value.src}"></iframe>`; } else if (elem.attr('alias') === 'bilibili' || elem.attr('alias') === undefined) { html = `<iframe src="${value.src}&high_quality=1&autoplay=0" width="650" height="477" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`; + } else if (value.type === 'codepen') { + html = `<iframe height="265" style="width: 100%;" scrolling="no" title="codepen" src="${value.url}" frameborder="no" allowtransparency="true" allowfullscreen="true"></iframe>`; } else { throw Error(`Unhandled thirdparty on ${link}: ${elem.attr('alias')}`); } break; + case 'yuque': + if (value.mode === 'card') { + html = `<a href='${value.src}'>${value.detail.title}</a>`; + } else if (value.mode === 'embed') { + html = `<iframe src="${value.url}" width="100%" height="518"></iframe>`; + } else { + throw Error(`Unhandled mode on ${link}: ${value.mode}`); + } + break; case 'video': // fake video src html = `<video src='${value.videoId}'></video>`; break; + default: throw Error(`Unhandled card on ${link}: ${name}`); }
0833570dff8a6cb0bc485431484efa57ba2700d7
2020-05-30 13:41:54
dependabot-preview[bot]
chore(deps): bump @koa/router from 8.0.8 to 9.0.1
false
bump @koa/router from 8.0.8 to 9.0.1
chore
diff --git a/package.json b/package.json index 31fe96400b0e7e..f8ce862bb87b0c 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "yorkie": "2.0.0" }, "dependencies": { - "@koa/router": "8.0.8", + "@koa/router": "9.0.1", "@postlight/mercury-parser": "2.2.0", "@sentry/node": "5.15.5", "aes-js": "3.1.2", diff --git a/yarn.lock b/yarn.lock index 36092ebe076246..c55936f383cf3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1239,17 +1239,16 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@koa/[email protected]": - version "8.0.8" - resolved "https://registry.yarnpkg.com/@koa/router/-/router-8.0.8.tgz#95f32d11373d03d89dcb63fabe9ac6f471095236" - integrity sha512-FnT93N4NUehnXr+juupDmG2yfi0JnWdCmNEuIXpCG4TtG+9xvtrLambBH3RclycopVUOEYAim2lydiNBI7IRVg== +"@koa/[email protected]": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@koa/router/-/router-9.0.1.tgz#4090a14223ea7e78aa13b632761209cba69acd95" + integrity sha512-OI+OU49CJV4px0WkIMmayBeqVXB/JS1ZMq7UoGlTZt6Y7ijK7kdeQ18+SEHHJPytmtI1y6Hf8XLrpxva3mhv5Q== dependencies: debug "^4.1.1" http-errors "^1.7.3" koa-compose "^4.1.0" methods "^1.1.2" - path-to-regexp "1.x" - urijs "^1.19.2" + path-to-regexp "^6.1.0" "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" @@ -6854,11 +6853,6 @@ is-yarn-global@^0.3.0: resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== [email protected]: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - [email protected], isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -9269,12 +9263,10 @@ [email protected]: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= [email protected]: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== - dependencies: - isarray "0.0.1" +path-to-regexp@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.1.0.tgz#0b18f88b7a0ce0bfae6a25990c909ab86f512427" + integrity sha512-h9DqehX3zZZDCEm+xbfU0ZmwCGFCAAraPJWMXJ4+v32NjZJilVg3k1TcKsRgIb8IQ/izZSaydDc1OhJCZvs2Dw== path-type@^3.0.0: version "3.0.0" @@ -12251,11 +12243,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -urijs@^1.19.2: - version "1.19.2" - resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.2.tgz#f9be09f00c4c5134b7cb3cf475c1dd394526265a" - integrity sha512-s/UIq9ap4JPZ7H1EB5ULo/aOUbWqfDi7FKzMC2Nz+0Si8GiT1rIEaprt8hy3Vy2Ex2aJPpOQv4P4DuOZ+K1c6w== - urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
5c70eb95f88c66e428fae4006737efb784edc3f1
2019-12-12 15:28:14
Attenuation
feat: add aliyun kernel blog (#3572)
false
add aliyun kernel blog (#3572)
feat
diff --git a/docs/blog.md b/docs/blog.md index 31504db20681cc..86ba009d1db078 100644 --- a/docs/blog.md +++ b/docs/blog.md @@ -32,6 +32,12 @@ pageClass: routes <Route author="xyqfer" example="/leemeng" path="/leemeng"/> +## 阿里云系统组技术博客 + +### 首页 + +<Route author="attenuation" example="/aliyun-kernel/index" path="/aliyun-kernel/index"/> + ## 财新博客 ### 用户博客 diff --git a/lib/router.js b/lib/router.js index fc965309f79717..bb9f570ab5704b 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2034,4 +2034,7 @@ router.get('/ikea/uk/offer', require('./routes/ikea/uk/offer')); // Mastodon router.get('/mastodon/timeline/:site/:only_media?', require('./routes/mastodon/timeline')); +// Kernel Aliyun +router.get('/aliyun-kernel/index', require('./routes/aliyun-kernel/index')); + module.exports = router; diff --git a/lib/routes/aliyun-kernel/index.js b/lib/routes/aliyun-kernel/index.js new file mode 100644 index 00000000000000..13297f2fd9af07 --- /dev/null +++ b/lib/routes/aliyun-kernel/index.js @@ -0,0 +1,60 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const baseUrl = 'https://kernel.taobao.org/'; + const response = await got({ + method: 'get', + url: baseUrl, + headers: { + Referer: baseUrl, + }, + }); + + const data = response.data; + const $ = cheerio.load(data); + const list = $('.container .post-item').get(); + + const ProcessFeed = (data) => { + const $ = cheerio.load(data); + + // 提取内容 + return $('.container .post-content').html(); + }; + + const items = await Promise.all( + list.map(async (item) => { + const $ = cheerio.load(item); + const $a = $('.article-title > a'); + const link = baseUrl + $a.attr('href'); + // const publish_time = $('.date-label').text(); + + const cache = await ctx.cache.get(link); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + + const response = await got({ + method: 'get', + url: link, + }); + + const description = ProcessFeed(response.data); + + const single = { + title: $a.text(), + description, + link: link, + // pubDate: publish_time, + }; + ctx.cache.set(link, JSON.stringify(single)); + return Promise.resolve(single); + }) + ); + + ctx.state.data = { + title: 'Kernel Aliyun', + link: baseUrl, + item: items, + }; +};
99b50faa40df6bc7ad5b064cf3467f7f54cf4aaa
2022-03-03 19:46:14
Holegots
feat(route): add tokeninsight (#8725)
false
add tokeninsight (#8725)
feat
diff --git a/docs/en/finance.md b/docs/en/finance.md index 935b14710b9e73..2e63d0d0cf5885 100644 --- a/docs/en/finance.md +++ b/docs/en/finance.md @@ -16,6 +16,28 @@ pageClass: routes <RouteEn author="HenryQW" example="/finviz/news/AAPL" path="/finviz/news/:ticker" :paramsDesc="['The stock ticker']"/> +## TokenInsight + +### Blogs + +<RouteEn author="fuergaosi233" example="/tokeninsight/blog/en" path="/tokeninsight/blog/:lang?" :paramsDesc="['Language, see below, Chinese by default']" /> + +### Latest + +<RouteEn author="fuergaosi233" example="/tokeninsight/bulletin/en" path="/tokeninsight/bulletin/:lang?" :paramsDesc="['Language, see below, Chinese by default']" /> + +### Research + +<RouteEn author="fuergaosi233" example="/tokeninsight/report/en" path="/tokeninsight/report/:lang?" :paramsDesc="['Language, see below, Chinese by default']"> + +Language: + +| Chinese | English | +| ------- | ------- | +| zh | en | + +</RouteEn> + ## World Economic Forum ### Report diff --git a/docs/finance.md b/docs/finance.md index 423e7cd1ef9d45..e0442b6e153e16 100644 --- a/docs/finance.md +++ b/docs/finance.md @@ -38,6 +38,28 @@ pageClass: routes <Route author="HenryQW" example="/finviz/news/AAPL" path="/finviz/news/:ticker" :paramsDesc="['股票代码']"/> +## TokenInsight + +### 博客 + +<Route author="fuergaosi233" example="/tokeninsight/blog" path="/tokeninsight/blog/:lang?" :paramsDesc="['语言,见下表,默认为简体中文']" /> + +### 快讯 + +<Route author="fuergaosi233" example="/tokeninsight/bulletin" path="/tokeninsight/bulletin/:lang?" :paramsDesc="['语言,见下表,默认为简体中文']" /> + +### 报告 + +<Route author="fuergaosi233" example="/tokeninsight/report" path="/tokeninsight/report/:lang?" :paramsDesc="['语言,见下表,默认为简体中文']"> + +语言 + +| 中文 | 英文 | +| -- | -- | +| zh | en | + +</Route> + ## WEEX 华尔街见闻旗下全球投资线上品牌 ### 资讯 diff --git a/lib/v2/tokeninsight/blog.js b/lib/v2/tokeninsight/blog.js new file mode 100644 index 00000000000000..f2c72a1871c44a --- /dev/null +++ b/lib/v2/tokeninsight/blog.js @@ -0,0 +1,52 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const baseURL = 'https://www.tokeninsight.com/'; +const title = 'TokenInsight'; +const link = 'https://www.tokeninsight.com/'; + +module.exports = async (ctx) => { + const lang = ctx.params.lang ?? 'zh'; + + const getBlogs = async () => { + const url = `${baseURL}api/user/search/getAllList`; + const response = ( + await got.post(url, { + form: { + isRecommend: 2, + language: lang === 'zh' ? 'cn' : lang, + }, + }) + ).data; + return response.data.blogsList; + }; + + const getBlogInfomation = async (blog) => { + const { publishDate, title, id } = blog; + const blogUrl = `${baseURL}${lang}/blogs/${id}`; + const description = await ctx.cache.tryGet(blogUrl, async () => { + const res = await got(blogUrl); + const $ = cheerio.load(res.data); + const description = $('.detail_html_box').html(); + return description; + }); + return { + // 文章标题 + title, + // 文章正文 + description, + // 文章发布时间 + pubDate: parseDate(publishDate), + // 文章链接 + link: blogUrl, + }; + }; + const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 30; + const blogs = (await getBlogs()).slice(0, limit); + const list = await Promise.all(blogs.map(getBlogInfomation)); + ctx.state.data = { + title: `${lang === 'zh' ? '博客' : 'Blogs'} | ${title}`, + link: `${link}${lang}/blogs`, + item: list, + }; +}; diff --git a/lib/v2/tokeninsight/bulletin.js b/lib/v2/tokeninsight/bulletin.js new file mode 100644 index 00000000000000..ed09b93c46dedb --- /dev/null +++ b/lib/v2/tokeninsight/bulletin.js @@ -0,0 +1,44 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const baseURL = 'https://www.tokeninsight.com/'; +const title = 'TokenInsight'; +const link = 'https://www.tokeninsight.com/'; +const get_articles = async () => { + const url = `${baseURL}api/bulletin/selectBulletinList`; + const response = (await got.get(url)).data; + const { data } = response; + return data; +}; + +module.exports = async (ctx) => { + const lang = ctx.params.lang ?? 'zh'; + + const get_article_info = async (article) => { + const { updateDate, titleEn, id, title } = article; + const articleUrl = `${baseURL}${lang}/latest/${id}`; + const description = await ctx.cache.tryGet(articleUrl, async () => { + const res = await got(articleUrl); + const $ = cheerio.load(res.data); + return $('.detail_html_box').html(); + }); + return { + // 文章标题 + title: lang === 'zh' ? title : titleEn, + // 文章正文 + description, + // 文章发布时间 + pubDate: parseDate(updateDate), + // 文章链接 + link: articleUrl, + }; + }; + + const articles = await get_articles(); + const list = await Promise.all(articles.map(get_article_info)); + ctx.state.data = { + title: `${lang === 'zh' ? '快讯' : 'Latest'} | ${title}`, + link: `${link}${lang}/latest`, + item: list, + }; +}; diff --git a/lib/v2/tokeninsight/maintainer.js b/lib/v2/tokeninsight/maintainer.js new file mode 100644 index 00000000000000..24fc185a6b27a0 --- /dev/null +++ b/lib/v2/tokeninsight/maintainer.js @@ -0,0 +1,5 @@ +module.exports = { + '/blog/:lang?': ['fuergaosi233'], + '/bulletin:lang?': ['fuergaosi233'], + '/report:lang?': ['fuergaosi233'], +}; diff --git a/lib/v2/tokeninsight/radar.js b/lib/v2/tokeninsight/radar.js new file mode 100644 index 00000000000000..e3e33dcc6ae6b3 --- /dev/null +++ b/lib/v2/tokeninsight/radar.js @@ -0,0 +1,25 @@ +module.exports = { + 'tokeninsight.com': { + _name: 'TokenInsight', + '.': [ + { + title: '博客', + docs: 'https://docs.rsshub.app/new-media.html#tokeninsight', + source: ['/:lang/blogs'], + target: '/tokeninsight/blog/:lang', + }, + { + title: '快讯', + docs: 'https://docs.rsshub.app/new-media.html#tokeninsight', + source: ['/:lang/latest'], + target: '/tokeninsight/bulletin/:lang', + }, + { + title: '报告', + docs: 'https://docs.rsshub.app/new-media.html#tokeninsight', + source: ['/:lang/report'], + target: '/tokeninsight/report/:lang', + }, + ], + }, +}; diff --git a/lib/v2/tokeninsight/report.js b/lib/v2/tokeninsight/report.js new file mode 100644 index 00000000000000..ef7e6b39c74c7f --- /dev/null +++ b/lib/v2/tokeninsight/report.js @@ -0,0 +1,52 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const baseURL = 'https://www.tokeninsight.com/'; +const title = 'TokenInsight'; +const link = 'https://www.tokeninsight.com/'; + +module.exports = async (ctx) => { + const lang = ctx.params.lang ?? 'zh'; + + const getReports = async () => { + const url = `${baseURL}api/user/search/getAllList`; + const response = ( + await got.post(url, { + form: { + isRecommend: 2, + language: lang === 'zh' ? 'cn' : lang, + }, + }) + ).data; + return response.data.reportList; + }; + + const getReportInfomation = async (report) => { + const { publishDate, title, id } = report; + const reportUrl = `${baseURL}${lang}/report/${id}`; + const description = await ctx.cache.tryGet(reportUrl, async () => { + const res = await got(reportUrl); + const $ = cheerio.load(res.data); + const description = $('.detail_html_box').html(); + return description; + }); + return { + // 文章标题 + title, + // 文章正文 + description, + // 文章发布时间 + pubDate: parseDate(publishDate), + // 文章链接 + link: reportUrl, + }; + }; + const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 30; + const reports = (await getReports()).slice(0, limit); + const list = await Promise.all(reports.map(getReportInfomation)); + ctx.state.data = { + title: `${lang === 'zh' ? '报告' : 'Research'} | ${title}`, + link: `${link}${lang}/report`, + item: list, + }; +}; diff --git a/lib/v2/tokeninsight/router.js b/lib/v2/tokeninsight/router.js new file mode 100644 index 00000000000000..c6b6c9fa3e51e4 --- /dev/null +++ b/lib/v2/tokeninsight/router.js @@ -0,0 +1,5 @@ +module.exports = (router) => { + router.get('/blog/:lang?', require('./blog.js')); + router.get('/bulletin/:lang?', require('./bulletin.js')); + router.get('/report/:lang?', require('./report.js')); +};
b86b8a4e3ef8808a5f897b75a4872552cf94916a
2024-07-16 17:39:39
dependabot[bot]
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 7.16.0 to 7.16.1 (#16181)
false
bump @typescript-eslint/eslint-plugin from 7.16.0 to 7.16.1 (#16181)
chore
diff --git a/package.json b/package.json index aa5ab171b8d973..e937b4f08f0290 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,7 @@ "@types/title": "3.4.3", "@types/tough-cookie": "4.0.5", "@types/uuid": "10.0.0", - "@typescript-eslint/eslint-plugin": "7.16.0", + "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", "@vercel/nft": "0.27.3", "@vitest/coverage-v8": "2.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d76e6c958236f..691a485e804687 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -343,8 +343,8 @@ importers: specifier: 10.0.0 version: 10.0.0 '@typescript-eslint/eslint-plugin': - specifier: 7.16.0 - version: 7.16.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) + specifier: 7.16.1 + version: 7.16.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) '@typescript-eslint/parser': specifier: 7.16.1 version: 7.16.1([email protected])([email protected]) @@ -2161,8 +2161,8 @@ packages: '@types/[email protected]': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -2182,16 +2182,12 @@ packages: typescript: optional: true - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/[email protected]': resolution: {integrity: sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -2200,23 +2196,10 @@ packages: typescript: optional: true - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/[email protected]': resolution: {integrity: sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/[email protected]': resolution: {integrity: sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2226,22 +2209,12 @@ packages: typescript: optional: true - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - '@typescript-eslint/[email protected]': resolution: {integrity: sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/[email protected]': resolution: {integrity: sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -9404,14 +9377,14 @@ snapshots: '@types/node': 20.14.10 optional: true - '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': + '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': dependencies: '@eslint-community/regexpp': 4.11.0 '@typescript-eslint/parser': 7.16.1([email protected])([email protected]) - '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) - '@typescript-eslint/visitor-keys': 7.16.0 + '@typescript-eslint/scope-manager': 7.16.1 + '@typescript-eslint/type-utils': 7.16.1([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.1([email protected])([email protected]) + '@typescript-eslint/visitor-keys': 7.16.1 eslint: 9.7.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -9435,20 +9408,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/[email protected]': - dependencies: - '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/visitor-keys': 7.16.0 - '@typescript-eslint/[email protected]': dependencies: '@typescript-eslint/types': 7.16.1 '@typescript-eslint/visitor-keys': 7.16.1 - '@typescript-eslint/[email protected]([email protected])([email protected])': + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 7.16.1([email protected]) + '@typescript-eslint/utils': 7.16.1([email protected])([email protected]) debug: 4.3.5 eslint: 9.7.0 ts-api-utils: 1.3.0([email protected]) @@ -9457,25 +9425,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/[email protected]': {} - '@typescript-eslint/[email protected]': {} - '@typescript-eslint/[email protected]([email protected])': - dependencies: - '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/visitor-keys': 7.16.0 - debug: 4.3.5 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.2 - ts-api-utils: 1.3.0([email protected]) - optionalDependencies: - typescript: 5.5.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/[email protected]([email protected])': dependencies: '@typescript-eslint/types': 7.16.1 @@ -9491,17 +9442,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/[email protected]([email protected])([email protected])': - dependencies: - '@eslint-community/eslint-utils': 4.4.0([email protected]) - '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) - eslint: 9.7.0 - transitivePeerDependencies: - - supports-color - - typescript - '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: '@eslint-community/eslint-utils': 4.4.0([email protected]) @@ -9513,11 +9453,6 @@ snapshots: - supports-color - typescript - '@typescript-eslint/[email protected]': - dependencies: - '@typescript-eslint/types': 7.16.0 - eslint-visitor-keys: 3.4.3 - '@typescript-eslint/[email protected]': dependencies: '@typescript-eslint/types': 7.16.1
afe13f53433863ac2328bb3ac24a74629b5ac351
2020-12-04 21:26:45
Ethan Shen
fix: 白鲸出海 (#6328)
false
白鲸出海 (#6328)
fix
diff --git a/lib/routes/baijing/index.js b/lib/routes/baijing/index.js index c14bf1e1b50021..313ac611c81a1b 100644 --- a/lib/routes/baijing/index.js +++ b/lib/routes/baijing/index.js @@ -1,43 +1,34 @@ const got = require('@/utils/got'); +const date = require('@/utils/date'); module.exports = async (ctx) => { const response = await got({ - method: 'post', + method: 'get', url: 'http://www.baijingapp.com/api/get_more_articles/', - responseType: 'json', - form: { - deviceid: 'ios', - page: 1, - }, }); - const resList = response.data; + const data = JSON.parse(response.data.substr(1, response.data.length - 1)); - // json字符串转json对象 - const resListObj = new Function('return ' + resList)(); - - if (resListObj.state === 1) { - const output = resListObj.data.list.map((item) => { - const title = item.title; - const link = 'https://www.baijingapp.com/article/' + item.id; - const time = item.time; - const author = item.user_name; - const image = item.image; - const single = { - title, - link, - time, - author, - image, - }; + const output = data.data.list.map((item) => { + const title = item.title; + const link = 'https://www.baijingapp.com/article/' + item.id; + const pubDate = date(item.time.replace(' ', '')); + const author = item.user_name; + const description = `<img src="${item.image}">`; + const single = { + title, + link, + pubDate, + author, + description, + }; - return single; - }); + return single; + }); - ctx.state.data = { - title: `白鲸出海`, - desription: '白鲸出海 - 泛互联网出海服务平台', - item: output, - }; - } + ctx.state.data = { + title: `白鲸出海`, + desription: '白鲸出海 - 泛互联网出海服务平台', + item: output, + }; };