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
08ed767a1ae221e79cb53f3da8b703999352ae96
2020-03-07 22:48:04
hoilc
feat: add matters latest date (#4179)
false
add matters latest date (#4179)
feat
diff --git a/lib/routes/matters/latest.js b/lib/routes/matters/latest.js index 33c9c2909453bf..0aa771353d5fc8 100644 --- a/lib/routes/matters/latest.js +++ b/lib/routes/matters/latest.js @@ -38,6 +38,7 @@ module.exports = async (ctx) => { link, description: article, author: node.author.userName, + pubDate: node.createdAt, }; ctx.cache.set(link, JSON.stringify(single)); @@ -47,6 +48,7 @@ module.exports = async (ctx) => { ctx.state.data = { title: 'Matters | 最新文章', + link: 'https://matters.news/', item: items, }; };
5dbe12de39cd0c235e56180df649cc492f868d11
2024-09-27 23:10:28
Tony
fix: remove unlisted query
false
remove unlisted query
fix
diff --git a/lib/routes/bjnews/cat.ts b/lib/routes/bjnews/cat.ts index 25e7fefb4f8538..4ce068e8fc0183 100644 --- a/lib/routes/bjnews/cat.ts +++ b/lib/routes/bjnews/cat.ts @@ -35,7 +35,7 @@ async function handler(ctx) { category: $(a).parent().find('.source').text().trim(), })); - const out = await asyncPoolAll(ctx.req.query('pool') ? Number.parseInt(ctx.req.query('pool')) : 1, list, (item) => fetchArticle(item)); + const out = await asyncPoolAll(2, list, (item) => fetchArticle(item)); return { title: `新京报 - 分类 - ${$('.cur').text().trim()}`, link: url, diff --git a/lib/routes/ttv/index.ts b/lib/routes/ttv/index.ts index 042c693a9363e6..b670f0104ac556 100644 --- a/lib/routes/ttv/index.ts +++ b/lib/routes/ttv/index.ts @@ -34,7 +34,7 @@ async function handler(ctx) { const $ = load(response.data); let items = $('div.news-list li') - .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.query.limit) : 30) + .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 30) .toArray() .map((item) => { item = $(item);
14e948112fe3fad724eb93790efb2ffa5ea0d81f
2020-11-08 06:51:41
Ethan Shen
feat: add 未名新闻 (#6109)
false
add 未名新闻 (#6109)
feat
diff --git a/docs/new-media.md b/docs/new-media.md index 1aefa6ac9a0a37..43cbac6c17a338 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1419,6 +1419,18 @@ column 为 third 时可选的 category: <Route author="HenryQW" example="/wikipedia/mainland" path="/wikipedia/mainland"/> +## 未名新闻 + +### 分类 + +<Route author="nczitzk" example="/mitbbs" path="/mitbbs/:caty?" :paramsDesc="['新闻分类,参见下表,默认为“新闻大杂烩”']"> + +| 新闻大杂烩 | 军事 | 国际 | 体育 | 娱乐 | 科技 | 财经 | +| ---------- | -------- | ------ | ---- | ---- | ---- | ------- | +| | zhongguo | haiwai | tiyu | yule | keji | caijing | + +</Route> + ## 微信 ::: tip 提示 diff --git a/lib/router.js b/lib/router.js index 768bb01286c65c..384c7d81cb2da2 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3468,6 +3468,9 @@ router.get('/grandchallenge/challenges', require('./routes/grandchallenge/challe // 西北工业大学 router.get('/nwpu/:column', require('./routes/nwpu/index')); +// 未名新闻 +router.get('/mitbbs/:caty?', require('./routes/mitbbs/index')); + // 8kcos router.get('/8kcos/', require('./routes/8kcos/latest')); router.get('/8kcos/cat/:cat*', require('./routes/8kcos/cat')); diff --git a/lib/routes/mitbbs/index.js b/lib/routes/mitbbs/index.js new file mode 100644 index 00000000000000..7f374f0dc0ec57 --- /dev/null +++ b/lib/routes/mitbbs/index.js @@ -0,0 +1,55 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const iconv = require('iconv-lite'); + +module.exports = async (ctx) => { + const caty = ctx.params.caty || ''; + const rootUrl = 'http://www.mitbbs.com'; + const currentUrl = `${rootUrl}/${caty === '' ? 'news/mitbbs_news_zahui.php' : 'news_pg/' + ctx.params.caty + '.html'}`; + const response = await got({ + method: 'get', + url: currentUrl, + responseType: 'buffer', + }); + + const $ = cheerio.load(iconv.decode(response.data, 'gb2312')); + const list = $('tr[align="center"] td a.blue_14p_link, tr[bgcolor="#FFFFFF"] td a.blue_14p_link') + .slice(0, 10) + .map((_, item) => { + item = $(item); + return { + title: item.text(), + link: `${rootUrl}${item.attr('href')}`, + pubDate: new Date(item.find('div.weinei_left_con_line_date').text() + ' GMT+8').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, + responseType: 'buffer', + }); + const content = cheerio.load(iconv.decode(detailResponse.data, 'gb2312')); + + const dateTd = content('.black_32p').parent(); + dateTd.find('span, p').remove(); + + item.pubDate = new Date(dateTd.text().trim().replace(/年|月/g, '-').replace('日', ' ')).toUTCString(); + item.description = content('table').eq(5).find('table').eq(1).html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: `未名新闻 - ${caty === '' ? '新闻大杂烩' : $('strong').eq(1).text()}`, + link: currentUrl, + item: items, + }; +};
06f3964aafe63b3dd61318511023482222c640e5
2022-03-14 18:30:01
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/docs/en/programming.md b/docs/en/programming.md index 48bd46e4e29431..08936ea0570d5c 100644 --- a/docs/en/programming.md +++ b/docs/en/programming.md @@ -66,6 +66,16 @@ Category <RouteEn author="elxy" example="/bbcnewslabs/news" path="/bbcnewslabs/news"/> +## Bitbucket + +### Commits + +<RouteEn author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> + +### Tags + +<RouteEn author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> + ## Bitmovin ### Blog @@ -205,16 +215,6 @@ For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will gen <RouteEn author="zoenglinghou" example="/gitlab/tag/rluna-open-source%2Ffile-management%2Fowncloud/core/gitlab.com" path="/gitlab/tag/:namespace/:project/:host?" :paramsDesc="['owner or namespace. `/` needs to be replaced with `%2F`', 'project name', 'Gitlab instance hostname, default to gitlab.com']" /> -## Bitbucket - -### Commits - -<RouteEn author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> - -### Tags - -<RouteEn author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> - ## Gitpod ### Blog diff --git a/docs/programming.md b/docs/programming.md index 44c4aa74a7e436..eeedd748e5f619 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -80,6 +80,16 @@ Rated 对象 <Route author="elxy" example="/bbcnewslabs/news" path="/bbcnewslabs/news"/> +## Bitbucket + +### Commits + +<Route author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> + +### Tags + +<Route author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> + ## Bitmovin ### Blog @@ -283,16 +293,6 @@ GitHub 官方也提供了一些 RSS: <Route author="zoenglinghou" example="/gitlab/tag/rluna-open-source%2Ffile-management%2Fowncloud/core/gitlab.com" path="/gitlab/tag/:namespace/:project/:host?" :paramsDesc="['项目所有者或命名空间。斜杠`/`需要替代为`%2F`', '项目名称', '服务器地址,缺省为 gitlab.com']" /> -## Bitbucket - -### Commits - -<Route author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> - -### Tags - -<Route author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/> - ## Gitpod ### 博客
13a65b9118a735c4301fc0f94d65d76ea3c40f45
2023-09-28 01:52:21
Tony
fix(route): x-mol (#13428)
false
x-mol (#13428)
fix
diff --git a/lib/router.js b/lib/router.js index 2b5bf36a2e039e..82924afe5199cd 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1269,8 +1269,8 @@ router.get('/wineyun/:category', lazyloadRouteHandler('./routes/wineyun')); router.get('/kzfeed/topic/:id', lazyloadRouteHandler('./routes/kzfeed/topic')); // 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')); +// router.get('/x-mol/news/:tag?', lazyloadRouteHandler('./routes/x-mol/news.js')); +// router.get('/x-mol/paper/:type/:magazine', lazyloadRouteHandler('./routes/x-mol/paper')); // 知识分子 router.get('/zhishifenzi/news/:type?', lazyloadRouteHandler('./routes/zhishifenzi/news')); diff --git a/lib/routes/x-mol/news.js b/lib/routes/x-mol/news.js deleted file mode 100644 index 519cb4271dc5be..00000000000000 --- a/lib/routes/x-mol/news.js +++ /dev/null @@ -1,48 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const utils = require('./utils'); - -module.exports = async (ctx) => { - const tag = ctx.params.tag; - const path = tag ? `news/tag/${tag}` : 'news/index'; - const response = await got(path, { - method: 'GET', - prefixUrl: utils.host, - }); - const data = response.data; - const $ = cheerio.load(data); - - const title = $('title').text(); - const description = $('meta[name="description"]').attr('content'); - const newsitem = $('.newsitem'); - - const item = newsitem - .map((index, element) => { - const title = $(element).find('h3').find('a').text(); - const a = $(element).find('p').find('a'); - const link = utils.host + a.attr('href'); - const image = $(element).find('img').attr('src'); - const description = utils.setDesc(image, a.text()); - const span = $(element).find('.space-right-m30'); - const author = span.text().replace('来源:', '').trim(); - const date = utils.getDate(span.next().text()); - const pubDate = utils.transDate(date); - - const single = { - title, - link, - description, - author, - pubDate, - }; - return single; - }) - .get(); - - ctx.state.data = { - title, - link: response.url, - description, - item, - }; -}; diff --git a/lib/routes/x-mol/paper.js b/lib/routes/x-mol/paper.js deleted file mode 100644 index 86a919d86e5b16..00000000000000 --- a/lib/routes/x-mol/paper.js +++ /dev/null @@ -1,78 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const utils = require('./utils'); -const queryString = require('query-string'); - -module.exports = async (ctx) => { - const type = ctx.params.type; - const magazine = ctx.params.magazine; - const path = `paper/${type}/${magazine}`; - const response = await got(path, { - method: 'GET', - prefixUrl: utils.host, - headers: { - Cookie: 'closeFloatWindow=true; journalIndexViewType=list; journalSort=publishDate', - }, - }); - const data = response.data; - const $ = cheerio.load(data); - - const title = $('title').text(); - const description = $('meta[name="description"]').attr('content'); - const newsitem = $('.magazine-text'); - - const item = await Promise.all( - newsitem - .map(async (index, element) => { - const news = $(element); - - const a = news.find('.magazine-text-title').find('a'); - const title = a.text(); - const link = utils.host + a.attr('href'); - - const picId = news.find('.magazine-pic').attr('id'); - const noPic = utils.host + '/css/images/nothesispic.jpg'; - let imageUrl = noPic; - if (picId) { - const imageId = picId.substring(9); - const getLink = utils.host + '/attachment/getPaperImgUrl'; - imageUrl = - (await ctx.cache.tryGet(getLink + imageId, async () => { - const result = await got.get(getLink, { - headers: { 'X-Requested-With': 'XMLHttpRequest' }, - searchParams: queryString.stringify({ - attachmentId: imageId, - }), - }); - return result.data; - })) || noPic; - } - const image = imageUrl; - const text = $(element).find('.magazine-description').text(); - const description = utils.setDesc(image, text); - - const span = news.find('.magazine-text-atten'); - const arr = span.map((index, element) => $(element).text()).get(); - const author = arr[1]; - const date = utils.getDate(arr[0]); - const pubDate = utils.transDate(date); - - const single = { - title, - link, - description, - author, - pubDate, - }; - return Promise.resolve(single); - }) - .get() - ); - - ctx.state.data = { - title, - link: response.url, - description, - item, - }; -}; diff --git a/lib/routes/x-mol/utils.js b/lib/routes/x-mol/utils.js deleted file mode 100644 index dbe61a473bf834..00000000000000 --- a/lib/routes/x-mol/utils.js +++ /dev/null @@ -1,16 +0,0 @@ -const XmolUtils = { - host: 'https://www.x-mol.com', - transDate: (date) => new Date(`${date} GMT+0800`).toUTCString(), - getDate: (text) => { - const reg = /[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/; - if (typeof text === 'string') { - const arr = text.match(reg); - return arr && text.match(reg)[0]; - } else { - return null; - } - }, - setDesc: (image, text) => `<p><img src="${image}"></p><p>${text}</p>`, -}; - -module.exports = XmolUtils; diff --git a/lib/v2/x-mol/maintainer.js b/lib/v2/x-mol/maintainer.js new file mode 100644 index 00000000000000..faef32780b3c64 --- /dev/null +++ b/lib/v2/x-mol/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/news/:tag?': ['cssxsh'], + '/paper/:type/:magazine': ['cssxsh'], +}; diff --git a/lib/v2/x-mol/news.js b/lib/v2/x-mol/news.js new file mode 100644 index 00000000000000..d7d5fcfa835bf5 --- /dev/null +++ b/lib/v2/x-mol/news.js @@ -0,0 +1,63 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const utils = require('./utils'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); +const { art } = require('@/utils/render'); +const { join } = require('path'); + +module.exports = async (ctx) => { + const tag = ctx.params.tag; + const path = tag ? `news/tag/${tag}` : 'news/index'; + const link = new URL(path, utils.host).href; + const response = await got(link); + const data = response.data; + const $ = cheerio.load(data); + + const newsitem = $('.newsitem') + .toArray() + .map((element) => { + element = $(element); + const a = element.find('h3 a'); + const span = element.find('.space-right-m30'); + const author = span.text().replace('来源:', '').trim(); + + return { + title: a.text(), + link: new URL(a.attr('href'), utils.host).href, + description: art(join(__dirname, 'templates/description.art'), { + image: element.find('img').attr('src').split('?')[0], + text: element.find('.thsis-div a').text().trim(), + }), + author, + pubDate: span.next().length ? timezone(parseDate(span.next().text().trim()), 8) : undefined, + }; + }); + + const item = await Promise.all( + newsitem.map((item) => + ctx.cache.tryGet(item.link, async () => { + if (item.link.includes('outLinkByIdAndCode')) { + return item; + } + + const response = await got(item.link); + const $ = cheerio.load(response.data); + + const description = $('.newscontent'); + description.find('.detitemtit, .detposttiau').remove(); + + item.description = description.html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: response.url, + description: $('meta[name="description"]').attr('content'), + item, + }; +}; diff --git a/lib/v2/x-mol/paper.js b/lib/v2/x-mol/paper.js new file mode 100644 index 00000000000000..7e9701b36d23b9 --- /dev/null +++ b/lib/v2/x-mol/paper.js @@ -0,0 +1,73 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const utils = require('./utils'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); +const asyncPool = require('tiny-async-pool'); + +module.exports = async (ctx) => { + const { type, magazine } = ctx.params; + const path = `paper/${type}/${magazine}`; + const link = new URL(path, utils.host).href; + const response = await got(link, { + headers: { + Cookie: 'journalIndexViewType=grid', + }, + }); + const data = response.data; + const $ = cheerio.load(data); + + const newsItem = $('.magazine-model-content-new li') + .toArray() + .slice(0, ctx.query.limit ? parseInt(ctx.query.limit, 10) : 20) + .map((item) => { + item = $(item); + return { + title: item.find('.magazine-text-title a').text().trim(), + link: new URL(item.find('.magazine-model-btn a').first().attr('href'), utils.host).href, + pubDate: timezone( + parseDate( + item + .find('.magazine-text-atten') + .text() + .match(/\d{4}-\d{2}-\d{2}/)[0], + 8 + ) + ), + }; + }); + + const asyncPoolAll = async (...args) => { + const results = []; + for await (const result of asyncPool(...args)) { + results.push(result); + } + return results; + }; + + const item = await asyncPoolAll(2, newsItem, (element) => + ctx.cache.tryGet(element.link, async () => { + const response = await got(element.link); + const $ = cheerio.load(response.data); + + const description = $('.maga-content'); + element.doi = description.find('.itsmblue').eq(1).text().trim(); + + description.find('.itgaryfirst').remove(); + description.find('span').eq(0).remove(); + element.author = description.find('span').eq(0).text().trim(); + description.find('span').eq(0).remove(); + + element.description = description.html(); + + return element; + }) + ); + + ctx.state.data = { + title: $('title').text(), + link: response.url, + description: $('meta[name="description"]').attr('content'), + item, + }; +}; diff --git a/lib/v2/x-mol/radar.js b/lib/v2/x-mol/radar.js new file mode 100644 index 00000000000000..0e6d7af16e4479 --- /dev/null +++ b/lib/v2/x-mol/radar.js @@ -0,0 +1,25 @@ +module.exports = { + 'x-mol.com': { + _name: 'X-MOL', + '.': [ + { + title: 'News', + docs: 'https://docs.rsshub.app/study#x-mol', + source: ['/news/:area/tag/:tag'], + target: '/x-mol/news/:tag', + }, + { + title: 'News Index', + docs: 'https://docs.rsshub.app/study#x-mol', + source: ['/news/index'], + target: '/x-mol/news', + }, + { + title: 'Journal', + docs: 'https://docs.rsshub.app/journal#x-mol', + source: ['/paper/:area/tag/:type/journal/:magazine'], + target: '/x-mol/paper/geo/:type/:magazine', + }, + ], + }, +}; diff --git a/lib/v2/x-mol/router.js b/lib/v2/x-mol/router.js new file mode 100644 index 00000000000000..5d5588faae348b --- /dev/null +++ b/lib/v2/x-mol/router.js @@ -0,0 +1,4 @@ +module.exports = (router) => { + router.get('/news/:tag?', require('./news')); + router.get('/paper/:type/:magazine', require('./paper')); +}; diff --git a/lib/v2/x-mol/templates/description.art b/lib/v2/x-mol/templates/description.art new file mode 100644 index 00000000000000..e18d50115472ca --- /dev/null +++ b/lib/v2/x-mol/templates/description.art @@ -0,0 +1,6 @@ +{{ if image }} + <img src="{{ image }}"><br> +{{ /if }} +{{ if text }} + <p>{{ text }}</p> +{{ /if }} diff --git a/lib/v2/x-mol/utils.js b/lib/v2/x-mol/utils.js new file mode 100644 index 00000000000000..4455bd56cf236c --- /dev/null +++ b/lib/v2/x-mol/utils.js @@ -0,0 +1,3 @@ +module.exports = { + host: 'https://www.x-mol.com', +}; diff --git a/website/docs/routes/journal.md b/website/docs/routes/journal.md index 62cfba55104278..1fbbd40bc5c2c4 100644 --- a/website/docs/routes/journal.md +++ b/website/docs/routes/journal.md @@ -553,11 +553,11 @@ Return results from 2020 </Route> -## X-MOL Platform {#x-mol-platform} +## X-MOL {#x-mol} -### Journal {#x-mol-platform-journal} +### Journal {#x-mol-journal} -<Route author="cssxsh" example="/x-mol/paper/0/9" path="/x-mol/paper/:type/:magazine" paramsDesc={['type','magazine']} /> +<Route author="cssxsh" example="/x-mol/paper/0/9" path="/x-mol/paper/:type/:magazine" paramsDesc={['type','magazine']} anticrawler="1"/> ## 管理世界 {#guan-li-shi-jie}
fb9e3dda0094f3f6daf4beb52c868bd289cf695d
2019-10-09 10:19:24
luotao
docs: fix broken anchor link (#3219)
false
fix broken anchor link (#3219)
docs
diff --git a/docs/install/README.md b/docs/install/README.md index e73f22ce3175ab..8f8195c9565775 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -104,7 +104,7 @@ $ docker run -d --name rsshub -p 1200:1200 -e CACHE_EXPIRE=3600 -e GITHUB_ACCESS 该部署方式不包括 puppeteer 和 redis 依赖,如有需要请改用 Docker Compose 部署方式或自行部署外部依赖 -更多配置项请看 [#配置](#配置) +更多配置项请看 [#配置](#pei-zhi) ## 手动部署 @@ -172,7 +172,7 @@ CACHE_EXPIRE=600 该部署方式不包括 puppeteer 和 redis 依赖,如有需要请改用 Docker Compose 部署方式或自行部署外部依赖 -更多配置项请看 [#配置](#配置) +更多配置项请看 [#配置](#pei-zhi) ### 更新 @@ -298,7 +298,7 @@ $ docker run -d --name rsshub -p 1200:1200 pjf1996/rsshub:arm32v7 $ docker run -d --name rsshub -p 1200:1200 rsshub:arm32v7 ``` -其余参数见[使用 Docker 部署](#使用-Docker-部署) +其余参数见[使用 Docker 部署](#docker-bu-shu) ## 配置
d2905cf94409e04b92ea90f4e0dd99afb4cb9dd9
2024-11-10 16:07:30
Tony
docs: fix doc build
false
fix doc build
docs
diff --git a/lib/routes/deeplearning/the-batch.ts b/lib/routes/deeplearning/the-batch.ts index 3456d03f822d2a..11d50796b6a26d 100644 --- a/lib/routes/deeplearning/the-batch.ts +++ b/lib/routes/deeplearning/the-batch.ts @@ -145,14 +145,14 @@ export const route: Route = { handler, example: '/deeplearning/the-batch', parameters: { tag: 'Tag, Weekly Issues by default' }, - description: `:::tip + description: `::: tip If you subscribe to [Data Points](https://www.deeplearning.ai/the-batch/tag/data-points/),where the URL is \`https://www.deeplearning.ai/the-batch/tag/data-points/\`, extract the part \`https://www.deeplearning.ai/the-batch/tag\` to the end, which is \`data-points\`, and use it as the parameter to fill in. Therefore, the route will be [\`/deeplearning/the-batch/data-points\`](https://rsshub.app/deeplearning/the-batch/data-points). ::: | Tag | ID | | ---------------------------------------------------------------------- | -------------------------------------------------------------------- | - | [Weekly Issues](https://www.deeplearning.ai/the-batch/) | [<null>](https://rsshub.app/deeplearning/the-batch) | + | [Weekly Issues](https://www.deeplearning.ai/the-batch/) | [*null*](https://rsshub.app/deeplearning/the-batch) | | [Andrew's Letters](https://www.deeplearning.ai/the-batch/tag/letters/) | [letters](https://rsshub.app/deeplearning/the-batch/letters) | | [Data Points](https://www.deeplearning.ai/the-batch/tag/data-points/) | [data-points](https://rsshub.app/deeplearning/the-batch/data-points) | | [ML Research](https://www.deeplearning.ai/the-batch/tag/research/) | [research](https://rsshub.app/deeplearning/the-batch/research) |
a3b989c39d8a4f6d4d49c8fd3f57a6bea3fcfa48
2021-11-27 13:11:47
Ethan Shen
feat(route): add 香港高登 (#8109)
false
add 香港高登 (#8109)
feat
diff --git a/docs/new-media.md b/docs/new-media.md index 7a481a9827da23..10906e92612195 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -2644,6 +2644,56 @@ column 为 third 时可选的 category: </Route> +## 香港高登 + +### 頻道 + +<Route author="nczitzk" example="/hkgolden/BW" path="/hkgolden/:id?/:limit?/:sort?" :paramsDesc="['頻道,见下表,默认为吹水台,可在对应频道页的 URL 中找到', '類型,见下表,默认为全部', '排序,见下表,默认为最後回應時間']"> + +頻道 + +| 吹水台 | 高登熱 | 最新 | 時事台 | 娛樂台 | +| ------ | ------ | ---- | ------ | ------ | +| BW | HT | NW | CA | ET | + +| 體育台 | 財經台 | 學術台 | 講故台 | 創意台 | +| ------ | ------ | ------ | ------ | ------ | +| SP | FN | ST | SY | EP | + +| 硬件台 | 電訊台 | 軟件台 | 手機台 | Apps 台 | +| ------ | ------ | ------ | ------ | ------- | +| HW | IN | SW | MP | AP | + +| 遊戲台 | 飲食台 | 旅遊台 | 潮流台 | 動漫台 | +| ------ | ------ | ------ | ------ | ------ | +| GM | ED | TR | CO | AN | + +| 玩具台 | 音樂台 | 影視台 | 攝影台 | 汽車台 | +| ------ | ------ | ------ | ------ | ------ | +| TO | MU | VI | DC | TS | + +| 上班台 | 感情台 | 校園台 | 親子台 | 寵物台 | +| ------ | ------ | ------ | ------ | ------ | +| WK | LV | SC | BB | PT | + +| 站務台 | 電台 | 活動台 | 買賣台 | 直播台 | 成人台 | 考古台 | +| ------ | ---- | ------ | ------ | ------ | ------ | ------ | +| MB | RA | AC | BS | JT | AU | OP | + +排序 + +| 最後回應時間 | 發表時間 | 熱門 | +| ------------ | -------- | ---- | +| 0 | 1 | 2 | + +類型 + +| 全部 | 正式 | 公海 | +| ---- | ---- | ---- | +| -1 | 1 | 0 | + +</Route> + ## 香港討論區 ### 版塊 diff --git a/lib/router.js b/lib/router.js index e93233cf5cc4c1..cfbfb5a0585494 100644 --- a/lib/router.js +++ b/lib/router.js @@ -4210,6 +4210,9 @@ router.get('/right/forum/:id?', lazyloadRouteHandler('./routes/right/forum')); // 香港經濟日報 router.get('/hket/:category?', lazyloadRouteHandler('./routes/hket/index')); +// 香港高登 +router.get('/hkgolden/:id?/:limit?/:sort?', lazyloadRouteHandler('./routes/hkgolden')); + // 香港討論區 router.get('/discuss/:fid', lazyloadRouteHandler('./routes/discuss')); diff --git a/lib/routes/hkgolden/index.js b/lib/routes/hkgolden/index.js new file mode 100644 index 00000000000000..a56b2d4bac61fb --- /dev/null +++ b/lib/routes/hkgolden/index.js @@ -0,0 +1,110 @@ +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); +const dayjs = require('dayjs'); + +const channels = { + BW: '吹水台', + HT: '高登熱', + NW: '最 新', + CA: '時事台', + ET: '娛樂台', + SP: '體育台', + FN: '財經台', + ST: '學術台', + SY: '講故台', + EP: '創意台', + HW: '硬件台', + IN: '電訊台', + SW: '軟件台', + MP: '手機台', + AP: 'Apps台', + GM: '遊戲台', + ED: '飲食台', + TR: '旅遊台', + CO: '潮流台', + AN: '動漫台', + TO: '玩具台', + MU: '音樂台', + VI: '影視台', + DC: '攝影台', + TS: '汽車台', + WK: '上班台', + LV: '感情台', + SC: '校園台', + BB: '親子台', + PT: '寵物台', + MB: '站務台', + RA: '電 台', + AC: '活動台', + BS: '買賣台', + JT: '直播台', + AU: '成人台', + OP: '考古台', +}; + +const limits = { + '-1': '全部', + 1: '正式', + 0: '公海', +}; + +const sorts = { + 0: '最後回應時間', + 1: '發表時間', + 2: '熱門', +}; + +module.exports = async (ctx) => { + const id = ctx.params.id || 'BW'; + const sort = ctx.params.sort || '0'; + const limit = ctx.params.limit || '-1'; + + const rootUrl = 'https://forum.hkgolden.com'; + const apiRootUrl = 'https://api.hkgolden.com'; + const apiUrl = `${apiRootUrl}/v1/topics/HT/1?sort=${sort}&limit=${limit}`; + + const response = await got({ + method: 'get', + url: apiUrl, + }); + + const list = response.data.data.list.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 30).map((item) => ({ + link: item.id, + title: item.title, + author: item.authorName, + pubDate: parseDate(item.orderDate), + })); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: `${apiRootUrl}/v1/view/${item.link}`, + }); + + const data = detailResponse.data.data; + + item.link = `${rootUrl}/thread/${item.id}`; + item.description = + `<table border="1" cellspacing="0"><tr><td>${data.authorName}&nbsp(${dayjs(data.messageDate).format('YYYY-MM-DD hh:mm:ss')})</td></tr>` + + `<tr><td>${data.content.replace(/src="\/faces/g, 'src="https://assets.hkgolden.com/faces')}</td></tr>`; + + for (const reply of data.replies) { + item.description += + `<tr><td>${reply.authorName}&nbsp(${dayjs(reply.replyDate).format('YYYY-MM-DD hh:mm:ss')})</td></tr>` + `<tr><td>${reply.content.replace(/src="\/faces/g, 'src="https://assets.hkgolden.com/faces')}</td></tr>`; + } + + item.description += '</table>'; + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${channels[id]} (${sorts[sort]}|${limits[limit]}) - 香港高登`, + link: `${rootUrl}/channel/${id}`, + item: items, + }; +};
48626a813fe96bf4b7bef0b52399b8b88e9ae2a8
2023-07-23 19:01:30
DIYgod
fix: twitter keyword
false
twitter keyword
fix
diff --git a/lib/v2/twitter/web-api/constants.js b/lib/v2/twitter/web-api/constants.js index fe18ac2aae4e78..65d36deb03777e 100644 --- a/lib/v2/twitter/web-api/constants.js +++ b/lib/v2/twitter/web-api/constants.js @@ -67,8 +67,11 @@ const featuresMap = { }), }; +const auth = 'Bearer AAAAAAAAAAAAAAAAAAAAAFQODgEAAAAAVHTp76lzh3rFzcHbmHVvQxYYpTw%3DckAlMINMjmCwxUcaXbAN4XqJVdgMJaHqNOFgPMK0zN1qLqLQCF'; + module.exports = { tokens, graphQLMap, featuresMap, + auth, }; diff --git a/lib/v2/twitter/web-api/twitter-api.js b/lib/v2/twitter/web-api/twitter-api.js index e3ad4a9a8b545f..ecc4a7f5b6c2a3 100644 --- a/lib/v2/twitter/web-api/twitter-api.js +++ b/lib/v2/twitter/web-api/twitter-api.js @@ -1,6 +1,7 @@ const twitterGot = require('./twitter-got'); -const { graphQLMap, featuresMap } = require('./constants'); +const { graphQLMap, featuresMap, auth } = require('./constants'); const config = require('@/config').value; +const got = require('@/utils/got'); // https://github.com/mikf/gallery-dl/blob/a53cfc845e12d9e98fefd07e43ebffaec488c18f/gallery_dl/extractor/twitter.py#L727-L755 const _params = { @@ -104,13 +105,17 @@ const timelineLikes = (userId, params = {}) => paginationTweets(graphQLMap.Likes // https://github.com/mikf/gallery-dl/blob/a53cfc845e12d9e98fefd07e43ebffaec488c18f/gallery_dl/extractor/twitter.py#L858-L866 const timelineKeywords = (keywords, params = {}) => - twitterGot('https://twitter.com/i/api/2/search/adaptive.json', { - ..._params, - ...params, - q: keywords, - tweet_search_mode: 'live', - query_source: 'typed_query', - pc: 1, + got('https://api.twitter.com/1.1/search/universal.json', { + headers: { + Authorization: auth, + }, + searchParams: { + ..._params, + ...params, + q: keywords, + modules: 'status', + result_type: 'recent', + }, }); // https://github.com/mikf/gallery-dl/blob/a53cfc845e12d9e98fefd07e43ebffaec488c18f/gallery_dl/extractor/twitter.py#L795-L805 @@ -180,35 +185,6 @@ function gatherLegacyFromData(entries, filter = 'tweet-') { return tweets; } -function pickLegacyByID(id, tweets_dict, users_dict) { - function pickLegacyFromTweet(tweet) { - tweet.user = users_dict[tweet.user_id_str]; - if (tweet.retweeted_status_id_str) { - tweet.retweeted_status = pickLegacyFromTweet(tweets_dict[tweet.retweeted_status_id_str]); - } - return tweet; - } - - if (tweets_dict[id]) { - return pickLegacyFromTweet(tweets_dict[id]); - } -} - -function gatherLegacyFromLegacyApiData(data, filter = 'tweet-') { - const tweets_dict = data.globalObjects.tweets; - const users_dict = data.globalObjects.users; - const tweets = []; - data.timeline.instructions[0].addEntries.entries.forEach((entry) => { - if (entry.entryId && entry.entryId.indexOf(filter) !== -1) { - const tweet = pickLegacyByID(entry.content.item.content.tweet.id, tweets_dict, users_dict); - if (tweet) { - tweets.push(tweet); - } - } - }); - return tweets; -} - const getUserTweetsByID = async (id, params = {}) => gatherLegacyFromData(await timelineTweets(id, params)); const getUserTweetsAndRepliesByID = async (id, params = {}) => gatherLegacyFromData(await timelineTweetsAndReplies(id, params)); const getUserMediaByID = async (id, params = {}) => gatherLegacyFromData(await timelineMedia(id, params)); @@ -262,7 +238,7 @@ const getUserMedia = (cache, id, params = {}) => cacheTryGet(cache, id, params, const getUserLikes = (cache, id, params = {}) => cacheTryGet(cache, id, params, getUserLikesByID); const getUserTweet = (cache, id, params) => cacheTryGet(cache, id, params, getUserTweetByStatus); -const getSearch = async (keywords, params = {}) => gatherLegacyFromLegacyApiData(await timelineKeywords(keywords, params), 'sq-I-t-'); +const getSearch = async (keywords, params = {}) => (await timelineKeywords(keywords, params)).data.modules.map((module) => module.status.data); module.exports = { getUser,
8aa3b1ca153845a679cd8d0c03b4fb9789b15f47
2022-02-23 20:32:17
Ethan Shen
fix(route): Readhub (#8029)
false
Readhub (#8029)
fix
diff --git a/docs/new-media.md b/docs/new-media.md index a863739de5c36a..229262b9366f6b 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1012,11 +1012,11 @@ IPFS 网关有可能失效,那时候换成其他网关。 ### 分类 -<Route author="WhiteWorld" example="/readhub/category/topic" path="/readhub/category/:category" :paramsDesc="['分类名']"> +<Route author="WhiteWorld nczitzk" example="/readhub" path="/readhub/:category?" :paramsDesc="['分类,见下表,默认为热门话题']"> -| 热门话题 | 科技动态 | 开发者资讯 | 区块链快讯 | 每日早报 | -| ----- | ---- | -------- | ---------- | ----- | -| topic | news | technews | blockchain | daily | +| 热门话题 | 科技动态 | 技术资讯 | 区块链快讯 | 每日早报 | +| ----- | ---- | ---- | ---------- | ----- | +| topic | news | tech | blockchain | daily | </Route> diff --git a/lib/router.js b/lib/router.js index efb34e347f0489..c1ed5605630603 100644 --- a/lib/router.js +++ b/lib/router.js @@ -242,8 +242,9 @@ router.get('/v2ex/topics/:type', lazyloadRouteHandler('./routes/v2ex/topics')); router.get('/v2ex/post/:postid', lazyloadRouteHandler('./routes/v2ex/post')); router.get('/v2ex/tab/:tabid', lazyloadRouteHandler('./routes/v2ex/tab')); -// readhub -router.get('/readhub/category/:category', lazyloadRouteHandler('./routes/readhub/category')); +// Readhub migrated to v2 +// router.get('/readhub/category/:category?', lazyloadRouteHandler('./routes/readhub/index')); +// router.get('/readhub/:category?', lazyloadRouteHandler('./routes/readhub/index')); // f-droid router.get('/fdroid/apprelease/:app', lazyloadRouteHandler('./routes/fdroid/apprelease')); diff --git a/lib/routes/readhub/category.js b/lib/routes/readhub/category.js deleted file mode 100644 index 87de00158f2ccd..00000000000000 --- a/lib/routes/readhub/category.js +++ /dev/null @@ -1,102 +0,0 @@ -const got = require('@/utils/got'); -const dayjs = require('dayjs'); - -module.exports = async (ctx) => { - const category = ctx.params.category; - - let title; - let link; - let path = category; - switch (category) { - case 'topic': - title = '热门话题'; - link = 'https://readhub.cn/topics'; - break; - case 'news': - title = '科技动态'; - link = 'https://readhub.cn/news'; - break; - case 'technews': - title = '开发者资讯'; - link = 'https://readhub.cn/tech'; - break; - case 'blockchain': - title = '区块链快讯'; - link = 'https://readhub.cn/blockchain'; - break; - case 'daily': - title = '每日早报'; - link = 'https://readhub.cn/daily'; - break; - default: - break; - } - - if (path === 'daily') { - path = 'topic/daily'; - } - - const { - data: { data }, - } = await got({ - method: 'get', - url: `https://api.readhub.cn/${path}`, - }); - - const out = await Promise.all( - data.map(async (news) => { - const id = news.id; - let item; - if (category === 'topic' || category === 'daily') { - const link = `https://readhub.cn/topic/${id}`; - const cache = await ctx.cache.get(link); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - const { data } = await got.get(`https://api.readhub.cn/topic/${id}`); - let description = data.summary; - if (data.newsArray) { - description += '<br/><br/>媒体报道:'; - for (const one of data.newsArray) { - description += `<br/>${dayjs(new Date(one.publishDate)).format('YY-MM-DD')} ${one.siteName}: <a href='${one.mobileUrl || one.url}'>${one.title}</a>`; - } - } - if (data.timeline && data.timeline.topics) { - let type = '相关事件'; - if (data.timeline.commonEntities && data.timeline.commonEntities.length > 0) { - type = '事件追踪'; - } - description += `<br/><br/>${type}:`; - for (const one of data.timeline.topics) { - description += `<br/>${dayjs(new Date(one.createdAt)).format('YY-MM-DD')} <a href='https://readhub.cn/topic/${one.id}'>${one.title.trim()}</a>`; - } - } - item = { - title: data.title, - description: description.replace(new RegExp('\n', 'g'), '<br/>'), - pubDate: data.publishDate, - guid: id, - link, - }; - - ctx.cache.set(link, JSON.stringify(item)); - } else { - const description = news.summaryAuto || news.summary || news.title; - item = { - title: news.title, - description: description.replace(new RegExp('\n', 'g'), '<br/>'), - pubDate: news.publishDate, - guid: id, - link: news.url || news.mobileUrl, - }; - } - return item; - }) - ); - - ctx.state.data = { - title: `Readhub - ${title}`, - link, - item: out, - }; -}; diff --git a/lib/v2/readhub/index.js b/lib/v2/readhub/index.js new file mode 100644 index 00000000000000..652e503a7b6f8e --- /dev/null +++ b/lib/v2/readhub/index.js @@ -0,0 +1,94 @@ +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); + +const titles = { + topic: '热门话题', + news: '科技动态', + tech: '技术资讯', + blockchain: '区块链快讯', + daily: '每日早报', +}; + +module.exports = async (ctx) => { + let category = ctx.params.category ?? 'topic'; + category = category === 'technews' ? 'tech' : category; + + const rootUrl = 'https://readhub.cn'; + const apiRootUrl = 'https://api.readhub.cn'; + const currentUrl = `${rootUrl}/topic/${category}`; + const apiUrl = `${apiRootUrl}/${category === 'daily' ? 'topic/daily' : category}`; + + const response = await got({ + method: 'get', + url: apiUrl, + }); + + const list = response.data.data.map((item) => ({ + id: item.id, + title: item.title, + pubDate: parseDate(item.publishDate), + description: item.summaryAuto || item.summary || '', + link: item.url || item.mobileUrl || `${rootUrl}/topic/${item.id}`, + author: item.authorName || item.siteName || '', + hasInstantView: item.hasInstantView || false, + })); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.id, async () => { + if (item.hasInstantView || category === 'daily') { + const { data } = await got({ + method: 'get', + url: `${apiRootUrl}/topic/instantview?topicId=${item.id}`, + }); + + item.description = `<a href="${data.url}">访问原网址</a><br>${data.content}`; + } + + if (isNaN(item.id)) { + const { data } = await got({ + method: 'get', + url: `${apiRootUrl}/topic/${item.id}`, + }); + + if (data.newsArray) { + item.description += '<br><b>媒体报道</b><ul>'; + + for (const news of data.newsArray) { + item.description += + `<li><a href="${news.url || news.mobileUrl}">${news.title}</a>` + news.siteName + ? `&nbsp;&nbsp;<small><b>${news.siteName}</b></small>` + : '' + `${news.publishDate ? `&nbsp;&nbsp;<small>${news.publishDate.split('T')[0]}</small>` : ''}</li>`; + } + + item.description += '</ul>'; + } + + if (data.timeline && data.timeline.topics) { + const hasTimeline = data.timeline.commonEntities && data.timeline.commonEntities.length > 0; + + item.description += `<br><b>${hasTimeline ? '事件追踪' : '相关事件'}</b><ul>`; + + for (const news of data.timeline.topics) { + const createdAt = news.createdAt ? `<small>${news.createdAt.split('T')[0]}</small>` : ''; + + item.description += `<li>${hasTimeline ? `${createdAt}&nbsp;&nbsp;` : ''}<a href="${rootUrl}/topic/${news.id}">${news.title}</a>${hasTimeline ? '' : `&nbsp;&nbsp;${createdAt}`}</li>`; + } + + item.description += '</ul>'; + } + } + delete item.id; + delete item.hasInstantView; + + return item; + }) + ) + ); + + ctx.state.data = { + title: `Readhub - ${titles[category]}`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/readhub/maintainer.js b/lib/v2/readhub/maintainer.js new file mode 100644 index 00000000000000..56e8afdd95f8ae --- /dev/null +++ b/lib/v2/readhub/maintainer.js @@ -0,0 +1,3 @@ +module.export = { + '/:category?': ['WhiteWorld', 'nczitzk'], +}; diff --git a/lib/v2/readhub/radar.js b/lib/v2/readhub/radar.js new file mode 100644 index 00000000000000..95282159472a44 --- /dev/null +++ b/lib/v2/readhub/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'readhub.cn': { + _name: 'Readhub', + '.': [ + { + title: '分类', + docs: 'https://docs.rsshub.app/new-media.html#readhub', + source: '/', + target: '/readhub', + }, + ], + }, +}; diff --git a/lib/v2/readhub/router.js b/lib/v2/readhub/router.js new file mode 100644 index 00000000000000..aee28921f18fbf --- /dev/null +++ b/lib/v2/readhub/router.js @@ -0,0 +1,6 @@ +module.exports = (router) => { + // deprecated + router.get('/category/:category?', require('./index')); + + router.get('/:category?', require('./index')); +};
c457ec90afb42c930d5950317e4803671cb97f1e
2020-07-28 10:38:36
GitHub Action
style: auto format
false
auto format
style
diff --git a/lib/routes/hanime/video.js b/lib/routes/hanime/video.js index 725388c2c83de8..53d307d0d8d614 100644 --- a/lib/routes/hanime/video.js +++ b/lib/routes/hanime/video.js @@ -42,7 +42,10 @@ module.exports = async (ctx) => { title: videoEnglishName, description: 'Name: '.bold() + - videoEnglishName + ' (' + videoJapanseName + ')' + + videoEnglishName + + ' (' + + videoJapanseName + + ')' + '<br>' + 'Brand: '.bold() + videoBrand +
e94969b9b11146b19ad2e1ba19fbcd0d73d97758
2024-06-25 18:47:31
hywell
fix(route): XSIJISHE need login (#15984)
false
XSIJISHE need login (#15984)
fix
diff --git a/lib/config.ts b/lib/config.ts index 709efbede02ca7..9c9d09fc3eb434 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -284,6 +284,9 @@ export type Config = { ximalaya: { token?: string; }; + xsijishe: { + cookie?: string; + }; xueqiu: { cookies?: string; }; @@ -645,6 +648,9 @@ const calculateValue = () => { ximalaya: { token: envs.XIMALAYA_TOKEN, }, + xsijishe: { + cookie: envs.XSIJISHE_COOKIE, + }, xueqiu: { cookies: envs.XUEQIU_COOKIES, }, diff --git a/lib/routes/xsijishe/forum.ts b/lib/routes/xsijishe/forum.ts index fe332093ca7c13..b2731a342e6ffa 100644 --- a/lib/routes/xsijishe/forum.ts +++ b/lib/routes/xsijishe/forum.ts @@ -3,6 +3,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; +import { config } from '@/config'; const baseUrl = 'https://xsijishe.com'; export const route: Route = { @@ -11,7 +12,12 @@ export const route: Route = { example: '/xsijishe/forum/51', parameters: { fid: '子论坛 id' }, features: { - requireConfig: false, + requireConfig: [ + { + name: 'XSIJISHE_COOKIE', + description: '', + }, + ], requirePuppeteer: false, antiCrawler: false, supportBT: false, @@ -29,7 +35,14 @@ export const route: Route = { async function handler(ctx) { const fid = ctx.req.param('fid'); const url = `${baseUrl}/forum-${fid}-1.html`; - const resp = await got(url); + const headers = { + 'Accept-Encoding': 'gzip, deflate, br', + 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8', + Cookie: config.xsijishe.cookie, + }; + const resp = await got(url, { + headers, + }); const $ = load(resp.data); const forumCategory = $('.nex_bkinterls_top .nex_bkinterls_ls a').text(); let items = $('[id^="normalthread"]') @@ -51,7 +64,9 @@ async function handler(ctx) { items = await Promise.all( items.map((item) => cache.tryGet(item.link, async () => { - const resp = await got(item.link); + const resp = await got(item.link, { + headers, + }); const $ = load(resp.data); const firstViewBox = $('.t_f').first(); diff --git a/lib/routes/xsijishe/rank.ts b/lib/routes/xsijishe/rank.ts index fd95af2be76980..857aa9ff61ea40 100644 --- a/lib/routes/xsijishe/rank.ts +++ b/lib/routes/xsijishe/rank.ts @@ -53,7 +53,9 @@ async function handler(ctx) { items = await Promise.all( items.map((item) => cache.tryGet(item.link, async () => { - const resp = await got(item.link); + const resp = await got(item.link, { + headers, + }); const $ = load(resp.data); const firstViewBox = $('.t_f').first();
1819a4bedf2daf98ffbc41062a51b38c15f092c5
2018-07-13 14:55:35
DIYgod
rss: weibo format, remove "全文"; remove link icon; replace expression to text
false
weibo format, remove "全文"; remove link icon; replace expression to text
rss
diff --git a/routes/weibo/user.js b/routes/weibo/user.js index 31108120a8b323..fd0956ed0fc344 100644 --- a/routes/weibo/user.js +++ b/routes/weibo/user.js @@ -30,10 +30,11 @@ module.exports = async (ctx) => { link: `http://weibo.com/${uid}/`, description: `${name}的微博`, item: response.data.data.cards.filter((item) => item.mblog && !item.mblog.isTop).map((item) => { - const title = item.mblog.text.replace(/<img.*?>/g, '[图片]').replace(/<.*?>/g, ''); + const description = weiboUtils.format(item.mblog); + const title = description.replace(/<img.*?>/g, '[图片]').replace(/<.*?>/g, ''); return { title: title.length > 24 ? title.slice(0, 24) + '...' : title, - description: weiboUtils.format(item.mblog), + description: description, pubDate: weiboUtils.getTime(item.mblog.created_at), link: `https://weibo.com/${uid}/${item.mblog.bid}`, }; diff --git a/routes/weibo/utils.js b/routes/weibo/utils.js index 11c250425d7009..2c129a3b1fd13f 100644 --- a/routes/weibo/utils.js +++ b/routes/weibo/utils.js @@ -2,14 +2,12 @@ const weiboUtils = { format: (status) => { // 长文章的处理 let temp = (status.longText && status.longText.longTextContent.replace(/\n/g, '<br>')) || status.text || ''; - // 表情图标转换为文字 - temp = temp.replace(/<span class="url-icon"><img src=".*?" style="width:1em;height:1em;" alt="(.*?)"><\/span>/g, '$1'); // 去掉外部链接的图标 - temp = temp.replace(/<span class="url-icon"><img src=".*?"><\/span><\/i>/g, ''); - // 去掉多余无意义的标签 - temp = temp.replace(/<span class="surl-text">/g, ''); - // 最后插入两个空行,让转发的微博排版更加美观一些 - temp += '<br><br>'; + temp = temp.replace(/<span class=["|']url-icon["|']>.*?网页链接<\/span>/g, '网页链接'); + // 表情图标转换为文字 + temp = temp.replace(/<span class="url-icon"><img.*?alt="(.*?)".*?><\/span>/g, '$1'); + // 去掉全文 + temp = temp.replace(/全文<br>/g, '<br>'); // 处理外部链接 temp = temp.replace(/https:\/\/weibo\.cn\/sinaurl\/.*?&u=(http.*?")/g, function(match, p1) {
dc027e570e71c8a7d3f5382c07e2be9b18983dcf
2019-09-06 14:53:05
DIYgod
docs: add name in manifest
false
add name in manifest
docs
diff --git a/docs/.vuepress/public/manifest.json b/docs/.vuepress/public/manifest.json index f1d62b235ce8b4..7f32fa2193c272 100644 --- a/docs/.vuepress/public/manifest.json +++ b/docs/.vuepress/public/manifest.json @@ -1,6 +1,6 @@ { - "name": "", - "short_name": "", + "name": "RSSHub", + "short_name": "RSSHub", "icons": [ { "src": "/android-chrome-192x192.png",
b440547352a016e6ad6fc1952a1d01e3b4b79865
2022-06-20 18:20:16
DIYgod
fix: hotukdeals
false
hotukdeals
fix
diff --git a/lib/v2/hotukdeals/index.js b/lib/v2/hotukdeals/index.js index 1ec7f92827a06f..b112ff33f444ca 100644 --- a/lib/v2/hotukdeals/index.js +++ b/lib/v2/hotukdeals/index.js @@ -24,7 +24,7 @@ module.exports = async (ctx) => { item = $(item); return { title: item.find('.cept-tt').text(), - description: `${item.find('.cept-thread-image-link').html()}<br>${item.find('.cept-vote-temp').html()}<br>${item.find('.overflow--fade').html()}<br>${item.find('.cept-description-container').html()}`, + description: `${item.find('.thread-listImgCell').html()}<br>${item.find('.cept-vote-temp').html()}<br>${item.find('.overflow--fade').html()}<br>${item.find('.threadGrid-body .userHtml').html()}`, link: item.find('.cept-tt').attr('href'), }; })
bc031fecc2ec990d094de519c659c6fe9f16ee09
2023-08-19 00:03:43
dependabot[bot]
chore(deps): bump prism-react-renderer from 1.3.5 to 2.0.6 in /website (#13046)
false
bump prism-react-renderer from 1.3.5 to 2.0.6 in /website (#13046)
chore
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 1a18c770a96604..e5a0686d67bc5d 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -1,8 +1,9 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const { themes } = require('prism-react-renderer'); +const lightCodeTheme = themes.github; +const darkCodeTheme = themes.dracula; /** @type {import('@docusaurus/types').Config} */ const config = { diff --git a/website/package.json b/website/package.json index 3a40a495bd18bc..a02d8912129832 100644 --- a/website/package.json +++ b/website/package.json @@ -26,7 +26,7 @@ "markdown-it": "^13.0.1", "meilisearch-docsearch": "^0.4.7", "pinyin-pro": "3.16.3", - "prism-react-renderer": "^1.3.5", + "prism-react-renderer": "^2.0.6", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 725cec806d7fbc..5b2db5d3f623de 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -36,8 +36,8 @@ dependencies: specifier: 3.16.3 version: 3.16.3 prism-react-renderer: - specifier: ^1.3.5 - version: 1.3.5([email protected]) + specifier: ^2.0.6 + version: 2.0.6([email protected]) react: specifier: ^17.0.2 version: 17.0.2 @@ -3057,6 +3057,10 @@ packages: resolution: {integrity: sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==} dev: false + /@types/[email protected]: + resolution: {integrity: sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==} + dev: false + /@types/[email protected]: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} @@ -7273,6 +7277,16 @@ packages: react: 17.0.2 dev: false + /[email protected]([email protected]): + resolution: {integrity: sha512-ERzmAI5UvrcTw5ivfEG20/dYClAsC84eSED5p9X3oKpm0xPV4A5clFK1mp7lPIdKmbLnQYsPTGiOI7WS6gWigw==} + peerDependencies: + react: '>=16.0.0' + dependencies: + '@types/prismjs': 1.26.0 + clsx: 1.2.1 + react: 17.0.2 + dev: false + /[email protected]: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'}
42a2cb7408fdbbb1de369e151fbe6376dbd9d6db
2024-07-23 16:53:09
dependabot[bot]
chore(deps-dev): bump @typescript-eslint/parser from 7.16.1 to 7.17.0 (#16233)
false
bump @typescript-eslint/parser from 7.16.1 to 7.17.0 (#16233)
chore
diff --git a/package.json b/package.json index eb1460f038ef5d..421a4283de39d5 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.16.1", - "@typescript-eslint/parser": "7.16.1", + "@typescript-eslint/parser": "7.17.0", "@vercel/nft": "0.27.3", "@vitest/coverage-v8": "2.0.3", "eslint": "9.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9ab623160b30d0..126be3bb6520c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -344,10 +344,10 @@ importers: version: 10.0.0 '@typescript-eslint/eslint-plugin': specifier: 7.16.1 - version: 7.16.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) + 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]) + specifier: 7.17.0 + version: 7.17.0([email protected])([email protected]) '@vercel/nft': specifier: 0.27.3 version: 0.27.3 @@ -1281,8 +1281,8 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/[email protected]': - resolution: {integrity: sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==} + '@eslint/[email protected]': + resolution: {integrity: sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/[email protected]': @@ -1383,8 +1383,8 @@ packages: resolution: {integrity: sha512-m3YgGQlKNS0BM+8AFiJkCsTqHEFCWn6s/Rqye3mYwvqY6LdfUv12eSwbsgNzrYyrLXiy7IrrjDLPysaSBwEfhw==} engines: {node: '>=18'} - '@internationalized/[email protected]': - resolution: {integrity: sha512-qoVJVro+O0rBaw+8HPjUB1iH8Ihf8oziEnqMnvhJUSuVIrHOuZ6eNLHNvzXJKUvAtaDiqMnRlg8Z2mgh09BlUw==} + '@internationalized/[email protected]': + resolution: {integrity: sha512-H+CfYvOZ0LTJeeLOqm19E3uj/4YjrmOFtBufDHPfvtI80hFAMqtrp7oCACpe4Cil5l8S0Qu/9dYfZc/5lY8WQQ==} '@internationalized/[email protected]': resolution: {integrity: sha512-rd1wA3ebzlp0Mehj5YTuTI50AQEx80gWFyHcQu+u91/5NgdwBecO8BH6ipPfE+lmQ9d63vpB3H9SHoIUiupllw==} @@ -2172,8 +2172,8 @@ packages: typescript: optional: true - '@typescript-eslint/[email protected]': - resolution: {integrity: sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA==} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -2186,6 +2186,10 @@ packages: resolution: {integrity: sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2200,6 +2204,10 @@ packages: resolution: {integrity: sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2209,16 +2217,35 @@ packages: typescript: optional: true + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@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-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + '@typescript-eslint/[email protected]': resolution: {integrity: sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==} + engines: {node: ^18.18.0 || >=20.0.0} + '@uiw/[email protected]': resolution: {integrity: sha512-9fiji9xooZyBQozR1i6iTr56YP7j/Dr/VgsNWbqf5Szv+g+4WM1iZuiDGwNXmFMWX8gbkDzp6ASE21VCPSofWw==} peerDependencies: @@ -3319,8 +3346,8 @@ packages: [email protected]: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - [email protected]: - resolution: {integrity: sha512-cTen3SB0H2SGU7x467NRe1eVcQgcuS6jckKfWJHia2eo0cHIGOqHoAxevIYZD4eRHcWjkvFzo93bi3vJ9W+1lA==} + [email protected]: + resolution: {integrity: sha512-Vb3xHHYnLseK8vlMJQKJYXJ++t4u1/qJ3vykuVrVjvdiOEhYyT1AuP4x03G8EnPmYvYOhe9T+dADTmthjRQMkA==} [email protected]: resolution: {integrity: sha512-5gxbEjcb/Z2n6TTmXZx9wVi3N/DOzE7RXY3Xg9dakDuhX/izwumB9rGjeWUV6dTA0D0+juvo+JonZgNR9sgA5A==} @@ -6631,8 +6658,8 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - [email protected]: - resolution: {integrity: sha512-9tHNEa0Ov81YOopiVkcCJVz5TM6AEQ+CHHjFIktqPnE3NV0AHIkx+gh9tiCl58m/66wWxkOC9eltpa75J4lQPA==} + [email protected]: + resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} engines: {node: '>=16'} [email protected]: @@ -8178,7 +8205,7 @@ snapshots: '@eslint-community/[email protected]': {} - '@eslint/[email protected]': + '@eslint/[email protected]': dependencies: '@eslint/object-schema': 2.1.4 debug: 4.3.5 @@ -8309,7 +8336,7 @@ snapshots: dependencies: mute-stream: 1.0.0 - '@internationalized/[email protected]': + '@internationalized/[email protected]': dependencies: '@swc/helpers': 0.5.12 @@ -9087,7 +9114,7 @@ snapshots: '@stylistic/[email protected]([email protected])([email protected])': dependencies: '@types/eslint': 8.56.10 - '@typescript-eslint/utils': 7.16.1([email protected])([email protected]) + '@typescript-eslint/utils': 7.17.0([email protected])([email protected]) eslint: 9.7.0 transitivePeerDependencies: - supports-color @@ -9097,7 +9124,7 @@ snapshots: dependencies: '@stylistic/eslint-plugin-js': 2.3.0([email protected]) '@types/eslint': 8.56.10 - '@typescript-eslint/utils': 7.16.1([email protected])([email protected]) + '@typescript-eslint/utils': 7.17.0([email protected])([email protected]) eslint: 9.7.0 transitivePeerDependencies: - supports-color @@ -9377,10 +9404,10 @@ snapshots: '@types/node': 20.14.11 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/parser': 7.17.0([email protected])([email protected]) '@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]) @@ -9395,12 +9422,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.16.1 - '@typescript-eslint/types': 7.16.1 - '@typescript-eslint/typescript-estree': 7.16.1([email protected]) - '@typescript-eslint/visitor-keys': 7.16.1 + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0([email protected]) + '@typescript-eslint/visitor-keys': 7.17.0 debug: 4.3.5 eslint: 9.7.0 optionalDependencies: @@ -9413,6 +9440,11 @@ snapshots: '@typescript-eslint/types': 7.16.1 '@typescript-eslint/visitor-keys': 7.16.1 + '@typescript-eslint/[email protected]': + dependencies: + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: '@typescript-eslint/typescript-estree': 7.16.1([email protected]) @@ -9427,6 +9459,8 @@ snapshots: '@typescript-eslint/[email protected]': {} + '@typescript-eslint/[email protected]': {} + '@typescript-eslint/[email protected]([email protected])': dependencies: '@typescript-eslint/types': 7.16.1 @@ -9442,6 +9476,21 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/[email protected]([email protected])': + dependencies: + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + debug: 4.3.5 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0([email protected]) + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: '@eslint-community/eslint-utils': 4.4.0([email protected]) @@ -9453,11 +9502,27 @@ snapshots: - supports-color - typescript + '@typescript-eslint/[email protected]([email protected])([email protected])': + dependencies: + '@eslint-community/eslint-utils': 4.4.0([email protected]) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0([email protected]) + eslint: 9.7.0 + transitivePeerDependencies: + - supports-color + - typescript + '@typescript-eslint/[email protected]': dependencies: '@typescript-eslint/types': 7.16.1 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/[email protected]': + dependencies: + '@typescript-eslint/types': 7.17.0 + eslint-visitor-keys: 3.4.3 + '@uiw/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])': dependencies: '@codemirror/language': 6.10.2 @@ -9976,7 +10041,7 @@ snapshots: [email protected]: dependencies: caniuse-lite: 1.0.30001643 - electron-to-chromium: 1.4.832 + electron-to-chromium: 1.5.0 node-releases: 2.0.18 update-browserslist-db: 1.1.0([email protected]) @@ -10646,7 +10711,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -10936,7 +11001,7 @@ snapshots: dependencies: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@eslint-community/regexpp': 4.11.0 - '@eslint/config-array': 0.17.0 + '@eslint/config-array': 0.17.1 '@eslint/eslintrc': 3.1.0 '@eslint/js': 9.7.0 '@humanwhocodes/module-importer': 1.0.1 @@ -11535,7 +11600,7 @@ snapshots: lowercase-keys: 3.0.0 p-cancelable: 4.0.1 responselike: 3.0.0 - type-fest: 4.22.1 + type-fest: 4.23.0 [email protected]: {} @@ -12936,7 +13001,7 @@ snapshots: outvariant: 1.4.3 path-to-regexp: 6.2.2 strict-event-emitter: 0.5.1 - type-fest: 4.22.1 + type-fest: 4.23.0 yargs: 17.7.2 optionalDependencies: typescript: 5.5.3 @@ -13591,7 +13656,7 @@ snapshots: dependencies: '@floating-ui/dom': 1.6.8 '@floating-ui/vue': 1.1.2([email protected]([email protected])) - '@internationalized/date': 3.5.4 + '@internationalized/date': 3.5.5 '@internationalized/number': 3.5.3 '@tanstack/vue-virtual': 3.8.3([email protected]([email protected])) '@vueuse/core': 10.11.0([email protected]([email protected])) @@ -14596,7 +14661,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies:
709e001fdaebd3cf3da07ea9807e283d0b451729
2025-01-20 14:10:55
dependabot[bot]
chore(deps-dev): bump eslint-plugin-prettier from 5.2.2 to 5.2.3 (#18169)
false
bump eslint-plugin-prettier from 5.2.2 to 5.2.3 (#18169)
chore
diff --git a/package.json b/package.json index eeb23a4152e712..03b019fa831e19 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "eslint-config-prettier": "10.0.1", "eslint-nibble": "8.1.0", "eslint-plugin-n": "17.15.1", - "eslint-plugin-prettier": "5.2.2", + "eslint-plugin-prettier": "5.2.3", "eslint-plugin-unicorn": "56.0.1", "eslint-plugin-yml": "1.16.0", "fs-extra": "11.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd201a1071732d..180f63bddb27ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -389,8 +389,8 @@ importers: specifier: 17.15.1 version: 17.15.1([email protected]) eslint-plugin-prettier: - specifier: 5.2.2 - version: 5.2.2(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]) + specifier: 5.2.3 + version: 5.2.3(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]) eslint-plugin-unicorn: specifier: 56.0.1 version: 56.0.1([email protected]) @@ -3041,8 +3041,8 @@ packages: peerDependencies: eslint: '>=8.23.0' - [email protected]: - resolution: {integrity: sha512-1yI3/hf35wmlq66C8yOyrujQnel+v5l1Vop5Cl2I6ylyNTT1JbuUUnV3/41PzwTzcyDp/oF0jWE3HXvcH5AQOQ==} + [email protected]: + resolution: {integrity: sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -8625,7 +8625,7 @@ snapshots: minimatch: 9.0.5 semver: 7.6.3 - [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]): + [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]): dependencies: eslint: 9.18.0 prettier: 3.4.2
0267307782c27bad13e7d14ffe262d1de7f833d4
2020-01-12 22:27:04
dependabot-preview[bot]
chore(deps-dev): bump nodejieba from 2.3.3 to 2.3.5
false
bump nodejieba from 2.3.3 to 2.3.5
chore
diff --git a/package.json b/package.json index 90e7fa66983c28..96edc9fba37d1b 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "jest": "24.9.0", "mockdate": "2.0.5", "nock": "11.7.2", - "nodejieba": "2.3.3", + "nodejieba": "2.3.5", "nodemon": "2.0.2", "pinyin": "2.9.0", "prettier": "1.19.1", diff --git a/yarn.lock b/yarn.lock index 3ad95fdc5ab2ea..3112046237255b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7715,6 +7715,22 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" +node-pre-gyp@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" + integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4.4.2" + node-releases@^1.1.21: version "1.1.22" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.22.tgz#d90cd5adc59ab9b0f377d4f532b09656399c88bf" @@ -7722,12 +7738,13 @@ node-releases@^1.1.21: dependencies: semver "^5.3.0" [email protected], nodejieba@^2.2.1: - version "2.3.3" - resolved "https://registry.yarnpkg.com/nodejieba/-/nodejieba-2.3.3.tgz#743fc196875b875822e22a299353cac8e0d04777" - integrity sha512-HHLydPGYQawaA2kQnrx/wSM/suvd4efe/7XrVwYhXL2b2SEqO8O7ks0On5Xhc/wQKUp1OTwxKy7BYOwkt3CMgw== [email protected], nodejieba@^2.2.1: + version "2.3.5" + resolved "https://registry.yarnpkg.com/nodejieba/-/nodejieba-2.3.5.tgz#c5129dc178cebb1e2eee1f48ae71eabfade015cd" + integrity sha512-vaXcSQFfv6ewHSA9fWIdZf7evUOGR+QGFcxdNKl6Rg1DSRvlQDF4o4cI5Xu0XYHX7MmEf/VXn1PmW6yg8z5QYw== dependencies: nan "^2.14.0" + node-pre-gyp "^0.14.0" [email protected]: version "6.4.0" @@ -10369,7 +10386,7 @@ tapable@^1.0.0, tapable@^1.1.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar@^4: +tar@^4, tar@^4.4.2: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
92f2040f2ca27716cd45d1fec8378f5af68c15cf
2019-08-16 09:14:53
busyrat
feat(radar): add juejin.im (#2864)
false
add juejin.im (#2864)
feat
diff --git a/assets/radar-rules.js b/assets/radar-rules.js index ccb281d5f65ac8..00c8167b805f5f 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -360,4 +360,15 @@ }, ], }, + 'juejin.im': { + _name: '掘金', + '.': [ + { + title: '专栏', + docs: 'https://docs.rsshub.app/programming.html#%E4%B8%93%E6%A0%8F', + source: '/user/:id/posts', + target: '/juejin/posts/:id', + }, + ], + }, }); diff --git a/docs/programming.md b/docs/programming.md index 55f2ea4fbe9201..44b0140d4bd426 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -334,7 +334,7 @@ GitHub 官方也提供了一些 RSS: ### 专栏 -<Route author="Maecenas" example="/juejin/posts/56852b2460b2a099cdc1d133" path="/juejin/posts/:id" :paramsDesc="['用户 id, 可在用户页 URL 中找到']"/> +<Route author="Maecenas" example="/juejin/posts/56852b2460b2a099cdc1d133" path="/juejin/posts/:id" :paramsDesc="['用户 id, 可在用户页 URL 中找到']" radar="1"/> ### 收藏集
a7cbbf559b4c7518474fac73376e121bd245064c
2023-02-24 19:29:57
Tony
fix(route): xiaohongshu user (#11949)
false
xiaohongshu user (#11949)
fix
diff --git a/docs/social-media.md b/docs/social-media.md index a0c91623e8df59..864003685b9960 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -1507,9 +1507,9 @@ rule <Route author="lotosbin" example="/xiaohongshu/user/593032945e87e77791e03696/notes" path="/xiaohongshu/user/:user_id/notes" :paramsDesc="['用户 ID']" puppeteer="1" anticrawler="1" radar="1" rssbud="1"/> -### 用户专辑 +### 用户收藏 -<Route author="lotosbin" example="/xiaohongshu/user/593032945e87e77791e03696/album" path="/xiaohongshu/user/:user_id/album" :paramsDesc="['用户 ID']" puppeteer="1" anticrawler="1" radar="1" rssbud="1"/> +<Route author="lotosbin" example="/xiaohongshu/user/593032945e87e77791e03696/collect" path="/xiaohongshu/user/:user_id/collect" :paramsDesc="['用户 ID']" puppeteer="1" anticrawler="1" radar="1" rssbud="1"/> ### 专辑 diff --git a/lib/v2/xiaohongshu/board.js b/lib/v2/xiaohongshu/board.js index d4c2bfbd417d95..b25526feee3377 100644 --- a/lib/v2/xiaohongshu/board.js +++ b/lib/v2/xiaohongshu/board.js @@ -1,14 +1,15 @@ const { parseDate } = require('@/utils/parse-date'); const timezone = require('@/utils/timezone'); -const { getContent } = require('./util'); +const { getBoard } = require('./util'); module.exports = async (ctx) => { const url = `https://www.xiaohongshu.com/board/${ctx.params.board_id}`; - const main = await getContent(url, ctx.cache); + const main = await getBoard(url, ctx.cache); const albumInfo = main.albumInfo; const title = albumInfo.name; const description = albumInfo.desc; + const image = albumInfo.user.images.split('?imageView2')[0]; const list = main.notesDetail; const resultItem = list.map((item) => ({ @@ -22,6 +23,7 @@ module.exports = async (ctx) => { ctx.state.data = { title, link: url, + image, item: resultItem, description, }; diff --git a/lib/v2/xiaohongshu/maintainer.js b/lib/v2/xiaohongshu/maintainer.js index dd357d1bc7d865..a06db40ceea161 100644 --- a/lib/v2/xiaohongshu/maintainer.js +++ b/lib/v2/xiaohongshu/maintainer.js @@ -1,4 +1,5 @@ module.exports = { '/board/:board_id': ['lotosbin'], - '/user/:user_id/:category': ['lotosbin'], + '/user/:user_id/collect': ['lotosbin'], + '/user/:user_id/notes': ['lotosbin'], }; diff --git a/lib/v2/xiaohongshu/radar.js b/lib/v2/xiaohongshu/radar.js index cb92cb06056085..ba84a102b58706 100644 --- a/lib/v2/xiaohongshu/radar.js +++ b/lib/v2/xiaohongshu/radar.js @@ -9,10 +9,10 @@ module.exports = { target: '/xiaohongshu/user/:user_id/notes', }, { - title: '用户专辑', + title: '用户收藏', docs: 'https://docs.rsshub.app/social-media.html#xiao-hong-shu', source: '/user/profile/:user_id', - target: '/xiaohongshu/user/:user_id/album', + target: '/xiaohongshu/user/:user_id/collect', }, { title: '专辑', diff --git a/lib/v2/xiaohongshu/user.js b/lib/v2/xiaohongshu/user.js index 32d211f34db651..c8a6ef1d81ba64 100644 --- a/lib/v2/xiaohongshu/user.js +++ b/lib/v2/xiaohongshu/user.js @@ -1,51 +1,30 @@ -const { parseDate } = require('@/utils/parse-date'); -const timezone = require('@/utils/timezone'); -const { getContent } = require('./util'); +const { getUser } = require('./util'); module.exports = async (ctx) => { const userId = ctx.params.user_id; const category = ctx.params.category; const url = `https://www.xiaohongshu.com/user/profile/${userId}`; - let main; - try { - main = await getContent(url, ctx.cache); - } catch (e) { - throw Error('滑块验证'); - } - const userDetail = main.userDetail; - const description = `${userDetail.nickname} • 小红书 / RED`; - if (category === 'notes') { - const list = main.notesDetail; - const resultItem = list.map((item) => ({ - title: item.title, - link: `https://www.xiaohongshu.com/discovery/item/${item.id}`, - description: `<img src ="${item.cover.url.split('?imageView2')[0]}"><br>${item.title}`, - author: item.user.nickname, - pubDate: timezone(parseDate(item.time), 8), - })); + const content = await getUser(url, ctx.cache); - const title = `小红书-${userDetail.nickname}-笔记`; - ctx.state.data = { - title, - link: url, - item: resultItem, - description, - }; - } else if (category === 'album') { - const list = main.albumDetail; - const resultItem = list.map((item) => ({ - title: item.title, - link: `https://www.xiaohongshu.com/board/${item.id}`, - description: item.images.map((it) => `<img src ="${it.split('?imageView2')[0]}">`).join(`<br>`), + 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 items = (category, user_posted, collect) => + (category === 'notes' ? user_posted : collect).data.notes.map((item) => ({ + title: item.display_title, + link: `${url}/${item.note_id}`, + description: `<img src ="${item.cover.url}"><br>${item.display_title}`, + author: item.user.nickname, })); - const title = `小红书-${userDetail.nickname}-专辑`; - ctx.state.data = { - title, - link: url, - item: resultItem, - description, - }; - } + ctx.state.data = { + title, + description, + image, + link: url, + item: items(category, user_posted, collect), + }; }; diff --git a/lib/v2/xiaohongshu/util.js b/lib/v2/xiaohongshu/util.js index d741685410dadb..7793070234d857 100644 --- a/lib/v2/xiaohongshu/util.js +++ b/lib/v2/xiaohongshu/util.js @@ -1,6 +1,7 @@ const config = require('@/config').value; +const logger = require('@/utils/logger'); -const getContent = (url, cache) => +const getUser = (url, cache) => cache.tryGet( url, async () => { @@ -8,15 +9,50 @@ const getContent = (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.continue() : request.abort(); + request.resourceType() === 'document' || request.resourceType() === 'script' || request.resourceType() === 'xhr' || request.resourceType() === 'other' ? request.continue() : request.abort(); }); - page.on('response', (response) => { - if (response.url().includes('captcha.fengkongcloud.cn')) { - page.close(); - throw Error('滑块验证'); + 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.click('div.reds-tab-item:nth-child(2)'); + await page.waitForSelector('.feeds-container:nth-child(2) .note-item'); + return { otherInfo, user_posted, collect }; + } finally { + browser.close(); + } + }, + config.cache.routeExpire, + false + ); + +const getBoard = (url, cache) => + cache.tryGet( + url, + async () => { + const browser = await require('@/utils/puppeteer')(); + try { + const page = await browser.newPage(); + await page.setRequestInterception(true); + page.on('request', (request) => { + request.resourceType() === 'document' || request.resourceType() === 'script' || request.resourceType() === 'xhr' ? request.continue() : request.abort(); + }); + logger.debug(`Requesting ${url}`); await page.goto(url); await page.waitForSelector('.pc-container'); const initialSsrState = await page.evaluate(() => window.__INITIAL_SSR_STATE__); @@ -30,5 +66,6 @@ const getContent = (url, cache) => ); module.exports = { - getContent, + getUser, + getBoard, };
c6f6ea4194e65352e2ec473a6e2ad046dc3f3dbe
2020-11-03 09:13:02
Ethan Shen
fix: 网易新闻文章内视频无效 (#6091)
false
网易新闻文章内视频无效 (#6091)
fix
diff --git a/lib/routes/netease/news/rank.js b/lib/routes/netease/news/rank.js index 3dd47557df7d58..f593282b608be9 100644 --- a/lib/routes/netease/news/rank.js +++ b/lib/routes/netease/news/rank.js @@ -43,7 +43,7 @@ const config = { title: '房产', }, game: { - link: '/special/0001386F/rank_game.html', + link: '/special/0001386F/game_rank.html', title: '游戏', }, travel: { @@ -101,10 +101,10 @@ module.exports = async (ctx) => { const list = $('div.tabContents') .eq(time[ctx.params.time].index + (ctx.params.category === 'whole' ? (ctx.params.type === 'click' ? -1 : 2) : ctx.params.type === 'click' ? 0 : 2)) .find('table tbody tr td a') + .slice(0, 15) .map((_, item) => { item = $(item); return { - title: item.text(), link: item.attr('href'), }; }) @@ -115,42 +115,22 @@ module.exports = async (ctx) => { async (item) => await ctx.cache.tryGet(item.link, async () => { try { - let res; - let content; - if (item.link.startsWith('https://ent.163.com')) { - res = await got({ method: 'get', url: item.link, responseType: 'buffer' }); - content = cheerio.load(iconv.decode(res.data, 'gbk')); - } else { - res = await got.get(item.link); - content = cheerio.load(res.data); - } - - if (content('#ne_wrap').attr('data-publishtime')) { - // To get pubDate from most pages. - - item.pubDate = new Date(content('#ne_wrap').attr('data-publishtime') + ' GMT+8').toUTCString(); - } else if (content('div.headline span').text()) { - // To get pubDate from special pages in Money. - // eg. https://money.163.com/20/0513/14/FCH1G10000259E8J.html - - item.pubDate = new Date(content('div.headline span').text() + ' GMT+8').toUTCString(); - } else if (content('meta[property="article:published_time"]').attr('content')) { - // To get pubDate from pages with image collections. - // eg. http://lady.163.com/photoview/00A70026/115695.html - - item.pubDate = new Date(content('meta[property="article:published_time"]').attr('content')).toUTCString(); - } - - if (content('#endText').html()) { - // To get description from most pages. - - item.description = content('#endText').html(); - } else if (content('div.biz_plus_content').html()) { - // To get description from special pages in Money. - // eg. https://money.163.com/20/0513/14/FCH1G10000259E8J.html - - item.description = content('div.biz_plus_content').html(); - } + const category = item.link.split('.163.com')[0].split('//').pop().split('.').pop(); + const link = `https://3g.163.com/${category}/article/${item.link.split('/').pop()}`; + const detailResponse = await got({ + method: 'get', + url: link, + }); + const content = cheerio.load(detailResponse.data); + + content('.bot_word').remove(); + content('video').each(function () { + content(this).attr('src', content(this).attr('data-src')); + }); + + item.title = content('meta[property="og:title"]').attr('content').replace('_手机网易网', ''); + item.pubDate = content('meta[property="og:release_date"]').attr('content'); + item.description = content('.content').html(); return item; } catch (err) { @@ -162,7 +142,7 @@ module.exports = async (ctx) => { ctx.state.data = { title: `网易新闻${time[ctx.params.time].title}${ctx.params.type === 'click' ? '点击' : '跟帖'}榜 - ${cfg.title}`, - link: rootUrl, + link: currentUrl, item: items, }; };
760f48b8cf499143859c6e15ce07f30f5171f440
2024-03-27 12:19:43
DIYgod
test: fix common-config test
false
fix common-config test
test
diff --git a/lib/setup.test.ts b/lib/setup.test.ts index 78a827a50b1b31..df52b0f674f8a6 100644 --- a/lib/setup.test.ts +++ b/lib/setup.test.ts @@ -1,4 +1,4 @@ -import { beforeAll, afterAll, afterEach } from 'vitest'; +import { afterAll, afterEach } from 'vitest'; import { setupServer } from 'msw/node'; import { http, HttpResponse } from 'msw'; @@ -18,9 +18,23 @@ const server = setupServer( HttpResponse.json({ UA: 'test', }) + ), + http.get(`http://rsshub.test/buildData`, () => + HttpResponse.text(`<div class="content"> + <ul> + <li> + <a href="/1">1</a> + <div class="description">RSSHub1</div> + </li> + <li> + <a href="/2">2</a> + <div class="description">RSSHub2</div> + </li> + </ul> + </div>`) ) ); +server.listen(); -beforeAll(() => server.listen()); afterAll(() => server.close()); afterEach(() => server.resetHandlers()); diff --git a/lib/utils/common-config.test.ts b/lib/utils/common-config.test.ts index 84b4c15c95d179..57839fd38edfb3 100644 --- a/lib/utils/common-config.test.ts +++ b/lib/utils/common-config.test.ts @@ -1,6 +1,5 @@ import { describe, expect, it } from 'vitest'; import configUtils, { transElemText, replaceParams, getProp } from '@/utils/common-config'; -import nock from 'nock'; describe('index', () => { it('transElemText', () => { @@ -40,23 +39,6 @@ describe('index', () => { }); it('buildData', async () => { - nock('http://rsshub.test') - .get('/buildData') - .reply(() => [ - 200, - `<div class="content"> - <ul> - <li> - <a href="/1">1</a> - <div class="description">RSSHub1</div> - </li> - <li> - <a href="/2">2</a> - <div class="description">RSSHub2</div> - </li> - </ul> - </div>`, - ]); const data = await configUtils({ link: 'http://rsshub.test/buildData', url: 'http://rsshub.test/buildData',
a12e5fbbab96aaafbe8df20785c95fb5aa12b909
2025-02-20 14:31:58
dependabot[bot]
chore(deps): bump pac-proxy-agent from 7.1.0 to 7.2.0 (#18412)
false
bump pac-proxy-agent from 7.1.0 to 7.2.0 (#18412)
chore
diff --git a/package.json b/package.json index 7079b2c97ea21b..243fdd001cfaf7 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "oauth-1.0a": "2.2.6", "ofetch": "1.4.1", "otplib": "12.0.1", - "pac-proxy-agent": "7.1.0", + "pac-proxy-agent": "7.2.0", "proxy-chain": "2.5.6", "puppeteer": "22.6.2", "puppeteer-extra": "3.3.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c92e97d1f7ffb0..2dbba0029585d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -186,8 +186,8 @@ importers: specifier: 12.0.1 version: 12.0.1 pac-proxy-agent: - specifier: 7.1.0 - version: 7.1.0 + specifier: 7.2.0 + version: 7.2.0 proxy-chain: specifier: 2.5.6 version: 2.5.6 @@ -4480,8 +4480,8 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - [email protected]: - resolution: {integrity: sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw==} + [email protected]: + resolution: {integrity: sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==} engines: {node: '>= 14'} [email protected]: @@ -10270,7 +10270,7 @@ snapshots: dependencies: p-limit: 3.1.0 - [email protected]: + [email protected]: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.3 @@ -10461,7 +10461,7 @@ snapshots: http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 lru-cache: 7.18.3 - pac-proxy-agent: 7.1.0 + pac-proxy-agent: 7.2.0 proxy-from-env: 1.1.0 socks-proxy-agent: 8.0.5 transitivePeerDependencies:
169f9231799fb522c94fa6f281a5628ed296956f
2020-12-28 22:55:20
Jinkin
feat: add Uestc sice notice (#6558)
false
add Uestc sice notice (#6558)
feat
diff --git a/docs/university.md b/docs/university.md index ed3eb8acd798c8..a30c3b731d2981 100644 --- a/docs/university.md +++ b/docs/university.md @@ -396,6 +396,10 @@ xskb1 对应 <http://www.auto.uestc.edu.cn/index/xskb1.htm> <Route author="huyyi" example="/uestc/gr" path="/uestc/gr" /> +### 信息与通信工程学院 + +<Route author="huyyi" example="/uestc/sice" path="/uestc/sice" /> + ## 东北大学 ### 东北大学新闻网 diff --git a/lib/router.js b/lib/router.js index 66d6984b4a672e..f81bf87e0a6c3c 100644 --- a/lib/router.js +++ b/lib/router.js @@ -772,6 +772,8 @@ router.get('/uestc/auto/:type?', require('./routes/universities/uestc/auto')); router.get('/uestc/cs/:type?', require('./routes/universities/uestc/cs')); router.get('/uestc/cqe/:type?', require('./routes/universities/uestc/cqe')); router.get('/uestc/gr', require('./routes/universities/uestc/gr')); +router.get('/uestc/sice', require('./routes/universities/uestc/sice')); + // 云南大学 router.get('/ynu/grs/zytz', require('./routes/universities/ynu/grs/zytz')); diff --git a/lib/routes/universities/uestc/sice.js b/lib/routes/universities/uestc/sice.js new file mode 100644 index 00000000000000..53a08006f9660a --- /dev/null +++ b/lib/routes/universities/uestc/sice.js @@ -0,0 +1,29 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const baseIndexUrl = 'https://www.sice.uestc.edu.cn/'; + const response = await got.get(baseIndexUrl); + const $ = cheerio.load(response.data); + const out = $('.notice p').map((index, item) => { + item = $(item); + let date = new Date(new Date().getFullYear() + '-' + item.find('a.date').text()); + if (new Date() < date) { + date = new Date((new Date().getFullYear() - 1) + '-' + item.find('a.date').text()); + } + return { + title: item.find('a[href]').text(), + link: baseIndexUrl + item.find('a[href]').attr('href'), + pubDate: date + }; + } + ).get(); + // console.log(out); + + ctx.state.data = { + title: '信通通知公告', + link: 'https://www.sice.uestc.edu.cn/tzgg/yb.htm', + description: '电子科技大学信息与通信工程学院通知公告', + item: out + }; +};
c68251e461a9f1d0b65d618505eca5726e8e5101
2018-12-26 14:11:32
凉凉
hotfix: juejin pin (#1317)
false
juejin pin (#1317)
hotfix
diff --git a/routes/juejin/pins.js b/routes/juejin/pins.js index 7c170110ce010c..812ca04c5ba668 100644 --- a/routes/juejin/pins.js +++ b/routes/juejin/pins.js @@ -2,35 +2,48 @@ const axios = require('../../utils/axios'); module.exports = async (ctx) => { const response = await axios({ - method: 'get', - url: 'https://short-msg-ms.juejin.im/v1/pinList/recommend?uid=&device_id=&token=&src=web&before&limit=50', + method: 'post', + url: 'https://web-api.juejin.im/graphql', + data: { operationName: '', query: '', variables: { size: 20, after: '', afterPosition: '' }, extensions: { query: { id: '964dab26a3f9997283d173b865509890' } } }, + headers: { + 'X-Agent': 'Juejin/Web', + }, }); - const data = response.data.d.list; - - ctx.state.data = { - title: '沸点 - 掘金', - link: 'https://juejin.im/pins', - item: data.map(({ content, objectId, createdAt, user, pictures, url, urlTitle }) => { - const imgs = pictures.reduce((imgs, item) => { - imgs += ` + const items = response.data.data.recommendedActivityFeed.items.edges.map(({ node: { targets: [item] } }) => { + const content = item.content; + const title = content; + const guid = item.id; + const link = `https://juejin.im/pin/${guid}`; + const pubDate = new Date(item.createdAt).toUTCString(); + const author = item.user.username; + const imgs = item.pictures.reduce((imgs, item) => { + imgs += ` <img referrerpolicy="no-referrer" src="${item}"><br> `; - return imgs; - }, ''); + return imgs; + }, ''); + const url = item.url; + const urlTitle = item.urlTitle; + const description = ` + ${content.replace(/\n/g, '<br>')}<br> + ${imgs}<br> + <a href="${url}">${urlTitle}</a><br> + `; - return { - title: content, - link: `https://juejin.im/pin/${objectId}`, - description: ` - ${content}<br> - ${imgs}<br> - <a href="${url}">${urlTitle}</a><br> - `, - pubDate: new Date(createdAt).toUTCString(), - author: user.username, - guid: objectId, - }; - }), + return { + title, + link, + description, + guid, + pubDate, + author, + }; + }); + + ctx.state.data = { + title: '沸点 - 动态', + link: 'https://juejin.im/activities/recommended', + item: items, }; };
0cc98c37e03fd06cba7ca6c4d456e42b9a106d49
2020-08-19 01:54:24
GitHub Action
style: auto format
false
auto format
style
diff --git a/docs/social-media.md b/docs/social-media.md index 1c0962b50c392a..af285a3fd05954 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -859,6 +859,12 @@ rule <Route author="hillerliao" example="/xueqiu/hots" path="/xueqiu/hots"/> +## 悟空问答 + +### 用户动态 + +<Route author="nczitzk" example="/wukong/user/5826687196" path="/wukong/user/:id" :paramsDesc="['用户ID,可在用户页 URL 中找到']"/> + ## 小红书 ### 用户笔记和专辑 @@ -891,12 +897,6 @@ rule 免费版账户抖音每天查询次数 20 次,如需增加次数可购买新榜会员或等待未来多账户支持 ::: -## 悟空问答 - -### 用户动态 - -<Route author="nczitzk" example="/wukong/user/5826687196" path="/wukong/user/:id" :paramsDesc="['用户ID,可在用户页 URL 中找到']"/> - ## 知乎 ### 收藏夹 diff --git a/lib/routes/soul/hot.js b/lib/routes/soul/hot.js index 555a2cf56caa25..e8147e0a8a38d7 100644 --- a/lib/routes/soul/hot.js +++ b/lib/routes/soul/hot.js @@ -16,10 +16,14 @@ const generateResponse = async (items) => ({ }); module.exports = async (ctx) => { - const rsps = await Promise.all([1, 2].map((pageId) => got({ - method: 'get', - url: `https://api-h5.soulapp.cn/html/v2/post/hot?pageIndex=${pageId}` - }))); + const rsps = await Promise.all( + [1, 2].map((pageId) => + got({ + method: 'get', + url: `https://api-h5.soulapp.cn/html/v2/post/hot?pageIndex=${pageId}`, + }) + ) + ); const allItems = []; rsps.forEach((response) => { @@ -56,7 +60,6 @@ module.exports = async (ctx) => { }); allItems.push(...items); - }); ctx.state.data = await generateResponse(allItems);
1405f155405cf8e50ae3d3059feb4722a6037bfc
2024-11-11 14:03:56
dependabot[bot]
chore(deps): bump @hono/node-server from 1.13.5 to 1.13.6 (#17541)
false
bump @hono/node-server from 1.13.5 to 1.13.6 (#17541)
chore
diff --git a/package.json b/package.json index faa3057bf236d4..906e8e7c90176b 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "dependencies": { "@bbob/html": "4.1.1", "@bbob/preset-html5": "4.1.1", - "@hono/node-server": "1.13.5", + "@hono/node-server": "1.13.6", "@hono/zod-openapi": "0.17.0", "@notionhq/client": "2.2.15", "@opentelemetry/api": "1.9.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32a6d75728ccae..cd002bd117d82e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: 4.1.1 version: 4.1.1 '@hono/node-server': - specifier: 1.13.5 - version: 1.13.5([email protected]) + specifier: 1.13.6 + version: 1.13.6([email protected]) '@hono/zod-openapi': specifier: 0.17.0 version: 0.17.0([email protected])([email protected]) @@ -1348,8 +1348,8 @@ packages: resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@hono/[email protected]': - resolution: {integrity: sha512-lSo+CFlLqAFB4fX7ePqI9nauEn64wOfJHAfc9duYFTvAG3o416pC0nTGeNjuLHchLedH+XyWda5v79CVx1PIjg==} + '@hono/[email protected]': + resolution: {integrity: sha512-Y2ivw4UmLIBKfzvkFgcsrhc0GLn272diGjlnKOF9T1OiY6ud4RaVO8FKEnifNkuU7meOeCU371/8fmhgeYf7Lw==} engines: {node: '>=18.14.1'} peerDependencies: hono: ^4 @@ -6871,7 +6871,7 @@ snapshots: dependencies: levn: 0.4.1 - '@hono/[email protected]([email protected])': + '@hono/[email protected]([email protected])': dependencies: hono: 4.6.9
574bf39ac8958f40deac15edce033e684393c4fe
2018-11-12 20:45:28
cnzgray
feat: add `typora/changelog` router (#1122)
false
add `typora/changelog` router (#1122)
feat
diff --git a/docs/README.md b/docs/README.md index 879882d92a23ad..bcec671ccd0058 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1089,6 +1089,10 @@ GitHub 官方也提供了一些 RSS: <route name="应用更新" author="DIYgod" example="/xclient/app/sketch" path="/xclient/app/:name" :paramsDesc="['应用名, 可在应用页 URL 中找到']"/> +### Typora + +<route name="Changelog" author="cnzgray" example="/typora/changelog" path="/typora/changelog"/> + ## 大学通知 ### 上海海事大学 diff --git a/router.js b/router.js index 4c3d2eccf9e7d1..e4a083775deb53 100644 --- a/router.js +++ b/router.js @@ -790,6 +790,9 @@ router.get('/eeo/:category?', require('./routes/eeo/index')); // 腾讯视频 router.get('/tencentvideo/playlist/:id', require('./routes/tencent/video/playlist')); +// typora +router.get('/typora/changelog', require('./routes/typora/changelog')); + // TSSstatus router.get('/tssstatus/:board/:build', require('./routes/tssstatus')); diff --git a/routes/typora/changelog.js b/routes/typora/changelog.js new file mode 100644 index 00000000000000..b848f6b1fd5676 --- /dev/null +++ b/routes/typora/changelog.js @@ -0,0 +1,70 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const host = 'https://support.typora.io/'; + + const response = await axios({ + method: 'get', + url: host, + headers: { + Referer: host, + }, + }); + + const $ = cheerio.load(response.data); + + const parseContent = async (link) => { + // Check cache + const cache = await ctx.cache.get(link); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + + const response = await axios({ + method: 'get', + url: link, + headers: { + Referer: host, + }, + }); + + const $ = cheerio.load(response.data); + + const title = $('h1').text(); + const pubDate = new Date($('.post-meta time').text()); + // const author = $('.post-meta span').text(); + const html = $('#pagecontainer').html(); + + const result = { + title: title, + link: link, + guid: link, + pubDate: pubDate, + description: html, + }; + + ctx.cache.set(link, JSON.stringify(result), 3 * 60 * 60); + + return result; + }; + + const items = await Promise.all( + $('#content > ul:nth-child(2) > li') + .get() + .map(async (item) => { + const node = $('a', item); + const link = node.attr('href'); + const result = await parseContent(link); + + return Promise.resolve(result); + }) + ); + + ctx.state.data = { + title: 'Typora Changelog', + link: host, + description: 'Typora Changelog', + item: items, + }; +};
b0ebd5e2b8e4aaf0e5e068e3dce303104794d815
2020-10-19 19:59:48
Harry Cheng
feat: 添加 FF14 国际服新闻及通知(Lodestone) (#5944)
false
添加 FF14 国际服新闻及通知(Lodestone) (#5944)
feat
diff --git a/docs/game.md b/docs/game.md index df52423af497b9..e44c3f3a82fb04 100644 --- a/docs/game.md +++ b/docs/game.md @@ -490,12 +490,27 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 ### 最终幻想 14 国服 -<Route author="Kiotlin" example="/ff14/ff14_zh/news" path="/ff14/ff14_zh/:type" :paramsDesc="['分类名']"/> +<Route author="Kiotlin" example="/ff14/ff14_zh/news" path="/ff14/ff14_zh/:type" :paramsDesc="['分类名']"> | 新闻 | 公告 | 活动 | 广告 | 所有 | | ---- | -------- | ------ | --------- | ---- | | news | announce | events | advertise | all | +</Route> + +### 最终幻想 14 国际服 (Lodestone) + +<Route author="chengyuhui" example="/ff14/ff14_global/na/all" path="/ff14/ff14_global/:lang/:type" :paramsDesc="['地区', '分类名']"> +| 北美 | 欧洲(英语) | 法国 | 德国 | 日本 | +| ---- | ------------ | ---- | ---- | ---- | +| na | eu | fr | de | jp | + +| 话题 | 公告 | 维护 | 更新 | 服务状态 | 开发者博客 | +| ------ | ------- | ----------- | ------- | -------- | ---------- | +| topics | notices | maintenance | updates | status | developers | + +</Route> + ## きららファンタジア|奇拉拉幻想曲 ### 公告 diff --git a/lib/router.js b/lib/router.js index 6297b5e2e1f82f..7c027a90af8382 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1890,6 +1890,7 @@ router.get('/arknights/news', require('./routes/arknights/news')); // ff14 router.get('/ff14/ff14_zh/:type', require('./routes/ff14/ff14_zh')); +router.get('/ff14/ff14_global/:lang/:type', require('./routes/ff14/ff14_global')); // 学堂在线 router.get('/xuetangx/course/:cid/:type', require('./routes/xuetangx/course_info')); diff --git a/lib/routes/ff14/ff14_global.js b/lib/routes/ff14/ff14_global.js new file mode 100644 index 00000000000000..849cf05e4eac1c --- /dev/null +++ b/lib/routes/ff14/ff14_global.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const type = ctx.params.type; + const lang = ctx.params.lang; + + const response = await got({ + method: 'get', + url: `http://${lang}.lodestonenews.com/news/${type}`, + }); + + let data; + if (type === 'all') { + data = []; + Object.values(response.data).forEach((arr) => (data = data.concat(arr))); + } else { + data = response.data; + } + + ctx.state.data = { + title: `FFXIV Lodestone updates (${type})`, + link: `https://${lang}.finalfantasyxiv.com/lodestone/news/`, + item: data.map(({ id, url, title, time, description, image }) => ({ + title, + link: url, + description: `<img src="${image}"><br>${description}<br>`, + pubDate: time, + guid: id, + })), + }; +};
8cf0a2a9f0b200687f181b00acc0a91d0241d36f
2024-03-17 00:58:22
N78Wy
feat(route): /booru/mmda MMDArchive Better Reading Experience and add radar (#14772)
false
/booru/mmda MMDArchive Better Reading Experience and add radar (#14772)
feat
diff --git a/lib/routes/booru/mmda.ts b/lib/routes/booru/mmda.ts index 3e8871fa17bb1f..a58b021bd4a942 100644 --- a/lib/routes/booru/mmda.ts +++ b/lib/routes/booru/mmda.ts @@ -2,6 +2,10 @@ import { Route } from '@/types'; import got from '@/utils/got'; import queryString from 'query-string'; import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; +import cache from '@/utils/cache'; +import { art } from '@/utils/render'; +import * as path from 'node:path'; export const route: Route = { path: '/mmda/tags/:tags?', @@ -12,10 +16,14 @@ export const route: Route = { requireConfig: false, requirePuppeteer: false, antiCrawler: false, + supportRadar: true, supportBT: false, supportPodcast: false, supportScihub: false, }, + radar: { + source: ['mmda.booru.org/index.php'], + }, name: 'MMDArchive 标签查询', maintainers: ['N78Wy'], handler, @@ -56,17 +64,66 @@ async function handler(ctx) { const scriptStr = item.find('script[type="text/javascript"]').first().text(); const user = scriptStr.match(/user':'(.*?)'/)?.[1] ?? ''; + const title = a.find('img').first().attr('title') ?? ''; + const imageSrc = a.find('img').first().attr('src') ?? ''; + return { - title: a.find('img').first().attr('title'), + title, link: `${baseUrl}/${a.attr('href')}`, + image: imageSrc, author: user, - description: a.html(), + description: art(path.join(__dirname, 'templates/description.art'), { + title, + image: imageSrc, + by: user, + }), }; }); + const items = await Promise.all( + list.map((item) => + cache.tryGet(item.link, async () => { + const { data: response } = await got(item.link); + const $ = load(response); + + // 获取左侧的Statistics统计信息 + const statisticsTages = $('#tag_list > ul'); + statisticsTages.find('li, br, strong').remove(); + const statisticsStr = statisticsTages.text(); + + const regex = /(?<key>[^\s:]+)\s*:\s*(?<value>.+)/gm; + const result = {}; + for (const match of statisticsStr.matchAll(regex)) { + const { key, value } = match.groups ?? ({} as { key: string; value: string }); + result[key.trim().toLocaleLowerCase()] = value.trim(); + } + + // 获取大图 + const bigImage = $('#image').attr('src'); + + // 获取发布时间 + if (result.posted) { + item.pubDate = parseDate(result.posted); + } + + item.description = art(path.join(__dirname, 'templates/description.art'), { + title: item.title, + image: bigImage ?? item.image, + posted: item.pubDate ?? '', + by: result.by, + source: result.source, + rating: result.rating, + score: result.score, + }); + + return item; + }) + ) + ); + return { title: tags, link: `${baseUrl}/index.php?${query}`, - item: list, + item: items, }; } diff --git a/lib/routes/booru/templates/description.art b/lib/routes/booru/templates/description.art new file mode 100644 index 00000000000000..dde6382def4133 --- /dev/null +++ b/lib/routes/booru/templates/description.art @@ -0,0 +1,25 @@ +<div class="item-description"> + {{if image }} + <img src="{{ image }}" alt="{{ title }}"> + {{/if}} + + {{if posted }} + <p>posted: <span class="posted">{{ posted }}</span></p> + {{/if}} + + {{if by }} + <p>by: <span class="by">{{ by }}</span></p> + {{/if}} + + {{if source }} + <p>source: <span class="source">{{ source }}</span></p> + {{/if}} + + {{if rating }} + <p>rating: <span class="rating">{{ rating }}</span></p> + {{/if}} + + {{if score }} + <p>score: <span class="score">{{ score }}</span></p> + {{/if}} +</div>
ba7d7c4756418579458ab816db56194d1a4b926a
2020-10-15 16:27:00
Laam Pui
fix: set category title as description
false
set category title as description
fix
diff --git a/lib/routes/frontend/index.js b/lib/routes/frontend/index.js index 44e943d7c69a00..719049ed269dff 100644 --- a/lib/routes/frontend/index.js +++ b/lib/routes/frontend/index.js @@ -12,7 +12,8 @@ module.exports = async (ctx) => { link: item.link, pubDate: item.date, title: item.title, - author: category.title + author: category.title, + description: category.title })), ], []
a73b28bdfbacf557fa4882720112603a284b34ba
2025-02-05 04:11:28
lucky13820
feat(route): add 歪脑 (#18262)
false
add 歪脑 (#18262)
feat
diff --git a/lib/routes/wainao/namespace.ts b/lib/routes/wainao/namespace.ts new file mode 100644 index 00000000000000..6910bd356c0cfb --- /dev/null +++ b/lib/routes/wainao/namespace.ts @@ -0,0 +1,8 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '歪脑', + url: 'wainao.me', + description: '歪脑是为讲中文的年轻一代度身定制的新闻杂志。', + lang: 'zh-CN', +}; diff --git a/lib/routes/wainao/wainao-reads.ts b/lib/routes/wainao/wainao-reads.ts new file mode 100644 index 00000000000000..ef918c81ca844a --- /dev/null +++ b/lib/routes/wainao/wainao-reads.ts @@ -0,0 +1,49 @@ +import { Route } from '@/types'; +import got from '@/utils/got'; +import { parseDate } from '@/utils/parse-date'; + +export const route: Route = { + path: '/wainao-reads', + categories: ['new-media'], + example: '/wainao/wainao-reads', + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + url: 'www.wainao.me', + name: '歪脑读', + maintainers: ['lucky13820'], + radar: [ + { + source: ['www.wainao.me', 'www.wainao.me/wainao-reads'], + target: '/wainao-reads', + }, + ], + handler, +}; + +async function handler() { + const apiUrl = 'https://www.wainao.me/pf/api/v3/content/fetch/content-api-collections?query={"content_alias":"wainao-hero"}&d=81&_website=wainao'; + const baseUrl = 'https://www.wainao.me'; + + const response = await got(apiUrl); + const data = JSON.parse(response.body); + + const items = data.content_elements.map((item) => ({ + title: item.headlines.basic, + description: item.description?.basic || '', + link: baseUrl + item.canonical_url, + pubDate: parseDate(item.publish_date), + image: item.promo_items?.basic?.url || '', + })); + + return { + title: '歪脑读 - 歪脑', + link: baseUrl, + item: items, + }; +}
215883de04c1bb5221f3447e27760471698257b2
2023-06-13 22:05:29
Ethan Shen
feat(route): add UNTAG时间线 (#12663)
false
add UNTAG时间线 (#12663)
feat
diff --git a/docs/new-media.md b/docs/new-media.md index ed16e82e33c411..737e235aba6235 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1491,6 +1491,10 @@ Provides all of the Thrillist articles with the specified tag. ## UNTAG +### 时间线 + +<Route author="nczitzk" example="/utgd/timeline" path="/utgd/timeline" /> + ### 分类 <Route author="nczitzk" example="/utgd/method" path="/utgd/:category?" :paramsDesc="['分类,可在对应分类页的 URL 中找到,默认为方法']"> diff --git a/lib/v2/utgd/maintainer.js b/lib/v2/utgd/maintainer.js index 3a54ff4efdb9df..3620497298f0ff 100644 --- a/lib/v2/utgd/maintainer.js +++ b/lib/v2/utgd/maintainer.js @@ -1,4 +1,5 @@ module.exports = { - '/:category?': ['nczitzk'], + '/timeline': ['nczitzk'], '/topic/:topic?': ['nczitzk'], + '/:category?': ['nczitzk'], }; diff --git a/lib/v2/utgd/radar.js b/lib/v2/utgd/radar.js index beb6b427472bd0..4165e013f0cdc9 100644 --- a/lib/v2/utgd/radar.js +++ b/lib/v2/utgd/radar.js @@ -2,6 +2,12 @@ module.exports = { 'utgd.net': { _name: 'UNTAG', '.': [ + { + title: '时间线', + docs: 'https://docs.rsshub.app/new-media.html#untag-shi-jian-xian', + source: ['/'], + target: '/utgd/timeline', + }, { title: '分类', docs: 'https://docs.rsshub.app/new-media.html#untag-fen-lei', diff --git a/lib/v2/utgd/router.js b/lib/v2/utgd/router.js index ce4505f48bb23e..9973e10d53fea1 100644 --- a/lib/v2/utgd/router.js +++ b/lib/v2/utgd/router.js @@ -1,4 +1,5 @@ module.exports = function (router) { + router.get('/timeline', require('./timeline')); router.get('/topic/:topic?', require('./topic')); router.get('/:category?', require('./category')); }; diff --git a/lib/v2/utgd/timeline.js b/lib/v2/utgd/timeline.js new file mode 100644 index 00000000000000..21587f1a1d8b0a --- /dev/null +++ b/lib/v2/utgd/timeline.js @@ -0,0 +1,54 @@ +const got = require('@/utils/got'); +const timezone = require('@/utils/timezone'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); +const md = require('markdown-it')({ + html: true, +}); + +module.exports = async (ctx) => { + const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 20; + + const rootUrl = 'https://utgd.net'; + const apiUrl = `${rootUrl}/api/v2/timeline/?page=1&page_size=${limit}`; + + const response = await got({ + method: 'get', + url: apiUrl, + }); + + const items = await Promise.all( + response.data.results.slice(0, limit).map((item) => + ctx.cache.tryGet(`untag-${item.id}`, async () => { + const detailResponse = await got({ + method: 'get', + url: `${rootUrl}/api/v2/pages/${item.id}/`, + searchParams: { + fields: 'article_content,article_category(category_name),article_tag(tag_name)', + }, + }); + + const data = detailResponse.data; + + return { + title: item.title, + link: `${rootUrl}/article/${item.id}`, + description: art(path.join(__dirname, 'templates/description.art'), { + image: item.article_image, + description: md.render(data.article_content), + }), + author: item.article_author_displayname, + pubDate: timezone(parseDate(item.article_published_time), +8), + category: [...data.article_category.map((c) => c.category_name), ...data.article_tag.map((t) => t.tag_name)], + }; + }) + ) + ); + + ctx.state.data = { + title: 'UNTAG', + link: rootUrl, + item: items, + }; +};
5e2caeb4452457ee02e8927baa76e1e9da5488c8
2025-01-15 16:44:53
dependabot[bot]
chore(deps-dev): bump eslint-plugin-prettier from 5.2.1 to 5.2.2 (#18131)
false
bump eslint-plugin-prettier from 5.2.1 to 5.2.2 (#18131)
chore
diff --git a/package.json b/package.json index 3cb0bd77d7057f..3a39bf7a8a1cd5 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "eslint-config-prettier": "10.0.1", "eslint-nibble": "8.1.0", "eslint-plugin-n": "17.15.1", - "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-prettier": "5.2.2", "eslint-plugin-unicorn": "56.0.1", "eslint-plugin-yml": "1.16.0", "fs-extra": "11.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4c6a0335b7f90a..f611456bcc563d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -389,8 +389,8 @@ importers: specifier: 17.15.1 version: 17.15.1([email protected]) eslint-plugin-prettier: - specifier: 5.2.1 - version: 5.2.1(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]) + specifier: 5.2.2 + version: 5.2.2(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]) eslint-plugin-unicorn: specifier: 56.0.1 version: 56.0.1([email protected]) @@ -3012,8 +3012,8 @@ packages: peerDependencies: eslint: '>=8.23.0' - [email protected]: - resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} + [email protected]: + resolution: {integrity: sha512-1yI3/hf35wmlq66C8yOyrujQnel+v5l1Vop5Cl2I6ylyNTT1JbuUUnV3/41PzwTzcyDp/oF0jWE3HXvcH5AQOQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -8546,7 +8546,7 @@ snapshots: minimatch: 9.0.5 semver: 7.6.3 - [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]): + [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]): dependencies: eslint: 9.18.0 prettier: 3.4.2
292471ec23e94c4cc080501fbb60a70103f253cb
2024-08-25 22:03:53
zihao
feat(route): add route for Engineering blogs (#16529)
false
add route for Engineering blogs (#16529)
feat
diff --git a/lib/routes/imhcg/blog.ts b/lib/routes/imhcg/blog.ts new file mode 100644 index 00000000000000..a45fdd96cd6c6a --- /dev/null +++ b/lib/routes/imhcg/blog.ts @@ -0,0 +1,47 @@ +import { Route, ViewType } from '@/types'; +import ofetch from '@/utils/ofetch'; +import { load } from 'cheerio'; + +export const route: Route = { + path: '/', + categories: ['blog'], + view: ViewType.Notifications, + example: '/', + parameters: {}, + radar: [ + { + source: ['infos.imhcg.cn'], + }, + ], + name: 'Engineering blogs', + maintainers: ['ZiHao256'], + handler, + url: 'https://infos.imhcg.cn/', +}; + +async function handler() { + const response = await ofetch('https://infos.imhcg.cn/'); + const $ = load(response); + const items = $('li') + .toArray() + .map((item) => { + const title = $(item).find('a.title').text(); + const link = $(item).find('a.title').attr('href'); + const author = $(item).find('p.author').text(); + const time = $(item).find('p.time').text(); + const description = $(item).find('p.text').text(); + return { + title, + link, + author, + time, + description, + }; + }); + + return { + title: `Engineering Blogs`, + link: 'https://infos.imhcg.cn/', + item: items, + }; +} diff --git a/lib/routes/imhcg/namespace.ts b/lib/routes/imhcg/namespace.ts new file mode 100644 index 00000000000000..33726f6760cb5f --- /dev/null +++ b/lib/routes/imhcg/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'imhcg的信息站', + url: 'infos.imhcg.cn', + description: '包含多种技术和新闻信息的网站', +};
5199ebbee22506e01c658988c85523337f5bc795
2019-08-21 21:21:23
Neutrino
fix: update sysu/sdcs router, fix #2905 (#2906)
false
update sysu/sdcs router, fix #2905 (#2906)
fix
diff --git a/docs/university.md b/docs/university.md index 014c88bdb57c1a..f6a530326247b4 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1009,4 +1009,4 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet ### 数据科学与计算机学院动态 -<Route author="MegrezZhu" example="/sysu/sdcs" path="/sysu/sdcs" /> +<Route author="Neutrino3316 MegrezZhu" example="/sysu/sdcs" path="/sysu/sdcs" /> diff --git a/lib/routes/universities/sysu/sdcs.js b/lib/routes/universities/sysu/sdcs.js index d91629f8898813..117351ecc50e95 100644 --- a/lib/routes/universities/sysu/sdcs.js +++ b/lib/routes/universities/sysu/sdcs.js @@ -1,56 +1,104 @@ const got = require('@/utils/got'); -const { load } = require('cheerio'); -const { resolve } = require('url'); - -const base = 'http://sdcs.sysu.edu.cn/'; +const cheerio = require('cheerio'); module.exports = async (ctx) => { - const { data } = await got.get('http://sdcs.sysu.edu.cn/'); - const $ = load(data); - - const urls = $('.view-content li > a') - .slice(0, 10) - .map((_, ele) => $(ele).attr('href')) - .toArray() - .map((path) => path.match(/\/content\/(\d+)/)[1]) // extract article-id - .sort() - .reverse() // sort by article-id (or to say, date), latest first - .map((aid) => resolve(base, `/content/${aid}`)); - - ctx.state.data = { - title: '中山大学 - 数据科学与计算机学院', - link: 'http://sdcs.sysu.edu.cn/', - description: '中山大学 - 数据科学与计算机学院', - item: await getDetails(ctx.cache, urls), - }; -}; + const response = await got({ + method: 'get', + url: 'http://sdcs.sysu.edu.cn/', + headers: { + Referer: `http://sdcs.sysu.edu.cn/`, + }, + }); + const $ = cheerio.load(response.data); -const getDetails = (cache, urls) => Promise.all(urls.map((url) => cache.tryGet(url, () => getDetail(url)))); + // 首页有多个板块,每个板块的css选择器不同,而且每个板块的信息分类也不一样 + const block_index = [ + { + index: 1, + description_header: '学院新闻', + }, + { + index: 2, + description_header: '学院通知', + }, + { + index: 3, + description_header: '人才招聘', + }, + { + index: 4, + description_header: '学术活动', + }, + { + index: 5, + description_header: '学工通知', + }, + { + index: 6, + description_header: '学生活动', + }, + { + index: 7, + description_header: '教务通知', + }, + { + index: 8, + description_header: '科研通知', + }, + { + index: 9, + description_header: '人事通知', + }, + { + index: 10, + description_header: '党群工作', + }, + { + index: 11, + description_header: '校友工作', + }, + { + index: 12, + description_header: '社会工作', + }, + ]; -const timezone = 8; -const serverOffset = new Date().getTimezoneOffset() / 60; -const shiftTimezone = (date) => new Date(date.getTime() - 60 * 60 * 1000 * (timezone + serverOffset)).toUTCString(); + function getDetail(item, description_header) { + return { + title: description_header + ': ' + item.attribs.title, + description: description_header + ': ' + item.attribs.title, + link: item.attribs.href, + category: description_header, + }; + } -const getDetail = async (url) => { - const { data } = await got.get(url); - const $ = load(data); + const item_data = []; + for (let i = 0; i < block_index.length; i++) { + const block_news = $('#block-views-homepage-block-' + block_index[i].index + '> div > div.view-content > div > ul > li > a'); + for (let j = 0; j < block_news.length; j++) { + console.log(block_news[j]); + item_data.push(getDetail(block_news[j], block_index[i].description_header)); + } + } - // transforming images - $('.content img').each((_, ele) => { - $(ele).attr('referrerpolicy', 'no-referrer'); - $(ele).attr('src', resolve(base, $(ele).attr('src'))); - }); + function compareLink(a, b) { + let a_str = a.link; + a_str = a_str.substr(a_str.length - 4, 4); + const a_int = parseInt(a_str); + let b_str = b.link; + b_str = b_str.substr(b_str.length - 4, 4); + const b_int = parseInt(b_str); + return b_int - a_int; + } + // 使得新的通知排在前面,假设通知的发布和链接地址是相关的,而且链接地址都是"/content/4961"这样,只有四位数的。 + item_data.sort(compareLink); + // console.log(item_data); - return { - title: $('section > h1').text(), - description: $('.content').html(), - link: url, - pubDate: shiftTimezone( - new Date( - $('.submitted-by') - .text() - .match(/(\d+\/\d+\/\d+)/)[1] - ) - ), + ctx.state.data = { + title: `中山大学 - 数据科学与计算机学院`, + link: `http://sdcs.sysu.edu.cn`, + description: `中山大学 - 数据科学与计算机学院`, + language: `zh-cn`, + item: item_data, }; };
7e0dc17ef86ebbafb18422f317c82d2ba802378c
2024-08-22 21:06:29
Andvari
feat(route/ftm): Add route (#16503)
false
Add route (#16503)
feat
diff --git a/lib/routes/ftm/index.ts b/lib/routes/ftm/index.ts new file mode 100644 index 00000000000000..c840337892a5e6 --- /dev/null +++ b/lib/routes/ftm/index.ts @@ -0,0 +1,60 @@ +import { Route } from '@/types'; + +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; +import cache from '@/utils/cache'; +import ofetch from '@/utils/ofetch'; + +export const route: Route = { + path: '/', + categories: ['new-media'], + example: '/ftm', + parameters: {}, + name: '文章', + maintainers: ['dzx-dzx'], + radar: [ + { + source: ['www.ftm.eu'], + }, + ], + handler, +}; + +async function handler(ctx) { + const rootUrl = 'https://www.ftm.eu'; + const currentUrl = `${rootUrl}/articles`; + const response = await ofetch(currentUrl); + + const $ = load(response); + + const list = $('.article-card') + .toArray() + .map((e) => ({ link: $(e).attr('href'), title: $(e).find('h2').text() })) + .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : Infinity); + + const items = await Promise.all( + list.map((item) => + cache.tryGet(item.link, async () => { + const content = load(await ofetch(item.link)); + const ldjson = JSON.parse(content('[type="application/ld+json"]:not([data-schema])').text()); + + item.pubDate = parseDate(ldjson.datePublished); + item.updated = parseDate(ldjson.dateModified); + + item.author = content("[name='author']") + .toArray() + .map((e) => ({ name: $(e).attr('content') })); + item.category = content('.collection .tab').text().trim() || null; + + item.description = content('.body').html(); + + return item; + }) + ) + ); + return { + title: $('title').text(), + link: currentUrl, + item: items, + }; +} diff --git a/lib/routes/ftm/namespace.ts b/lib/routes/ftm/namespace.ts new file mode 100644 index 00000000000000..df6951f568b4d9 --- /dev/null +++ b/lib/routes/ftm/namespace.ts @@ -0,0 +1,6 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'Follow The Money', + url: 'www.ftm.eu', +};
ab77187fd30a05eec5a2b662f01657239cc34308
2024-03-19 09:40:28
Neko Aria
feat(route): Kemono Posts remove Ad (#14841)
false
Kemono Posts remove Ad (#14841)
feat
diff --git a/lib/routes/kemono/index.ts b/lib/routes/kemono/index.ts index 8bb55038306976..16ecf3be620366 100644 --- a/lib/routes/kemono/index.ts +++ b/lib/routes/kemono/index.ts @@ -125,7 +125,11 @@ async function handler(ctx) { content(this).html(`<img src="${href.startsWith('http') ? href : rootUrl + href}">`); }); - item.description = content('.post__body').html(); + item.description = content('.post__body') + .each(function () { + content(this).find('.ad-container').remove(); + }) + .html(); item.author = content('.post__user-name').text(); item.title = content('.post__title span').first().text(); item.guid = item.link.replace('kemono.su', 'kemono.party');
1309c5083eb60913580d1bb1ae84b0bd3b8aeaa3
2024-10-16 22:37:51
chris zheng
feat(route): add route for graduacted school of CJLU (China Jiliang University) (#17149)
false
add route for graduacted school of CJLU (China Jiliang University) (#17149)
feat
diff --git a/lib/routes/cjlu/namespace.ts b/lib/routes/cjlu/namespace.ts new file mode 100644 index 00000000000000..f1763025c3ba62 --- /dev/null +++ b/lib/routes/cjlu/namespace.ts @@ -0,0 +1,10 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'China Jiliang University', + url: 'www.cjlu.edu.cn', + + zh: { + name: '中国计量大学', + }, +}; diff --git a/lib/routes/cjlu/yjsy/index.ts b/lib/routes/cjlu/yjsy/index.ts new file mode 100644 index 00000000000000..1785e2dc3d6a6b --- /dev/null +++ b/lib/routes/cjlu/yjsy/index.ts @@ -0,0 +1,107 @@ +import { Route } from '@/types'; +import ofetch from '@/utils/ofetch'; +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; +import cache from '@/utils/cache'; +import timezone from '@/utils/timezone'; + +const host = 'https://yjsy.cjlu.edu.cn/'; + +const titleMap = new Map([ + ['yjstz', '中量大研究生院 —— 研究生通知'], + ['jstz', '中量大研究生院 —— 教师通知'], +]); + +export const route: Route = { + path: '/yjsy/:cate', + categories: ['university'], + example: '/cjlu/yjsy/yjstz', + parameters: { + cate: '订阅的类型,支持 yjstz(研究生通知)和 jstz(教师通知)', + }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportRadar: true, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + title: '研究生通知', + source: ['yjsy.cjlu.edu.cn/index/yjstz/:suffix', 'yjsy.cjlu.edu.cn/index/yjstz.htm'], + target: '/yjsy/yjstz', + }, + { + title: '教师通知', + source: ['yjsy.cjlu.edu.cn/index/jstz/:suffix', 'yjsy.cjlu.edu.cn/index/jstz.htm'], + target: '/yjsy/jstz', + }, + ], + name: '研究生院', + maintainers: ['chrisis58'], + handler, + description: `| 研究生通知 | 教师通知 | + | -------- | -------- | + | yjstz | jstz |`, +}; + +async function handler(ctx) { + const cate = ctx.req.param('cate'); + + const response = await ofetch(`${cate}.htm`, { + baseURL: `${host}/index/`, + responseType: 'text', + }); + + const $ = load(response); + + const list = $('div.grid685.right div.body ul') + .find('li') + .toArray() + .map((element) => { + const item = $(element); + + const a = item.find('a').first(); + + const timeStr = item.find('span').first().text().trim(); + const href = a.attr('href') ?? ''; + const route = href.startsWith('../') ? href.replace(/^\.\.\//, '') : href; + + return { + title: a.attr('title') ?? titleMap.get(cate), + pubDate: timezone(parseDate(timeStr, 'YYYY/MM/DD'), +8), + link: `${host}${route}`, + description: '', + }; + }); + + const items = await Promise.all( + list.map((item) => + cache.tryGet(item.link, async () => { + if (!item.link || item.link === host) { + return item; + } + + const res = await ofetch(item.link, { + responseType: 'text', + }); + const $ = load(res); + + const content = $('#vsb_content').html() ?? ''; + const attachments = $('form[name="_newscontent_fromname"] div ul').html() ?? ''; + + item.description = `${content}<br>${attachments}`; + return item; + }) + ) + ); + + return { + title: titleMap.get(cate), + link: `https://yjsy.cjlu.edu.cn/index/${cate}.htm`, + item: items, + }; +}
2a27d95dbd63a33e0daf055fc6d2692eaf28f365
2019-10-12 16:18:01
Scout
fix: cst.zju link bug (#3244)
false
cst.zju link bug (#3244)
fix
diff --git a/lib/routes/universities/zju/cst/index.js b/lib/routes/universities/zju/cst/index.js index f846c877e0a9e4..d19f41ff15d2cd 100644 --- a/lib/routes/universities/zju/cst/index.js +++ b/lib/routes/universities/zju/cst/index.js @@ -28,7 +28,7 @@ async function getPage(id) { return { title: item.find('a').text(), pubDate: new Date(item.find('.fr').text()).toUTCString(), - link: `http://cst.zju.edu.cn/${item.find('a').attr('href')}`, + link: `http://www.cst.zju.edu.cn/${item.find('a').attr('href')}`, }; }) .get()
e7482df4b37684b6ae5702f27b647ca6a211b016
2019-08-20 15:42:45
dependabot-preview[bot]
chore(deps-dev): bump nock from 11.0.0 to 11.3.0
false
bump nock from 11.0.0 to 11.3.0
chore
diff --git a/package.json b/package.json index bba553650ad543..1b5fed8ffc5ebe 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "eslint-plugin-prettier": "3.1.0", "jest": "24.9.0", "mockdate": "2.0.5", - "nock": "11.0.0", + "nock": "11.3.0", "nodemon": "1.19.1", "pinyin": "2.9.0", "prettier": "1.18.2", diff --git a/yarn.lock b/yarn.lock index 5a26f74fb1d48e..3c00951f09b0d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7157,10 +7157,10 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" [email protected]: - version "11.0.0" - resolved "https://registry.yarnpkg.com/nock/-/nock-11.0.0.tgz#ad13e1bcea890d8942cfacc5d0aff5e0ef9a6331" - integrity sha512-lrlqTP3Ii8pT/j86F6tR2kRPUPA/aMWQ8TADzvLLDsZtqXlPdasKbg4G86bsnXUfM5yMlDIs9gIe/i7ZtPmCoA== [email protected]: + version "11.3.0" + resolved "https://registry.yarnpkg.com/nock/-/nock-11.3.0.tgz#a9ddc8271c7f74c4a815bc11eee0ef21e6d3be08" + integrity sha512-j5KXO096ov2XLvISUJQwl3UYJZy5dvArbK8Gt7+r0+gjtTU2uYiWJwhU4yIMXbtlHoX0od2LQgShAKXUObVbrA== dependencies: chai "^4.1.2" debug "^4.1.0"
d691931bc1e8352e2d2d79cee7c60b5ad5091bcb
2020-01-07 12:19:01
TPOB
feat: 添加北大生科院近期讲座 (#3685)
false
添加北大生科院近期讲座 (#3685)
feat
diff --git a/assets/radar-rules.js b/assets/radar-rules.js index fc4821c1979a48..69fb36c0233ba8 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -759,7 +759,7 @@ title: '分类', docs: 'https://docs.rsshub.app/new-media.html#hao-qi-xin-ri-bao', source: '/categories/:idd', - target: (params) => `/qdaily/researcach/${params.idd.replace('.html', '')}`, + target: (params) => `/qdaily/category/${params.idd.replace('.html', '')}`, }, ], }, diff --git a/docs/new-media.md b/docs/new-media.md index f2ca47b2691308..54e9904a8be754 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -411,9 +411,9 @@ Supported sub-sites: <Route author="WenhuWee emdoe SivaGao HenryQW" example="/qdaily/column/59" path="/qdaily/:type/:id" :paramsDesc="['类型,见下表', '对应 id,可在 URL 找到']" radar="1"> -| 标签 | 栏目 | 分类 | -| ---- | ------ | ---------- | -| tag | column | researcach | +| 标签 | 栏目 | 分类 | +| ---- | ------ | -------- | +| tag | column | category | </Route> diff --git a/docs/university.md b/docs/university.md index 3141d7caea5344..dd754028c496e8 100644 --- a/docs/university.md +++ b/docs/university.md @@ -54,6 +54,10 @@ pageClass: routes <Route author="AngUOI" example="/pku/rccp/mzyt" path="/universities/pku/rccp/mzyt" /> +### 生命科学学院近期讲座 + +<Route author="TPOB" example="/pku/cls/lecture" path="/universities/pku/cls/lecture" /> + ## 北京航空航天大学 ### 北京航空航天大学 diff --git a/lib/router.js b/lib/router.js index 08277016f04f7a..d740648ad063b5 100644 --- a/lib/router.js +++ b/lib/router.js @@ -581,6 +581,7 @@ router.get('/lit/tw/:name?', require('./routes/universities/lit/tw')); // 北京大学 router.get('/pku/eecs/:type?', require('./routes/universities/pku/eecs')); router.get('/pku/rccp/mzyt', require('./routes/universities/pku/rccp/mzyt')); +router.get('/pku/cls/lecture', require('./routes/universities/pku/cls/lecture')); // 上海海事大学 router.get('/shmtu/www/:type', require('./routes/universities/shmtu/www')); diff --git a/lib/routes/universities/pku/cls/lecture.js b/lib/routes/universities/pku/cls/lecture.js new file mode 100644 index 00000000000000..7cad270e5c13ee --- /dev/null +++ b/lib/routes/universities/pku/cls/lecture.js @@ -0,0 +1,30 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const homeUrl = 'http://www.bio.pku.edu.cn/homes/Index/news_jz/7/7.html'; +const baseUrl = 'http://www.bio.pku.edu.cn'; + +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: homeUrl, + }); + + const $ = cheerio.load(response.data); + ctx.state.data = { + title: `北京大学生命科学学院近期讲座`, + link: homeUrl, + description: `北京大学生命科学学院近期讲座`, + item: $('a.clearfix') + .map((index, item) => ({ + title: $(item) + .find('p') + .text() + .trim(), + description: '日期: ' + $(item).find('span'), // ${item.find('.chair_txt div').find('span').second().text()} + + link: baseUrl + $('a.clearfix').attr('href'), + })) + .get(), + }; +};
88667c2b1509398413c4ebd750dce6bde4c84c40
2024-04-09 19:02:45
SettingDust
fix(modrinth): switch to ofetch since it's not suppor `got.json()` (#15166)
false
switch to ofetch since it's not suppor `got.json()` (#15166)
fix
diff --git a/lib/routes/modrinth/versions.ts b/lib/routes/modrinth/versions.ts index 41d0bd44fb2026..3f851e43b7bb8a 100644 --- a/lib/routes/modrinth/versions.ts +++ b/lib/routes/modrinth/versions.ts @@ -4,19 +4,20 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; import { config } from '@/config'; -import got from '@/utils/got'; +import _ofetch from '@/utils/ofetch'; import MarkdownIt from 'markdown-it'; import type { Author, Project, Version } from '@/routes/modrinth/api'; import type { Context } from 'hono'; const __dirname = getCurrentPath(import.meta.url); -const customGot = got.extend({ +const ofetch = _ofetch.create({ headers: { // https://docs.modrinth.com/#section/User-Agents 'user-agent': config.trueUA, }, }); + const md = MarkdownIt({ html: true, }); @@ -83,19 +84,19 @@ async function handler(ctx: Context) { */ const parsedQuery = new URLSearchParams(routeParams); - parsedQuery.set('loaders', parsedQuery.has('loaders') ? JSON.stringify(parsedQuery.getAll('loaders')) : ''); - parsedQuery.set('game_versions', parsedQuery.has('game_versions') ? JSON.stringify(parsedQuery.getAll('game_versions')) : ''); - try { - const project = await customGot(`https://api.modrinth.com/v2/project/${id}`).json<Project>(); - const versions = await customGot(`https://api.modrinth.com/v2/project/${id}/version`, { - searchParams: parsedQuery, - }).json<Version[]>(); - const authors = await customGot(`https://api.modrinth.com/v2/users`, { - searchParams: { + const project = await ofetch<Project>(`https://api.modrinth.com/v2/project/${id}`); + const versions = await ofetch<Version[]>(`https://api.modrinth.com/v2/project/${id}/version`, { + query: { + loaders: parsedQuery.has('loaders') ? JSON.stringify(parsedQuery.getAll('loaders')) : '', + game_versions: parsedQuery.has('game_versions') ? JSON.stringify(parsedQuery.getAll('game_versions')) : '', + }, + }); + const authors = await ofetch<Author[]>(`https://api.modrinth.com/v2/users`, { + query: { ids: JSON.stringify([...new Set(versions.map((it) => it.author_id))]), }, - }).json<Author[]>(); + }); const groupedAuthors = <Record<string, Author>>{}; for (const author of authors) { groupedAuthors[author.id] = author;
8f48c7e3ccd8c8441c31ba0c9a800b0f1ea04b99
2023-02-23 09:13:41
dependabot[bot]
chore(deps): bump lru-cache from 7.16.2 to 7.17.0 (#11941)
false
bump lru-cache from 7.16.2 to 7.17.0 (#11941)
chore
diff --git a/package.json b/package.json index 67afe875c3eb9e..44c3332e983c22 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "koa-basic-auth": "4.0.0", "koa-favicon": "2.1.0", "koa-mount": "4.0.0", - "lru-cache": "7.16.2", + "lru-cache": "7.17.0", "lz-string": "1.4.4", "mailparser": "3.6.3", "markdown-it": "13.0.1", diff --git a/yarn.lock b/yarn.lock index a638513db3269a..d070555f781030 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9240,10 +9240,10 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== [email protected], lru-cache@^7.7.1: - version "7.16.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.16.2.tgz#df096ce4374d0cf9d34f29a35832c80534af54b6" - integrity sha512-t6D6OM05Y3f+61zNnXh/+0D69kAgJKVEWLuWL1r38CIHRPTWpNjwpR7S+nmiQlG5GmUB1BDiiMjU1Ihs4YBLlg== [email protected], lru-cache@^7.7.1: + version "7.17.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.17.0.tgz#00c7ba5919e5ea7c69ff94ddabbf32cb09ab805c" + integrity sha512-zSxlVVwOabhVyTi6E8gYv2cr6bXK+8ifYz5/uyJb9feXX6NACVDwY4p5Ut3WC3Ivo/QhpARHU3iujx2xGAYHbQ== lru-cache@^4.0.1, lru-cache@^4.1.2: version "4.1.5"
8085bd785348d0b897ab24d46dc084a4debdedd4
2022-08-16 02:39:22
dependabot[bot]
chore(deps): bump twitter-api-v2 from 1.12.3 to 1.12.5 (#10487)
false
bump twitter-api-v2 from 1.12.3 to 1.12.5 (#10487)
chore
diff --git a/package.json b/package.json index 1b06a1789b6c9d..65969ca140830d 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "torrent-search-api": "2.1.4", "tough-cookie": "4.0.0", "tunnel": "0.0.6", - "twitter-api-v2": "1.12.3", + "twitter-api-v2": "1.12.5", "winston": "3.8.1", "xml2js": "0.4.23" }, diff --git a/yarn.lock b/yarn.lock index a2deac71acff63..2704389b754fcf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13592,10 +13592,10 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== [email protected]: - version "1.12.3" - resolved "https://registry.yarnpkg.com/twitter-api-v2/-/twitter-api-v2-1.12.3.tgz#9f05321ea83afd9de96ac18aa721aae339110302" - integrity sha512-FM+RmHdVbCKw/KZ99+if4JQyl2Nx5eF/Jl8CNDeV5J/NSnuFgk3bFw1cZHcNusXitxTWIQ0TQFHr1BkgWDz0wQ== [email protected]: + version "1.12.5" + resolved "https://registry.yarnpkg.com/twitter-api-v2/-/twitter-api-v2-1.12.5.tgz#50b66eabb29ed89b0eb9d911cc4aef8800df65ce" + integrity sha512-kgsEjRfm2kdvAgqXd5druYYxykXEXamae6V/TDyYnws0MClcYBlbtOyGn/HPXEfn2NylbQrjDwkCLaD3qkRgMA== type-check@^0.4.0, type-check@~0.4.0: version "0.4.0"
40aa69ff0eac9e51191af5a201843b6855d73ddd
2020-02-04 14:02:45
junfengP
fix: full text error in discuz (#3880)
false
full text error in discuz (#3880)
fix
diff --git a/lib/routes/discuz/discuz.js b/lib/routes/discuz/discuz.js index 24e5e287015bd9..197f96182f55f7 100644 --- a/lib/routes/discuz/discuz.js +++ b/lib/routes/discuz/discuz.js @@ -25,11 +25,14 @@ async function load(baseUrl, itemLink, ctx, charset) { // 处理编码问题 let responseData; if (charset === 'utf-8') { - responseData = await got.get(itemLink).data; + responseData = (await got.get(itemLink)).data; } else { responseData = iconv.decode((await got.get({ url: itemLink, responseType: 'buffer' })).data, charset); } - + if (!responseData) { + const description = '获取详细内容失败'; + return { description }; + } const $ = cheerio.load(responseData); // 只抓取论坛1楼消息 const description = $('div#postlist div[id^=post] td[id^=postmessage]')
196d874cce5bc3df4ae8391dfa0a8f66f27dea37
2021-08-13 11:40:12
NeverBehave
chore(dockerfile): bump builder image
false
bump builder image
chore
diff --git a/Dockerfile b/Dockerfile index 55251a8335b3bc..a87c494a6cf879 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14-slim as dep-builder +FROM node:14-buster-slim as dep-builder LABEL MAINTAINER https://github.com/DIYgod/RSSHub/
8958e742a33ec68e49855a946bf5f5410543cc03
2023-08-16 21:57:40
dependabot[bot]
chore(deps-dev): bump prettier from 3.0.1 to 3.0.2 (#13042)
false
bump prettier from 3.0.1 to 3.0.2 (#13042)
chore
diff --git a/package.json b/package.json index 77fdb36d069861..445a729ba0b5de 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "mockdate": "3.0.5", "nock": "13.3.2", "nodemon": "3.0.1", - "prettier": "3.0.1", + "prettier": "3.0.2", "remark": "13.0.0", "remark-frontmatter": "3.0.0", "remark-gfm": "1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3178c6104c8629..d5b80ae33f32bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -219,7 +219,7 @@ devDependencies: version: 16.0.1([email protected]) eslint-plugin-prettier: specifier: 5.0.0 - version: 5.0.0([email protected])([email protected])([email protected]) + version: 5.0.0([email protected])([email protected])([email protected]) eslint-plugin-yml: specifier: 1.8.0 version: 1.8.0([email protected]) @@ -248,8 +248,8 @@ devDependencies: specifier: 3.0.1 version: 3.0.1 prettier: - specifier: 3.0.1 - version: 3.0.1 + specifier: 3.0.2 + version: 3.0.2 remark: specifier: 13.0.0 version: 13.0.0 @@ -267,7 +267,7 @@ devDependencies: version: 9.0.0 remark-preset-prettier: specifier: 0.5.1 - version: 0.5.1([email protected]) + version: 0.5.1([email protected]) remark-stringify: specifier: 9.0.1 version: 9.0.1 @@ -2946,7 +2946,7 @@ packages: semver: 7.5.4 dev: true - /[email protected]([email protected])([email protected])([email protected]): + /[email protected]([email protected])([email protected])([email protected]): resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2962,7 +2962,7 @@ packages: dependencies: eslint: 8.47.0 eslint-config-prettier: 9.0.0([email protected]) - prettier: 3.0.1 + prettier: 3.0.2 prettier-linter-helpers: 1.0.0 synckit: 0.8.5 dev: true @@ -6094,8 +6094,8 @@ packages: fast-diff: 1.3.0 dev: true - /[email protected]: - resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} + /[email protected]: + resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} engines: {node: '>=14'} hasBin: true dev: true @@ -6461,13 +6461,13 @@ packages: - supports-color dev: true - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-cJx49HCHwA/3EWjIDiRTWPBBpGSkJlXOpcjdqcT6rGFFE+gjCrGSbNdgBQiLbBqXippZFD0OrI4bOWsWhulKrw==} engines: {node: '>=12'} peerDependencies: prettier: '>=1.0.0' dependencies: - prettier: 3.0.1 + prettier: 3.0.2 dev: true /[email protected]:
f03658b751b67a64b49b9f981379efd2bc6a0f14
2021-02-27 09:09:04
dependabot-preview[bot]
chore(deps-dev): bump nock from 13.0.7 to 13.0.9
false
bump nock from 13.0.7 to 13.0.9
chore
diff --git a/package.json b/package.json index fcdb4a51ca60b6..9cf7114c100adb 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "eslint-plugin-prettier": "3.3.1", "jest": "26.6.3", "mockdate": "3.0.2", - "nock": "13.0.7", + "nock": "13.0.9", "nodemon": "2.0.7", "pinyin": "2.9.1", "prettier": "2.2.1", diff --git a/yarn.lock b/yarn.lock index 10e62e162045e6..ff1cb11ab5c4d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9027,10 +9027,10 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" [email protected]: - version "13.0.7" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.7.tgz#9bc718c66bd0862dfa14601a9ba678a406127910" - integrity sha512-WBz73VYIjdbO6BwmXODRQLtn7B5tldA9pNpWJe5QTtTEscQlY5KXU4srnGzBOK2fWakkXj69gfTnXGzmrsaRWw== [email protected]: + version "13.0.9" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.9.tgz#32b9f6408a71991b25f044109cac92ee556c8539" + integrity sha512-SoGx/J0SsZPOdBFrBC9PP6NwaEgOBQIRPbsOsO9q+OwOPWc5eT6wALSxn3ZNE4Fv2ImIUXM4Hv/07rjq/uWDew== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1"
640ef061b264cc696561bd4394156f263b4fdd15
2020-07-09 14:29:17
DIYgod
test: format
false
format
test
diff --git a/docs/en/university.md b/docs/en/university.md index dbd45b04a62d16..d9419e6777f4c3 100644 --- a/docs/en/university.md +++ b/docs/en/university.md @@ -18,12 +18,6 @@ pageClass: routes <RouteEn author="LogicJake" example="/mit/graduateadmissions/category/beyond-the-lab" path="/mit/graduateadmissions/category/:name" :paramsDesc="['category name which can be found in url']"/> -## Polimi - -### News - -<RouteEn author="exuanbo" example="/polimi/news" path="/polimi/news/:language?" :paramsDesc="['English language code en']" /> - ## UMASS Amherst ### College of Electrical and Computer Engineering News @@ -33,3 +27,9 @@ pageClass: routes ### College of Information & Computer Sciences News <RouteEn author="gammapi" example="/umass/amherst/csnews" path="/umass/amherst/csnews" radar="1"/> + +## Polimi + +### News + +<RouteEn author="exuanbo" example="/polimi/news" path="/polimi/news/:language?" :paramsDesc="['English language code en']" />
f2ebdce24659e96226e856dbe4008e0ef290e0c8
2020-03-02 21:45:17
hoilc
feat: add lagou (#4142)
false
add lagou (#4142)
feat
diff --git a/docs/programming.md b/docs/programming.md index 0d940870b462cd..bc4349cc1e8a6c 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -510,6 +510,18 @@ GitHub 官方也提供了一些 RSS: <Route author="loveely7" example="/oschina/topic/weekly-news" path="/oschina/topic/:topic" :paramsDesc="['主题名, 可从[全部主题](https://www.oschina.net/question/topics)进入主题页, 在 URL 中找到']"/> +## 拉勾网 + +::: tip 提示 + +拉勾网官方提供职位的[邮件订阅](https://www.lagou.com/s/subscribe.html),请根据自身需要选择使用。 + +::: + +### 职位招聘 + +<Route author="hoilc" example="/lagou/jobs/JavaScript/上海" path="/lagou/jobs/:position/:city" :paramsDesc="['职位名,可以参考[拉勾网首页](https://www.lagou.com)的职位列表', '城市名,请参考[拉勾网支持的全部城市](https://www.lagou.com/jobs/allCity.html)']"/> + ## 洛谷 ### 日报 diff --git a/lib/router.js b/lib/router.js index 221da5b38b92ea..8c6104d05ceb69 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2321,6 +2321,9 @@ router.get('/blogs/hedwig/:type', require('./routes/blogs/hedwig')); // LoveHeaven router.get('/loveheaven/update/:slug', require('./routes/loveheaven/update')); +// 拉勾 +router.get('/lagou/jobs/:position/:city', require('./routes/lagou/jobs')); + // 扬州大学 router.get('/yzu/home/:type', require('./routes/universities/yzu/home')); router.get('/yzu/yjszs/:type', require('./routes/universities/yzu/yjszs')); diff --git a/lib/routes/lagou/jobs.js b/lib/routes/lagou/jobs.js new file mode 100644 index 00000000000000..886ba040607b20 --- /dev/null +++ b/lib/routes/lagou/jobs.js @@ -0,0 +1,59 @@ +const got = require('@/utils/got'); + +async function getCookie(url, ctx) { + const cache_key = `lagou-cookie-${new Date().toLocaleDateString()}`; + const cached_cookie = await ctx.cache.get(cache_key); + if (cached_cookie) { + return cached_cookie; + } + const { headers } = await got.get(url, { headers: { Referer: 'https://www.lagou.com/' } }); + const cookie = headers['set-cookie'] + .filter((c) => c.match(/(user_trace_token|X_HTTP_TOKEN)/)) + .map((c) => c.split(';')[0]) + .join('; '); + ctx.cache.set(cache_key, cookie); + return cookie; +} + +module.exports = async (ctx) => { + const city = ctx.params.city; + const position = ctx.params.position; + + const url = `https://www.lagou.com/jobs/list_${encodeURIComponent(position)}?px=new&city=${encodeURIComponent(city)}`; + + const cookie = await getCookie(url, ctx); + + const response = await got({ + method: 'post', + url: `https://www.lagou.com/jobs/positionAjax.json?px=new&city=${encodeURIComponent(city)}&needAddtionalResult=false`, + headers: { + Referer: url, + Cookie: cookie, + }, + form: { + first: true, + pn: 1, + kd: position, + }, + }); + + if (!response.data.success) { + throw response.data.msg; + } + + const list = response.data.content.positionResult.result; + + ctx.state.data = { + title: `${position} - ${city} - 拉勾网`, + link: url, + item: list.map((item) => ({ + title: `${item.positionName}[${city === '全国' ? item.city + '·' : ''}${item.businessZones ? item.businessZones[0] : item.district}] - ${item.companyShortName}`, + author: item.companyShortName, + description: `薪资:${item.salary}<br>要求:${item.workYear} / ${item.education}<br>公司名称:${item.companyFullName}<br>公司描述:${item.industryField} / ${item.financeStage} / ${item.companySize}${ + item.companyLabelList && item.companyLabelList.length !== 0 ? '<br>公司标签:' + item.companyLabelList.join(', ') : '' + }<br>职位优势:${item.positionAdvantage}${item.positionLables ? '<br>职位标签:' + item.positionLables.join(', ') : ''}${item.linestaion ? '<br>附近线路:' + item.linestaion : ''}`, + link: `https://www.lagou.com/jobs/${item.positionId}.html`, + pubDate: new Date(item.createTime), + })), + }; +};
d354f8146713544ab7e378a686b2d6c028e01783
2024-09-07 19:36:41
hinus
feat(route): add lu.ma (#16650)
false
add lu.ma (#16650)
feat
diff --git a/lib/routes/luma/index.ts b/lib/routes/luma/index.ts new file mode 100644 index 00000000000000..795e34c9818ba1 --- /dev/null +++ b/lib/routes/luma/index.ts @@ -0,0 +1,92 @@ +import { Route } from '@/types'; +import { parseDate } from '@/utils/parse-date'; +import ofetch from '@/utils/ofetch'; + +export const route: Route = { + path: '/:url', + name: 'Events', + url: 'lu.ma', + maintainers: ['cxheng315'], + example: '/luma/yieldnest', + categories: ['other'], + parameters: { + url: 'LuMa URL', + }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + source: ['lu.ma/:url'], + target: '/:url', + }, + ], + handler, +}; + +async function handler(ctx) { + const endpoint = 'https://api.lu.ma/url?url=' + ctx.req.param('url'); + + const response = await ofetch(endpoint); + + let items; + + switch (response.kind) { + case 'calendar': + items = response.data.featured_items.map((item) => ({ + title: item.event.name, + link: 'https://lu.ma/' + item.event.url, + author: item.hosts ? item.hosts.map((host) => host.name).join(', ') : '', + guid: item.event.api_id, + pubDate: parseDate(item.event.start_at), + itunes_item_image: item.event.cover_url, + itunes_duration: (new Date(item.event.end_at).getTime() - new Date(item.event.start_at).getTime()) / 1000, + })); + break; + case 'event': + items = [ + { + title: response.data.event.name, + link: 'https://lu.ma/' + response.data.event.url, + author: response.data.hosts ? response.data.hosts.map((host) => host.name).join(', ') : '', + guid: response.data.event.api_id, + pubDate: parseDate(response.data.event.start_at), + itunes_item_image: response.data.event.cover_url, + itunes_duration: (new Date(response.data.event.end_at).getTime() - new Date(response.data.event.start_at).getTime()) / 1000, + }, + ]; + break; + case 'discover-place': + items = response.data.events.map((item) => ({ + title: item.event.name, + link: 'https://lu.ma/' + item.event.url, + author: item.hosts ? item.hosts.map((host) => host.name).join(', ') : '', + guid: item.event.api_id, + pubDate: parseDate(item.event.start_at), + itunes_item_image: item.event.cover_url, + itunes_duration: (new Date(item.event.end_at).getTime() - new Date(item.event.start_at).getTime()) / 1000, + })); + break; + default: + items = [ + { + title: 'Not Found', + link: 'Not Found', + }, + ]; + break; + } + + return { + title: response.data.calendar ? response.data.calendar.name : response.data.place.name, + description: response.data.place ? response.data.place.description : '', + link: 'https://lu.ma/' + ctx.req.param('url'), + image: response.data.calendar ? response.data.calendar.cover_url : response.data.place.cover_url, + item: items, + }; +} diff --git a/lib/routes/luma/namespace.ts b/lib/routes/luma/namespace.ts new file mode 100644 index 00000000000000..c861fab33baf8c --- /dev/null +++ b/lib/routes/luma/namespace.ts @@ -0,0 +1,6 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'LuMa', + url: 'lu.ma', +};
1a8988660eba25e1c4f005fc245c7097b17c9cf3
2024-11-13 15:06:55
dependabot[bot]
chore(deps): bump hono from 4.6.9 to 4.6.10 (#17568)
false
bump hono from 4.6.9 to 4.6.10 (#17568)
chore
diff --git a/package.json b/package.json index 68fce1897ae9da..11f6f489ca6743 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.9", + "hono": "4.6.10", "html-to-text": "9.0.5", "http-cookie-agent": "6.0.6", "https-proxy-agent": "7.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 372f904126e880..b96fcfd35c4551 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,10 +19,10 @@ importers: version: 4.1.1 '@hono/node-server': specifier: 1.13.6 - version: 1.13.6([email protected]) + version: 1.13.6([email protected]) '@hono/zod-openapi': specifier: 0.17.0 - version: 0.17.0([email protected])([email protected]) + version: 0.17.0([email protected])([email protected]) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -55,7 +55,7 @@ importers: version: 0.0.23 '@scalar/hono-api-reference': specifier: 0.5.159 - version: 0.5.159([email protected]) + version: 0.5.159([email protected]) '@sentry/node': specifier: 7.119.1 version: 7.119.1 @@ -114,8 +114,8 @@ importers: specifier: 144.0.0 version: 144.0.0 hono: - specifier: 4.6.9 - version: 4.6.9 + specifier: 4.6.10 + version: 4.6.10 html-to-text: specifier: 9.0.5 version: 9.0.5 @@ -3479,8 +3479,8 @@ packages: [email protected]: resolution: {integrity: sha512-4FP6J0oI8jqb6gLLl9tSwVdosWJ/AKSGJ+HwYf6Ixe4MUcEkst4uWzpVQrNOCin0fzTRQbXV8ePheU8WiiDYBw==} - [email protected]: - resolution: {integrity: sha512-p/pN5yZLuZaHzyAOT2nw2/Ud6HhJHYmDNGH6Ck1OWBhPMVeM1r74jbCRwNi0gyFRjjbsGgoHbOyj7mT1PDNbTw==} + [email protected]: + resolution: {integrity: sha512-IXXNfRAZEahFnWBhUUlqKEGF9upeE6hZoRZszvNkyAz/CYp+iVbxm3viMvStlagRJohjlBRGOQ7f4jfcV0XMGg==} engines: {node: '>=16.9.0'} [email protected]: @@ -6851,20 +6851,20 @@ snapshots: dependencies: levn: 0.4.1 - '@hono/[email protected]([email protected])': + '@hono/[email protected]([email protected])': dependencies: - hono: 4.6.9 + hono: 4.6.10 - '@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.3.0([email protected])([email protected]) - hono: 4.6.9 + '@hono/zod-validator': 0.3.0([email protected])([email protected]) + hono: 4.6.10 zod: 3.23.8 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: - hono: 4.6.9 + hono: 4.6.10 zod: 3.23.8 '@humanfs/[email protected]': {} @@ -7275,10 +7275,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.19 - hono: 4.6.9 + hono: 4.6.10 '@scalar/[email protected]': {} @@ -9296,7 +9296,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: {}
932ea079c632ae6d82b04ca74c3a2310c20c321a
2019-07-27 09:20:05
SunShinenny
feat: 开眼首页 (#2699)
false
开眼首页 (#2699)
feat
diff --git a/docs/multimedia.md b/docs/multimedia.md index b07ddca9130f82..42b341e328128d 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -206,6 +206,12 @@ pageClass: routes <Route author="Songkeys" example="/gaoqing/latest" path="/gaoqing/latest"/> +## 开眼 + +### 每日精选 + +<Route author="SunShinenny" example="/kaiyan/index" path="/kaiyan/index"/> + ## 猫眼电影 ### 正在热映 diff --git a/docs/other.md b/docs/other.md index afa5bd7ade7242..efcdc6a063bad2 100644 --- a/docs/other.md +++ b/docs/other.md @@ -1098,6 +1098,32 @@ type 为 all 时,category 参数不支持 cost 和 free </Route> +## 站酷 + +### 推荐 + +<Route author="junbaor" example="/zcool/recommend/all" path="/zcool/recommend/:type" :paramsDesc="['推荐类型,详见下面的表格']"> + +推荐类型 + +| all | home | edit | +| -------- | -------- | -------- | +| 全部推荐 | 首页推荐 | 编辑推荐 | + +</Route> + +### 作品总榜单 + +<Route author="junbaor" example="/zcool/top" path="/zcool/top"/> + +### 用户作品 + +<Route author="junbaor" example="/zcool/user/baiyong" path="/zcool/user/:uname" :paramsDesc="['个性域名前缀']"> + +例如: 站酷的个人主页 `https://baiyong.zcool.com.cn` 对应 rss 路径 `/zcool/user/baiyong` + +</Route> + ## 正版中国 ### 分类列表 @@ -1145,29 +1171,3 @@ type 为 all 时,category 参数不支持 cost 和 free ### 全文 <Route author="HenryQW" example="/zzz" path="/zzz/index"/> - -## 站酷 - -### 推荐 - -<Route author="junbaor" example="/zcool/recommend/all" path="/zcool/recommend/:type" :paramsDesc="['推荐类型,详见下面的表格']"> - -推荐类型 - -| all | home | edit | -| -------- | -------- | -------- | -| 全部推荐 | 首页推荐 | 编辑推荐 | - -</Route> - -### 作品总榜单 - -<Route author="junbaor" example="/zcool/top" path="/zcool/top"/> - -### 用户作品 - -<Route author="junbaor" example="/zcool/user/baiyong" path="/zcool/user/:uname" :paramsDesc="['个性域名前缀']"> - -例如: 站酷的个人主页 `https://baiyong.zcool.com.cn` 对应 rss 路径 `/zcool/user/baiyong` - -</Route> diff --git a/lib/router.js b/lib/router.js index 8b44ef8058d1b0..5630a096cd596f 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1579,4 +1579,7 @@ router.get('/yidoutang/guide', require('./routes/yidoutang/guide.js')); router.get('/yidoutang/mtest', require('./routes/yidoutang/mtest.js')); router.get('/yidoutang/case/:type', require('./routes/yidoutang/case.js')); +// 开眼 +router.get('/kaiyan/index', require('./routes/kaiyan/index')); + module.exports = router; diff --git a/lib/routes/kaiyan/index.js b/lib/routes/kaiyan/index.js new file mode 100644 index 00000000000000..d8fd59a030379c --- /dev/null +++ b/lib/routes/kaiyan/index.js @@ -0,0 +1,50 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + // const id = ctx.params.id; + const api_url = `https://baobab.kaiyanapp.com/api/v5/index/tab/allRec`; + const response = await got({ + method: 'get', + url: api_url, + }); + const list = response.data.itemList[0].data.itemList; + const out = await Promise.all( + list.map(async (item) => { + if (item.type === 'followCard') { + // 截取Json一部分 + const content = item.data.content; + // 得到需要的RSS信息 + const title = content.data.title; // 标题 + const date = item.data.header.time; // 发布日期 + const itemUrl = `<video src="${content.data.playUrl}" controls="controls"></video>`; // 视频链接 + const imgUrl = `<img src="${content.data.cover.feed}" />`; // 图片链接 + const author = content.data.author.name; // 作者 + const description = content.data.description + '<br/>' + imgUrl + '<br/>' + itemUrl; // 拼接出描述 + + const cache = await ctx.cache.get(itemUrl); // 得到全局中的缓存信息 + // 判断缓存是否存在,如果存在即跳过此次获取的信息 + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + // 设置 RSS feed item + const single = { + title: title, + link: itemUrl, + author: author, + description: description, + pubDate: new Date(date).toUTCString(), + }; + // 设置缓存 + ctx.cache.set(itemUrl, JSON.stringify(single)); + return Promise.resolve(single); + } + }) + ); + + ctx.state.data = { + title: `开眼精选`, + link: '', + description: '开眼每日精选', + item: out, + }; +};
a8058f292167a03f3d064376d5741fcc0c671ff1
2023-07-04 18:15:26
Tony
fix(route): mingpao keep redirecting (#12753)
false
mingpao keep redirecting (#12753)
fix
diff --git a/lib/v2/mingpao/index.js b/lib/v2/mingpao/index.js index 7b82c3a7920869..043dafbb1a2c0d 100644 --- a/lib/v2/mingpao/index.js +++ b/lib/v2/mingpao/index.js @@ -4,6 +4,7 @@ const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); const { art } = require('@/utils/render'); const path = require('path'); +const logger = require('@/utils/logger'); const renderFanBox = (media) => art(path.join(__dirname, 'templates/fancybox.art'), { @@ -26,11 +27,20 @@ module.exports = async (ctx) => { const items = await Promise.all( feed.items.map((item) => ctx.cache.tryGet(item.link, async () => { - const response = await got(item.link, { - headers: { - Referer: 'https://news.mingpao.com/', - }, - }); + let response; + try { + response = await got(item.link, { + headers: { + Referer: 'https://news.mingpao.com/', + }, + }); + } catch (e) { + if (e instanceof got.MaxRedirectsError) { + logger.error(`MaxRedirectsError when requesting ${decodeURIComponent(item.link)}`); + return item; + } + throw e; + } const $ = cheerio.load(response.data); const fancyboxImg = $('a.fancybox').length ? $('a.fancybox') : $('a.fancybox-buttons'); @@ -71,7 +81,7 @@ module.exports = async (ctx) => { item.description = renderDesc(fancybox, $('.txt4').html() ?? $('.article_content.line_1_5em').html()); item.pubDate = parseDate(item.pubDate); - item.guid = item.link.indexOf('?') > 0 ? item.link : item.link.substring(0, item.link.lastIndexOf('/')); + item.guid = item.link.includes('?') ? item.link : item.link.substring(0, item.link.lastIndexOf('/')); return item; })
9e50ce8d1373873104867a55d644e8322a92ae9b
2025-02-07 17:11:20
dependabot[bot]
chore(deps): bump @opentelemetry/semantic-conventions (#18296)
false
bump @opentelemetry/semantic-conventions (#18296)
chore
diff --git a/package.json b/package.json index 89ca58864049eb..c7e4ed90612c9d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@opentelemetry/resources": "1.30.1", "@opentelemetry/sdk-metrics": "1.30.1", "@opentelemetry/sdk-trace-base": "1.30.1", - "@opentelemetry/semantic-conventions": "1.28.0", + "@opentelemetry/semantic-conventions": "1.29.0", "@postlight/parser": "2.2.3", "@rss3/sdk": "0.0.25", "@scalar/hono-api-reference": "0.5.172", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e0e6f858d0e4b..774e27c9ce7ea6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: 1.30.1 version: 1.30.1(@opentelemetry/[email protected]) '@opentelemetry/semantic-conventions': - specifier: 1.28.0 - version: 1.28.0 + specifier: 1.29.0 + version: 1.29.0 '@postlight/parser': specifier: 2.2.3 version: 2.2.3 @@ -1614,6 +1614,10 @@ packages: resolution: {integrity: sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==} engines: {node: '>=14'} + '@opentelemetry/[email protected]': + resolution: {integrity: sha512-KZ1JsXcP2pqunfsJBNk+py6AJ5R6ZJ3yvM5Lhhf93rHPHvdDzgfMYPS4F7GNO3j/MVDCtfbttrkcpu7sl0Wu/Q==} + engines: {node: '>=14'} + '@otplib/[email protected]': resolution: {integrity: sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==} @@ -7002,6 +7006,8 @@ snapshots: '@opentelemetry/[email protected]': {} + '@opentelemetry/[email protected]': {} + '@otplib/[email protected]': {} '@otplib/[email protected]':
b1a817a65ffa32ba0a0b5c211829afa7eedc4f40
2020-11-01 21:22:08
Shun Zi
fix: weibo keyword: default showAuthorInTitle & showAuthorInDesc should not override routeParams (#6075)
false
weibo keyword: default showAuthorInTitle & showAuthorInDesc should not override routeParams (#6075)
fix
diff --git a/docs/social-media.md b/docs/social-media.md index 893885f2ef54de..3ece728be3f040 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -916,21 +916,21 @@ rule 对于微博内容,在 `routeParams` 参数中以 query string 格式指定选项,可以控制输出的样式 -| 键 | 含义 | 接受的值 | 默认值 | -| -------------------------- | -------------------------------------------------------------- | -------------- | ------ | -| readable | 是否开启细节排版可读性优化 | 0/1/true/false | false | -| authorNameBold | 是否加粗作者名字 | 0/1/true/false | false | -| showAuthorInTitle | 是否在标题处显示作者 | 0/1/true/false | false | -| showAuthorInDesc | 是否在正文处显示作者 | 0/1/true/false | false | -| showAuthorAvatarInDesc | 是否在正文处显示作者头像(若阅读器会提取正文图片,不建议开启) | 0/1/true/false | false | -| showEmojiForRetweet | 显示 “🔁” 取代 “转发” 两个字 | 0/1/true/false | false | -| showRetweetTextInTitle | 在标题出显示转发评论(置为 false 则在标题只显示被转发微博) | 0/1/true/false | true | -| addLinkForPics | 为图片添加可点击的链接 | 0/1/true/false | false | -| showTimestampInDescription | 在正文处显示被转发微博的时间戳 | 0/1/true/false | false | -| widthOfPics | 微博配图宽(生效取决于阅读器) | 不指定 / 数字 | 不指定 | -| heightOfPics | 微博配图高(生效取决于阅读器) | 不指定 / 数字 | 不指定 | -| sizeOfAuthorAvatar | 作者头像大小 | 数字 | 48 | -| displayVideo | 是否直接显示微博视频,只在博主 RSS 中有效 | 0/1/true/false | true | +| 键 | 含义 | 接受的值 | 默认值 | +| -------------------------- | -------------------------------------------------------------- | -------------- | ----------------------------------- | +| readable | 是否开启细节排版可读性优化 | 0/1/true/false | false | +| authorNameBold | 是否加粗作者名字 | 0/1/true/false | false | +| showAuthorInTitle | 是否在标题处显示作者 | 0/1/true/false | false(`/weibo/keyword/`中为 true) | +| showAuthorInDesc | 是否在正文处显示作者 | 0/1/true/false | false(`/weibo/keyword/`中为 true) | +| showAuthorAvatarInDesc | 是否在正文处显示作者头像(若阅读器会提取正文图片,不建议开启) | 0/1/true/false | false | +| showEmojiForRetweet | 显示 “🔁” 取代 “转发” 两个字 | 0/1/true/false | false | +| showRetweetTextInTitle | 在标题出显示转发评论(置为 false 则在标题只显示被转发微博) | 0/1/true/false | true | +| addLinkForPics | 为图片添加可点击的链接 | 0/1/true/false | false | +| showTimestampInDescription | 在正文处显示被转发微博的时间戳 | 0/1/true/false | false | +| widthOfPics | 微博配图宽(生效取决于阅读器) | 不指定 / 数字 | 不指定 | +| heightOfPics | 微博配图高(生效取决于阅读器) | 不指定 / 数字 | 不指定 | +| sizeOfAuthorAvatar | 作者头像大小 | 数字 | 48 | +| displayVideo | 是否直接显示微博视频,只在博主 RSS 中有效 | 0/1/true/false | true | 指定更多与默认值不同的参数选项可以改善 RSS 的可读性,如 diff --git a/lib/routes/weibo/keyword.js b/lib/routes/weibo/keyword.js index 918fc05f0531dd..ac0fb1228c9b52 100644 --- a/lib/routes/weibo/keyword.js +++ b/lib/routes/weibo/keyword.js @@ -1,6 +1,8 @@ +const querystring = require('querystring'); const got = require('@/utils/got'); const weiboUtils = require('./utils'); const date = require('@/utils/date'); +const { fallback, queryToBoolean } = require('@/utils/readable-social'); module.exports = async (ctx) => { const keyword = ctx.params.keyword; @@ -17,6 +19,7 @@ module.exports = async (ctx) => { }); const data = response.data.data.cards; + const routeParams = querystring.parse(ctx.params.routeParams); ctx.state.data = { title: `又有人在微博提到${keyword}了`, link: `http://s.weibo.com/weibo/${encodeURIComponent(keyword)}&b=1&nodup=1`, @@ -27,8 +30,8 @@ module.exports = async (ctx) => { item.mblog.retweeted_status.created_at = date(item.mblog.retweeted_status.created_at, 8); } const formatExtended = weiboUtils.formatExtended(ctx, item.mblog, { - showAuthorInTitle: true, - showAuthorInDesc: true, + showAuthorInTitle: fallback(undefined, queryToBoolean(routeParams.showAuthorInTitle), true), + showAuthorInDesc: fallback(undefined, queryToBoolean(routeParams.showAuthorInDesc), true), }); const title = formatExtended.title; const description = formatExtended.description;
a1c8e9a8fd990226855f6f54551ad22924b27655
2025-01-23 20:16:53
Stephen Zhou
fix(ali213): missing link and id (#18199)
false
missing link and id (#18199)
fix
diff --git a/lib/routes/ali213/news.ts b/lib/routes/ali213/news.ts index e5afb903aa66a8..0d0ecba9d92e31 100644 --- a/lib/routes/ali213/news.ts +++ b/lib/routes/ali213/news.ts @@ -133,10 +133,10 @@ export const handler = async (ctx: Context): Promise<Data> => { .filter((_): _ is { url: string; type: string; content_html: string } => true); return { + ...item, title, description, pubDate: timezone(parseDate($$('div.newstag_l').text().split(/\s/)[0]), +8), - author: item.author, content: { html: description, text: $$('div#Content').html() ?? '',
ab91234ddf3b18c9bcecb63d426e541fd09e489e
2024-05-09 17:44:12
dependabot[bot]
chore(deps-dev): bump @vercel/nft from 0.26.4 to 0.26.5 (#15525)
false
bump @vercel/nft from 0.26.4 to 0.26.5 (#15525)
chore
diff --git a/package.json b/package.json index 4e61f6596417ac..14797239775a47 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "@types/uuid": "9.0.8", "@typescript-eslint/eslint-plugin": "7.8.0", "@typescript-eslint/parser": "7.8.0", - "@vercel/nft": "0.26.4", + "@vercel/nft": "0.26.5", "@vitest/coverage-v8": "1.6.0", "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c957d7b12cfd1..7b27232591d711 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -319,8 +319,8 @@ importers: specifier: 7.8.0 version: 7.8.0([email protected])([email protected]) '@vercel/nft': - specifier: 0.26.4 - version: 0.26.4 + specifier: 0.26.5 + version: 0.26.5 '@vitest/coverage-v8': specifier: 1.6.0 version: 1.6.0([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) @@ -1769,8 +1769,8 @@ packages: '@ungap/[email protected]': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@vercel/[email protected]': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} + '@vercel/[email protected]': + resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} engines: {node: '>=16'} hasBin: true @@ -7047,7 +7047,7 @@ snapshots: '@ungap/[email protected]': {} - '@vercel/[email protected]': + '@vercel/[email protected]': dependencies: '@mapbox/node-pre-gyp': 1.0.11 '@rollup/pluginutils': 4.2.1
bf535cf5d2a1ad2a17322494f9af1a92747cc12c
2025-03-01 01:04:47
Neko Aria
fix(route/zaobao): handle JSON parsing with control characters (#18480)
false
handle JSON parsing with control characters (#18480)
fix
diff --git a/lib/routes/zaobao/util.ts b/lib/routes/zaobao/util.ts index 9dfc136946984a..bbb0fb653882ce 100644 --- a/lib/routes/zaobao/util.ts +++ b/lib/routes/zaobao/util.ts @@ -90,11 +90,19 @@ const parseList = async ( if ($1('#seo-article-page').text() === '') { // HK title = $1('h1.article-title').text(); - time = new Date(JSON.parse($1("head script[type='application/ld+json']").eq(1).text())?.datePublished); + const jsonText = $1("head script[type='application/ld+json']") + .eq(1) + .text() + .replaceAll(/[\u0000-\u001F\u007F-\u009F]/g, ''); + time = new Date(JSON.parse(jsonText)?.datePublished); } else { // SG - title = JSON.parse($1('#seo-article-page').text())['@graph'][0]?.headline; - time = new Date(JSON.parse($1('#seo-article-page').text())['@graph'][0]?.datePublished); + const jsonText = $1('#seo-article-page') + .text() + .replaceAll(/[\u0000-\u001F\u007F-\u009F]/g, ''); + const json = JSON.parse(jsonText); + title = json['@graph'][0]?.headline; + time = new Date(json['@graph'][0]?.datePublished); } $1('.overlay-microtransaction').remove();
c4be9eee0f22f0307f21b6c68ad935f73802ac35
2023-10-19 08:41:08
dependabot[bot]
chore(deps-dev): bump @types/plist from 3.0.3 to 3.0.4 (#13560)
false
bump @types/plist from 3.0.3 to 3.0.4 (#13560)
chore
diff --git a/package.json b/package.json index 41fcd45c7242f3..4ca91c95108686 100644 --- a/package.json +++ b/package.json @@ -172,7 +172,7 @@ "@types/module-alias": "2.0.3", "@types/nodemon": "1.19.3", "@types/pidusage": "2.0.3", - "@types/plist": "3.0.3", + "@types/plist": "3.0.4", "@types/request-promise-native": "1.0.20", "@types/require-all": "3.0.5", "@types/showdown": "2.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1fade7fbae100f..71fa180cd4ef81 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -269,8 +269,8 @@ devDependencies: specifier: 2.0.3 version: 2.0.3 '@types/plist': - specifier: 3.0.3 - version: 3.0.3 + specifier: 3.0.4 + version: 3.0.4 '@types/request-promise-native': specifier: 1.0.20 version: 1.0.20 @@ -1688,8 +1688,8 @@ packages: resolution: {integrity: sha512-ql+nedz/Int5Dnzo3B30wQQ3N5L6iBnxFTAXqsWymqwS82VJlMNry8X2qyokchhn8ccrzJBZAIHz8Qp7iqPaRw==} dev: true - /@types/[email protected]: - resolution: {integrity: sha512-DXkBoKc7jwUR0p439icInmXXMJNhoImdpOrrgA5/nDFK7LVtcJ9MyQNKhJEKpEztnHGWnNWMWLOIR62By0Ln0A==} + /@types/[email protected]: + resolution: {integrity: sha512-pTa9xUFQFM9WJGSWHajYNljD+DbVylE1q9IweK1LBhUYJdJ28YNU8j3KZ4Q1Qw+cSl4+QLLLOVmqNjhhvVO8fA==} dependencies: '@types/node': 20.5.6 xmlbuilder: 15.1.1
cbfd29d80bb2d213ab8d44329e1e2be0f20ee49c
2024-09-15 22:47:38
DIYgod
feat: update twitter api path
false
update twitter api path
feat
diff --git a/lib/routes/twitter/api/web-api/constants.ts b/lib/routes/twitter/api/web-api/constants.ts index 6fdc7ec0a6798a..2b6e044e5756b0 100644 --- a/lib/routes/twitter/api/web-api/constants.ts +++ b/lib/routes/twitter/api/web-api/constants.ts @@ -1,48 +1,51 @@ const baseUrl = 'https://x.com/i/api'; const graphQLEndpointsPlain = [ - '/graphql/eS7LO5Jy3xgmd3dbL044EA/UserTweets', - '/graphql/k5XapwcSikNsEsILW5FvgA/UserByScreenName', - '/graphql/k3YiLNE_MAy5J-NANLERdg/HomeTimeline', + '/graphql/E3opETHurmVJflFsUBVuUQ/UserTweets', + '/graphql/Yka-W8dz7RaEuQNkroPkYw/UserByScreenName', + '/graphql/HJFjzBgCs16TqxewQOeLNg/HomeTimeline', '/graphql/DiTkXJgLqBBxCs7zaYsbtA/HomeLatestTimeline', - '/graphql/3GeIaLmNhTm1YsUmxR57tg/UserTweetsAndReplies', - '/graphql/TOU4gQw8wXIqpSzA4TYKgg/UserMedia', - '/graphql/B8I_QCljDBVfin21TTWMqA/Likes', + '/graphql/bt4TKuFz4T7Ckk-VvQVSow/UserTweetsAndReplies', + '/graphql/dexO_2tohK86JDudXXG3Yw/UserMedia', '/graphql/tD8zKvQzwY3kdx5yz6YmOw/UserByRestId', - '/graphql/flaR-PUMshxFWZWPNpq4zA/SearchTimeline', + '/graphql/UN1i3zUiCWa-6r-Uaho4fw/SearchTimeline', '/graphql/TOTgqavWmxywKv5IbMMK1w/ListLatestTweetsTimeline', - '/graphql/zJvfJs3gSbrVhC0MKjt_OQ/TweetDetail', + '/graphql/QuBlQ6SxNAQCt6-kBiCXCQ/TweetDetail', ]; const gqlMap = Object.fromEntries(graphQLEndpointsPlain.map((endpoint) => [endpoint.split('/')[3].replace(/V2$|Query$|QueryV2$/, ''), endpoint])); const gqlFeatureUser = { - hidden_profile_likes_enabled: true, hidden_profile_subscriptions_enabled: true, + rweb_tipjar_consumption_enabled: true, responsive_web_graphql_exclude_directive_enabled: true, verified_phone_label_enabled: false, subscriptions_verification_info_is_identity_verified_enabled: true, subscriptions_verification_info_verified_since_enabled: true, highlights_tweets_tab_ui_enabled: true, responsive_web_twitter_article_notes_tab_enabled: true, + subscriptions_feature_can_gift_premium: true, creator_subscriptions_tweet_preview_api_enabled: true, responsive_web_graphql_skip_user_profile_image_extensions_enabled: false, responsive_web_graphql_timeline_navigation_enabled: true, }; const gqlFeatureFeed = { + rweb_tipjar_consumption_enabled: true, responsive_web_graphql_exclude_directive_enabled: true, verified_phone_label_enabled: false, creator_subscriptions_tweet_preview_api_enabled: true, responsive_web_graphql_timeline_navigation_enabled: true, responsive_web_graphql_skip_user_profile_image_extensions_enabled: false, + communities_web_enable_tweet_community_results_fetch: true, c9s_tweet_anatomy_moderator_badge_enabled: true, - tweetypie_unmention_optimization_enabled: true, + articles_preview_enabled: true, responsive_web_edit_tweet_api_enabled: true, graphql_is_translatable_rweb_tweet_is_translatable_enabled: true, view_counts_everywhere_api_enabled: true, longform_notetweets_consumption_enabled: true, responsive_web_twitter_article_tweet_consumption_enabled: true, tweet_awards_web_tipping_enabled: false, + creator_subscriptions_quote_tweet_preview_enabled: false, freedom_of_speech_not_reach_fetch_enabled: true, standardized_nudges_misinfo: true, tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true, @@ -61,8 +64,7 @@ const TweetDetailFeatures = { responsive_web_graphql_skip_user_profile_image_extensions_enabled: false, communities_web_enable_tweet_community_results_fetch: true, c9s_tweet_anatomy_moderator_badge_enabled: true, - articles_preview_enabled: false, - tweetypie_unmention_optimization_enabled: true, + articles_preview_enabled: true, responsive_web_edit_tweet_api_enabled: true, graphql_is_translatable_rweb_tweet_is_translatable_enabled: true, view_counts_everywhere_api_enabled: true, @@ -73,7 +75,6 @@ const TweetDetailFeatures = { freedom_of_speech_not_reach_fetch_enabled: true, standardized_nudges_misinfo: true, tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true, - tweet_with_visibility_results_prefer_gql_media_interstitial_enabled: true, rweb_video_timestamps_enabled: true, longform_notetweets_rich_text_read_enabled: true, longform_notetweets_inline_media_enabled: true, diff --git a/lib/routes/twitter/api/web-api/utils.ts b/lib/routes/twitter/api/web-api/utils.ts index ba16c409789ae4..f52c3442e9f740 100644 --- a/lib/routes/twitter/api/web-api/utils.ts +++ b/lib/routes/twitter/api/web-api/utils.ts @@ -1,7 +1,6 @@ import ConfigNotFoundError from '@/errors/types/config-not-found'; import { baseUrl, gqlFeatures, bearerToken, gqlMap } from './constants'; import { config } from '@/config'; -import got from '@/utils/got'; import queryString from 'query-string'; import { Cookie, CookieJar } from 'tough-cookie'; import { CookieAgent, CookieClient } from 'http-cookie-agent/undici'; @@ -26,7 +25,7 @@ const token2Cookie = (token) => uri: proxy.proxyUri, }) : new CookieAgent({ cookies: { jar } }); - await got('https://x.com', { + await ofetch('https://x.com', { dispatcher: agent, }); return JSON.stringify(jar.serializeSync());
fceb7e570f5d65b056b58aa06f29a644240e6805
2024-06-16 12:47:43
dependabot[bot]
chore(deps): bump @hono/zod-openapi from 0.14.2 to 0.14.4 (#15905)
false
bump @hono/zod-openapi from 0.14.2 to 0.14.4 (#15905)
chore
diff --git a/package.json b/package.json index 5ec9e21f6b286d..1f554161903a85 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "dependencies": { "@hono/node-server": "1.11.3", "@hono/swagger-ui": "0.2.2", - "@hono/zod-openapi": "0.14.2", + "@hono/zod-openapi": "0.14.4", "@notionhq/client": "2.2.15", "@postlight/parser": "2.2.3", "@sentry/node": "7.116.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ab726c64b479e7..972a8d3b7da5cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: 0.2.2 version: 0.2.2([email protected]) '@hono/zod-openapi': - specifier: 0.14.2 - version: 0.14.2([email protected])([email protected]) + specifier: 0.14.4 + version: 0.14.4([email protected])([email protected]) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -1197,8 +1197,8 @@ packages: peerDependencies: hono: '*' - '@hono/[email protected]': - resolution: {integrity: sha512-nt4TCMwGebajiJ5QEZ2QOVRp3N7GMLs1P7csNQJSu6Aean4D+8TWgZTaAJSytLvVZWy90qnBbpRlVSS6C6M+0g==} + '@hono/[email protected]': + resolution: {integrity: sha512-sVpVt3Jso2imWHRAc9TD5eQHeEofl0UGuCpfBz95fkECmmAsZMAxzBzSQbEe7gQFSpIHOIg/e2rOAbB1dGOiTQ==} engines: {node: '>=16.0.0'} peerDependencies: hono: '>=4.3.6' @@ -6480,7 +6480,7 @@ snapshots: dependencies: hono: 4.4.6 - '@hono/[email protected]([email protected])([email protected])': + '@hono/[email protected]([email protected])([email protected])': dependencies: '@asteasolutions/zod-to-openapi': 7.0.0([email protected]) '@hono/zod-validator': 0.2.2([email protected])([email protected])
62b7cc9eff523e949540f556ce25450dd8a30dd4
2024-07-17 16:44:22
dependabot[bot]
chore(deps): bump @scalar/hono-api-reference from 0.5.107 to 0.5.109 (#16188)
false
bump @scalar/hono-api-reference from 0.5.107 to 0.5.109 (#16188)
chore
diff --git a/package.json b/package.json index 47eed0989116b5..5c4554fd9bb811 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@opentelemetry/sdk-trace-base": "1.25.1", "@opentelemetry/semantic-conventions": "1.25.1", "@postlight/parser": "2.2.3", - "@scalar/hono-api-reference": "0.5.107", + "@scalar/hono-api-reference": "0.5.109", "@sentry/node": "7.116.0", "@tonyrl/rand-user-agent": "2.0.72", "aes-js": "3.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af116128089b3a..aaa6d52e9265b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,8 +42,8 @@ importers: specifier: 2.2.3 version: 2.2.3 '@scalar/hono-api-reference': - specifier: 0.5.107 - version: 0.5.107([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) + specifier: 0.5.109 + version: 0.5.109([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@sentry/node': specifier: 7.116.0 version: 7.116.0 @@ -1738,32 +1738,32 @@ packages: cpu: [x64] os: [win32] - '@scalar/[email protected]': - resolution: {integrity: sha512-NpXc+ZSeeyNY68lV9aXTd7aU/b2rkODPqKOztZh8BuC1PB6irq7eey1et30l4So3NU/m+S9NDlSChrNcbcofhg==} + '@scalar/[email protected]': + resolution: {integrity: sha512-U8IO/rEVnTLg645VsyuV0tfaew7axNt+SiE9kvvpF84JGjFz0X1594XMlgC88It+g37CSE2ptIQ+WHCgMPlVfA==} engines: {node: '>=18'} - '@scalar/[email protected]': - resolution: {integrity: sha512-5bjxI+YujF6URreaa0xZt4giAWhwvIuco3cMU7UBfQKYkFmfvPWM1sVcBWI/IUZAe/E4V/u/r2MhAMPOcaEvSA==} + '@scalar/[email protected]': + resolution: {integrity: sha512-Svh9bnAJHXuKzojw5Gzw6RfPRElki97MrYs70Slw8wesuRfjzA8uiqp+4tuc6s5wZVev0UoXvl/6TWN8CvbSpg==} engines: {node: '>=18'} '@scalar/[email protected]': resolution: {integrity: sha512-YUSlnNapSUuLKDFiiQ54ok+gHD9ufCifI2CAU5HtIvt8pS/Ns4r0D/N+RuEWu5HccbBt/S4cLYkwlg4q76ym/A==} engines: {node: '>=18'} - '@scalar/[email protected]': - resolution: {integrity: sha512-j7Et2yNJ8Zl6XMACuq3o82yJNj08tYfx7EOKzBRTbw8NP6bSWcZYuKgTVra8kXWA1+KXmTwHfLq7vw6jL+aTfQ==} + '@scalar/[email protected]': + resolution: {integrity: sha512-QMuNXb/Pt/py25DgY8ZMKJJw5qt3t+aK+j2crOyjJXdZEh1d7y/y525kfIIgelmkf+YT+nEc7WnVcGP5F1f8bg==} engines: {node: '>=18'} '@scalar/[email protected]': resolution: {integrity: sha512-A6lUgTV8q/zJGkzHerY1T+X3l3GXmCCg09Z7OU7j6yDyyuj2BSTblthncoD5sN3BdwLjHwkm9ecehfvaE0pj5w==} engines: {node: '>=18'} - '@scalar/[email protected]': - resolution: {integrity: sha512-4+cQhXNom36xiCyhdI/EiyiiIrBNyDK6VoCAngxd+4RITr9YjPe6Taa/s2DQyZk+QXB3HeQPa+EVa2M6LUohFw==} + '@scalar/[email protected]': + resolution: {integrity: sha512-uDfz4WlDpMQTXHMNam4EDlttssYR9h3Na2CSyH/FDcoCon/93f0epXjtylzqM4DmCnFfuofoIUkytck9cygoOw==} engines: {node: '>=18'} - '@scalar/[email protected]': - resolution: {integrity: sha512-wYlOuSE49pD3TQ4wmw1sHdMJMFajuu3x1DYsWzpJtKnJX8ij3UtKi8EaPgjxvH9GZ8sNzIlI9ZddPU1llYjQhg==} + '@scalar/[email protected]': + resolution: {integrity: sha512-SZm+xjLws1QZs+nnENhVLPNZB7GRhfVS7bodMhroHJwtwbsQbvkFEi2tTagsKwtGaE25Sgi+aSZ7g2lTXwUxag==} engines: {node: '>=18'} '@scalar/[email protected]': @@ -1795,8 +1795,8 @@ packages: '@scalar/[email protected]': resolution: {integrity: sha512-z3DEpT/FIZq9yeHL/tz2v6WvdHIiZ4uvK96RdeTPKUUJ0IXvA5vONG3PF5LE0Q/408PCzWsZpGs9f97ztaeJSQ==} - '@scalar/[email protected]': - resolution: {integrity: sha512-ok1hC5ez9cYnVr2F8WF0FyE5P0GWiim12H3aOoPvq1VFI+ASoFjJNgo7rT4nhVbO3htcBh1Le9KfIFTyO7bhYA==} + '@scalar/[email protected]': + resolution: {integrity: sha512-+l0Dyon6pj7ie52Z8n1s6Z4/vEWNb5yMIfLMuC3B0kxNl+WqQ9ZOOtU8xcs6Kc0GgZ3lie2LroKmPyPU/tX1RQ==} engines: {node: '>=18'} '@scalar/[email protected]': @@ -8701,16 +8701,16 @@ snapshots: '@rollup/[email protected]': optional: true - '@scalar/[email protected]([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': + '@scalar/[email protected]([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([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])) - '@scalar/components': 0.12.14([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) + '@scalar/components': 0.12.15([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) '@scalar/draggable': 0.1.3([email protected]) - '@scalar/oas-utils': 0.2.13([email protected]) + '@scalar/oas-utils': 0.2.14([email protected]) '@scalar/object-utils': 1.1.4([email protected]([email protected])) '@scalar/openapi-parser': 0.7.2 - '@scalar/themes': 0.9.13([email protected]) + '@scalar/themes': 0.9.14([email protected]) '@scalar/use-codemirror': 0.11.6([email protected]) '@scalar/use-toasts': 0.7.4([email protected]) '@scalar/use-tooltip': 1.0.2([email protected]) @@ -8738,16 +8738,16 @@ snapshots: - typescript - vitest - '@scalar/[email protected]([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': + '@scalar/[email protected]([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: '@floating-ui/vue': 1.1.1([email protected]([email protected])) '@headlessui/vue': 1.7.22([email protected]([email protected])) - '@scalar/api-client': 2.0.22([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) - '@scalar/components': 0.12.14([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) - '@scalar/oas-utils': 0.2.13([email protected]) + '@scalar/api-client': 2.0.24([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) + '@scalar/components': 0.12.15([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) + '@scalar/oas-utils': 0.2.14([email protected]) '@scalar/openapi-parser': 0.7.2 '@scalar/snippetz': 0.1.6 - '@scalar/themes': 0.9.13([email protected]) + '@scalar/themes': 0.9.14([email protected]) '@scalar/use-toasts': 0.7.4([email protected]) '@scalar/use-tooltip': 1.0.2([email protected]) '@unhead/schema': 1.9.16 @@ -8797,7 +8797,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@scalar/[email protected]([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': + '@scalar/[email protected]([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': dependencies: '@floating-ui/utils': 0.2.4 '@floating-ui/vue': 1.1.1([email protected]([email protected])) @@ -8827,9 +8827,9 @@ snapshots: transitivePeerDependencies: - typescript - '@scalar/[email protected]([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))': + '@scalar/[email protected]([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([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.46([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) + '@scalar/api-reference': 1.24.48([email protected])([email protected](@babel/[email protected](@babel/[email protected]))([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected]))) hono: 4.5.0 transitivePeerDependencies: - '@jest/globals' @@ -8845,9 +8845,9 @@ snapshots: - typescript - vitest - '@scalar/[email protected]([email protected])': + '@scalar/[email protected]([email protected])': dependencies: - '@scalar/themes': 0.9.13([email protected]) + '@scalar/themes': 0.9.14([email protected]) axios: 1.7.2 nanoid: 5.0.7 yaml: 2.4.5 @@ -8906,7 +8906,7 @@ snapshots: '@scalar/snippetz-plugin-node-ofetch': 0.1.1 '@scalar/snippetz-plugin-node-undici': 0.1.6 - '@scalar/[email protected]([email protected])': + '@scalar/[email protected]([email protected])': dependencies: vue: 3.4.32([email protected]) transitivePeerDependencies:
c388cfac5e0846720a7054d1d65b61352f5d3304
2022-07-01 22:41:15
Tony
docs: TokenInsight official RSS
false
TokenInsight official RSS
docs
diff --git a/docs/en/finance.md b/docs/en/finance.md index 9e1694ff95982c..076cf9154628de 100644 --- a/docs/en/finance.md +++ b/docs/en/finance.md @@ -29,7 +29,11 @@ pageClass: routes </RouteEn> ## TokenInsight +::: tip Tips +TokenInsight also provides official RSS, you can take a look at <https://api.tokeninsight.com/reference/rss>. + +::: ### Blogs <RouteEn author="fuergaosi233" example="/tokeninsight/blog/en" path="/tokeninsight/blog/:lang?" :paramsDesc="['Language, see below, Chinese by default']" /> diff --git a/docs/finance.md b/docs/finance.md index b62f8a4a0fd670..fdc21db294afe7 100644 --- a/docs/finance.md +++ b/docs/finance.md @@ -58,6 +58,12 @@ pageClass: routes ## TokenInsight +::: tip 提示 + +TokenInsight 官方亦有提供 RSS,可参考 <https://api.tokeninsight.com/reference/rss>。 + +::: + ### 博客 <Route author="fuergaosi233" example="/tokeninsight/blog" path="/tokeninsight/blog/:lang?" :paramsDesc="['语言,见下表,默认为简体中文']" />
47715045ba3589950254a3d7ca0da0c562abd521
2022-04-15 05:43:23
Henry
docs: Translate documentation of shopping craigslist from Chinese to English. (#9536)
false
Translate documentation of shopping craigslist from Chinese to English. (#9536)
docs
diff --git a/docs/en/shopping.md b/docs/en/shopping.md index 5c4188c24f9d77..653d1f457363ab 100644 --- a/docs/en/shopping.md +++ b/docs/en/shopping.md @@ -42,6 +42,20 @@ Parameter `time` only works when `mostwanted` is chosen as the category. <RouteEn author="KTachibanaM" example="/booth.pm/shop/annn-boc0123" path="/booth.pm/shop/:subdomain" :paramsDesc="['Shop subdomain']" /> +## Craigslist + +### Shop + +<RouteEn 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`']"/> + +> 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> +> +> 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 + + ## Guiltfree.pl ### Onsale
1311378d4a6a4a2567bc1ff0865bd456eda86742
2025-03-21 03:34:20
dependabot[bot]
chore(deps): bump twitter-api-v2 from 1.20.2 to 1.21.0 (#18657)
false
bump twitter-api-v2 from 1.20.2 to 1.21.0 (#18657)
chore
diff --git a/package.json b/package.json index a4e84da1de6871..c8763157915285 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "tosource": "2.0.0-alpha.3", "tough-cookie": "5.1.2", "tsx": "4.19.3", - "twitter-api-v2": "1.20.2", + "twitter-api-v2": "1.21.0", "ufo": "1.5.4", "undici": "6.21.2", "uuid": "11.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b77e5754b3f5e5..415fd2c423b75b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -257,8 +257,8 @@ importers: specifier: 4.19.3 version: 4.19.3 twitter-api-v2: - specifier: 1.20.2 - version: 1.20.2 + specifier: 1.21.0 + version: 1.21.0 ufo: specifier: 1.5.4 version: 1.5.4 @@ -5685,8 +5685,8 @@ packages: [email protected]: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} - [email protected]: - resolution: {integrity: sha512-0Q+yJetijJon8rctNuy7kDfHK4/8rZw6ZRO0Ix7K7+tuk2eZN5j0loeBpEsijxO+dEW+YxGhq1V7FhjUJwAQJw==} + [email protected]: + resolution: {integrity: sha512-KbSdpZ7REO42TdOaDxgKnfMxESV4lmJITqXij4ykf71u8vrFj3RzrMWcSXERIA3wrdk3705YzafFbG6Dy8y2UQ==} [email protected]: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} @@ -11961,7 +11961,7 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} [email protected]: dependencies:
48ef6e9e83611ba8af9d1f1cd8015f77f3b988d4
2020-10-18 20:54:58
KT
feat: add radar rule for eventernote (#5899)
false
add radar rule for eventernote (#5899)
feat
diff --git a/assets/radar-rules.js b/assets/radar-rules.js index c68c17b8363064..95ee4c7feb36dd 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2366,4 +2366,15 @@ }, ], }, + 'eventernote.com': { + _name: 'Eventernote', + www: [ + { + title: '声优活动及演唱会', + docs: 'https://docs.rsshub.app/anime.html#eventernote', + source: '/actors/:name/:id/events', + target: '/eventernote/actors/:name/:id', + }, + ], + }, }); diff --git a/docs/anime.md b/docs/anime.md index b6d6f4ec4053d7..cc18fb87fdaa19 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -140,7 +140,7 @@ pageClass: routes ### 声优活动及演唱会 -<Route author="KTachibanaM" path="/eventernote/actors/:name/:id" example="/eventernote/actors/三森すずこ/2634" :paramsDesc="['声优姓名', '声优 ID']"/> +<Route author="KTachibanaM" path="/eventernote/actors/:name/:id" example="/eventernote/actors/三森すずこ/2634" :paramsDesc="['声优姓名', '声优 ID']" radar="1" rssbud="1"/> ## Hanime.tv
f27821d424942eadfaa5790179999699e672aee6
2022-09-14 00:20:09
FeCCC
feat(route): add ZodGame (#10778)
false
add ZodGame (#10778)
feat
diff --git a/docs/bbs.md b/docs/bbs.md index 551c512abdaab1..0e98eb3afc54d0 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -388,6 +388,12 @@ pageClass: routes </Route> +## ZodGame + +### 论坛版块 + +<Route author="FeCCC" example="/zodgame/forum/13" path="/zodgame/forum/:fid?" :paramsDesc="['版块 id,在 URL 可以找到']" radar="1" rssbud="1" selfhost="1"/> + ## Zuvio ### 校園話題 diff --git a/docs/en/bbs.md b/docs/en/bbs.md index eb86832bb29d12..f2deab5d1d3ac7 100644 --- a/docs/en/bbs.md +++ b/docs/en/bbs.md @@ -73,3 +73,9 @@ If the url of the thread is <https://www.scboy.com/?thread-188673.htm> then tid When accessing Joeyray's Bar, `SCBOY_BBS_TOKEN` needs to be filled in `environment`. See <https://docs.rsshub.app/en/install/#Deployment> for details. `SCBOY_BBS_TOKEN` is included in cookies with `bbs_token`. </RouteEn> + +## ZodGame + +### forum + +<RouteEn author="FeCCC" example="/zodgame/forum/13" path="/zodgame/forum/:fid?" :paramsDesc="['forum id,can be found in URL']" radar="1" rssbud="1" selfhost="1"/> diff --git a/docs/en/install/README.md b/docs/en/install/README.md index 9d81903989bde3..f13001a6134f00 100644 --- a/docs/en/install/README.md +++ b/docs/en/install/README.md @@ -715,3 +715,7 @@ See docs of the specified route and `lib/config.js` for detailed information. - `YOUTUBE_CLIENT_ID`: YouTube API OAuth 2.0 client ID - `YOUTUBE_CLIENT_SECRET`: YouTube API OAuth 2.0 client secret - `YOUTUBE_REFRESH_TOKEN`: YouTube API OAuth 2.0 refresh token. Check [this gist](https://gist.github.com/Kurukshetran/5904e8cb2361623498481f4a9a1338aa) for detailed instructions. + +- ZodGame: + + - `ZODGAME_COOKIE`: Cookie of ZodGame User diff --git a/docs/install/README.md b/docs/install/README.md index 0fee633f952d97..30debc28a90a86 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -762,6 +762,10 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 - `YOUTUBE_CLIENT_SECRET`: YouTube API 的 OAuth 2.0 客户端 Secret - `YOUTUBE_REFRESH_TOKEN`: YouTube API 的 OAuth 2.0 客户端 Refresh Token。可以按照[此 gist](https://gist.github.com/Kurukshetran/5904e8cb2361623498481f4a9a1338aa) 获取。 +- ZodGame: + + - `ZODGAME_COOKIE`: ZodGame 登录后的 Cookie 值 + - 北大未名 BBS 全站十大 - `PKUBBS_COOKIE`: BBS 注册用户登录后的 Cookie 值,获取方式: diff --git a/lib/config.js b/lib/config.js index e9c1edf2caf0a4..17a79806963e0b 100644 --- a/lib/config.js +++ b/lib/config.js @@ -278,6 +278,9 @@ const calculateValue = () => { zhihu: { cookies: envs.ZHIHU_COOKIES, }, + zodgame: { + cookie: envs.ZODGAME_COOKIE, + }, }; }; calculateValue(); diff --git a/lib/v2/zodgame/forum.js b/lib/v2/zodgame/forum.js new file mode 100644 index 00000000000000..462021188b71e3 --- /dev/null +++ b/lib/v2/zodgame/forum.js @@ -0,0 +1,54 @@ +const got = require('@/utils/got'); +const config = require('@/config').value; +const cheerio = require('cheerio'); +const { art } = require('@/utils/render'); +const path = require('path'); + +const rootUrl = 'https://zodgame.xyz'; + +module.exports = async (ctx) => { + const fid = ctx.params.fid; + const subUrl = `${rootUrl}/forum.php?mod=forumdisplay&fid=${fid}`; + const cookie = config.zodgame.cookie; + + if (cookie === undefined) { + throw Error('Zodgame RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>'); + } + + const response = await got({ + method: 'get', + url: subUrl, + headers: { + Cookie: cookie, + }, + }); + const $ = cheerio.load(response.data); + const pageTitle = $('title').text(); + const list = $('#threadlisttableid tbody'); + + const items = list + .map((_, item) => { + const title = $(item).find('tr th a.s.xst').text(); + const author = $(item).find('tr td.by cite a').text(); + const type = $(item).find('tr th em a').text(); + const link = $(item).find('tr th a.s.xst').attr('href'); + return { + title, + author, + link, + category: type, + description: art(path.join(__dirname, 'templates/forum.art'), { + type, + title, + author, + }), + }; + }) + .get(); + + ctx.state.data = { + title: pageTitle, + link: rootUrl, + item: items, + }; +}; diff --git a/lib/v2/zodgame/maintainer.js b/lib/v2/zodgame/maintainer.js new file mode 100644 index 00000000000000..22f823ccc60504 --- /dev/null +++ b/lib/v2/zodgame/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/forum/:fid?': ['FeCCC'], +}; diff --git a/lib/v2/zodgame/radar.js b/lib/v2/zodgame/radar.js new file mode 100644 index 00000000000000..33927243a94564 --- /dev/null +++ b/lib/v2/zodgame/radar.js @@ -0,0 +1,18 @@ +module.exports = { + 'zodgame.xyz': { + _name: 'zodgame', + '.': [ + { + title: '论坛版块', + docs: 'https://docs.rsshub.app/bbs.html#zodgame', + source: '/forum.php', + target: (params, url) => { + const fid = new URL(url).searchParams.get('fid'); + if (fid) { + return `/zodgame/forum/${fid}`; + } + }, + }, + ], + }, +}; diff --git a/lib/v2/zodgame/router.js b/lib/v2/zodgame/router.js new file mode 100644 index 00000000000000..e7a1078d29797c --- /dev/null +++ b/lib/v2/zodgame/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/forum/:fid?', require('./forum')); +}; diff --git a/lib/v2/zodgame/templates/forum.art b/lib/v2/zodgame/templates/forum.art new file mode 100644 index 00000000000000..9258412a55d0db --- /dev/null +++ b/lib/v2/zodgame/templates/forum.art @@ -0,0 +1 @@ +<span>{{ if type !== "" }}[{{ type }}]{{ /if }}{{ title }} - {{ author }}</span> \ No newline at end of file
11eb414a392accf97b0b55d15fd1d233ff3b357b
2024-03-28 06:16:53
dependabot[bot]
chore(deps): bump directory-import from 3.2.1 to 3.3.1 (#14992)
false
bump directory-import from 3.2.1 to 3.3.1 (#14992)
chore
diff --git a/package.json b/package.json index ebb7de08632f15..a4c17aa98309c3 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "crypto-js": "4.2.0", "currency-symbol-map": "5.1.0", "dayjs": "1.11.8", - "directory-import": "3.2.1", + "directory-import": "3.3.1", "dotenv": "16.4.5", "entities": "4.5.0", "etag": "1.8.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3ddd1734df6aca..0d22bb328c9b05 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ dependencies: specifier: 1.11.8 version: 1.11.8 directory-import: - specifier: 3.2.1 - version: 3.2.1 + specifier: 3.3.1 + version: 3.3.1 dotenv: specifier: 16.4.5 version: 16.4.5 @@ -378,6 +378,14 @@ packages: engines: {node: '>=0.10.0'} dev: true + /@ampproject/[email protected]: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.22 + dev: true + /@ampproject/[email protected]: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -543,8 +551,8 @@ packages: '@babel/types': 7.24.0 dev: true - /@babel/[email protected]: - resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} + /@babel/[email protected]: + resolution: {integrity: sha512-HfEWzysMyOa7xI5uQHc/OcZf67/jc+xe/RZlznWQHhbb8Pg1SkRdbK4yEi61aY8wxQA7PkSfoojtLQP/Kpe3og==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 @@ -558,7 +566,7 @@ packages: dependencies: '@babel/core': 7.24.3 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.3 + '@babel/helper-module-imports': 7.24.1 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 @@ -621,8 +629,8 @@ packages: '@babel/types': 7.24.0 dev: true - /@babel/[email protected]: - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} + /@babel/[email protected]: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} engines: {node: '>=6.9.0'} dev: true @@ -664,6 +672,14 @@ packages: js-tokens: 4.0.0 picocolors: 1.0.0 + /@babel/[email protected]: + resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.24.0 + dev: true + /@babel/[email protected]: resolution: {integrity: sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==} engines: {node: '>=6.0.0'} @@ -933,7 +949,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.3 - '@babel/helper-module-imports': 7.24.3 + '@babel/helper-module-imports': 7.24.1 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/[email protected]) dev: true @@ -1567,16 +1583,16 @@ packages: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} dev: true - /@babel/[email protected]: - resolution: {integrity: sha512-De0q0utpUPiXnc7+B7Ku86mJ0eDItC/v3uFa/lQkq63XnHyZiytDHeCIvechlnVwwpU2ChjGF7c3I+mBrTudwg==} + /@babel/[email protected]: + resolution: {integrity: sha512-lwwDy5QfMkO2rmSz9AvLj6j2kWt5a4ulMi1t21vWQEO0kNCFslHoszat8reU/uigIQSUDF31zraZG/qMkcqAlw==} engines: {node: '>=6.9.0'} dependencies: core-js: 2.6.12 regenerator-runtime: 0.14.1 dev: false - /@babel/[email protected]: - resolution: {integrity: sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==} + /@babel/[email protected]: + resolution: {integrity: sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 @@ -1609,11 +1625,20 @@ packages: - supports-color dev: true + /@babel/[email protected]: + resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@babel/[email protected]: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.24.1 + '@babel/helper-string-parser': 7.23.4 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 dev: true @@ -1645,16 +1670,6 @@ packages: cpu: [ppc64] os: [aix] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1663,16 +1678,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1681,16 +1686,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1699,16 +1694,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1717,16 +1702,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1735,16 +1710,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1753,16 +1718,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1771,16 +1726,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1789,16 +1734,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1807,16 +1742,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1825,16 +1750,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1843,16 +1758,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1861,16 +1766,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1879,16 +1774,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1897,16 +1782,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1915,16 +1790,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1933,16 +1798,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1951,16 +1806,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1969,16 +1814,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -1987,16 +1822,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -2005,16 +1830,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -2023,16 +1838,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true optional: true /@esbuild/[email protected]: @@ -2041,16 +1846,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false - optional: true - - /@esbuild/[email protected]: - resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true optional: true /@eslint-community/[email protected]([email protected]): @@ -2182,6 +1977,15 @@ packages: '@sinclair/typebox': 0.27.8 dev: true + /@jridgewell/[email protected]: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.22 + dev: true + /@jridgewell/[email protected]: resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -2196,6 +2000,11 @@ packages: engines: {node: '>=6.0.0'} dev: true + /@jridgewell/[email protected]: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + /@jridgewell/[email protected]: resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} @@ -2205,6 +2014,13 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true + /@jridgewell/[email protected]: + resolution: {integrity: sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==} + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /@jridgewell/[email protected]: resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} dependencies: @@ -2212,15 +2028,15 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@lifeomic/[email protected]: - resolution: {integrity: sha512-QZqem4QuAnAyzfz+Gj5/+SLxqwCAw2qmt7732ZXodr6VDWGeYLG6w1i/vYLa55JQM9wRuBKLmXmiZ2P0LtE5rw==} + /@lifeomic/[email protected]: + resolution: {integrity: sha512-GlM2AbzrErd/TmLL3E8hAHmb5Q7VhDJp35vIbyPVA5Rz55LZuRr8pwL3qrwwkVNo05gMX1J44gURKb4MHQZo7w==} dev: false /@mapbox/[email protected]: resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true dependencies: - detect-libc: 2.0.3 + detect-libc: 2.0.2 https-proxy-agent: 5.0.1 make-dir: 3.1.0 node-fetch: 2.7.0 @@ -2228,7 +2044,7 @@ packages: npmlog: 5.0.1 rimraf: 3.0.2 semver: 7.6.0 - tar: 6.2.1 + tar: 6.2.0 transitivePeerDependencies: - encoding - supports-color @@ -2247,7 +2063,7 @@ packages: dev: true /@nodelib/[email protected]: - resolution: {integrity: sha1-dhnC6yGyVIP20WdUi0z9WnSIw9U=, tarball: https://registry.npmmirror.com/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz} + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -2341,7 +2157,7 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - '@babel/runtime-corejs2': 7.24.1 + '@babel/runtime-corejs2': 7.23.9 '@postlight/ci-failed-test-reporter': 1.0.26 cheerio: 0.22.0 difflib: github.com/postlight/difflib.js/32e8e38c7fcd935241b9baab71bb432fd9b166ed @@ -2351,7 +2167,7 @@ packages: moment-parseformat: 3.0.0 postman-request: 2.88.1-postman.33 string-direction: 0.1.2 - turndown: 7.1.3 + turndown: 7.1.2 valid-url: 1.0.9 wuzzy: 0.1.8 yargs-parser: 15.0.3 @@ -2413,109 +2229,104 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/[email protected]: - resolution: {integrity: sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==} + /@rollup/[email protected]: + resolution: {integrity: sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==} + /@rollup/[email protected]: + resolution: {integrity: sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==} + /@rollup/[email protected]: + resolution: {integrity: sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==} + /@rollup/[email protected]: + resolution: {integrity: sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==} + /@rollup/[email protected]: + resolution: {integrity: sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==} + /@rollup/[email protected]: + resolution: {integrity: sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==} cpu: [arm64] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==} + /@rollup/[email protected]: + resolution: {integrity: sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==} cpu: [arm64] os: [linux] - libc: [musl] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==} + /@rollup/[email protected]: + resolution: {integrity: sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==} cpu: [riscv64] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==} + /@rollup/[email protected]: + resolution: {integrity: sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==} cpu: [x64] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==} + /@rollup/[email protected]: + resolution: {integrity: sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==} cpu: [x64] os: [linux] - libc: [musl] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==} + /@rollup/[email protected]: + resolution: {integrity: sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==} + /@rollup/[email protected]: + resolution: {integrity: sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==} + /@rollup/[email protected]: + resolution: {integrity: sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==} cpu: [x64] os: [win32] requiresBuild: true @@ -2860,8 +2671,8 @@ packages: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true - /@types/[email protected]: - resolution: {integrity: sha512-yzBOv+6meEHSzV2NThYYOA6RtqvPr3Hbob9ZLp3i07SH27CrYVfm8CrF7ydTmidtelsFiKx2I4gZAiAOamGgvQ==} + /@types/[email protected]: + resolution: {integrity: sha512-R/CfN6w2XsixLb1Ii8INfn+BT9sGPvw74OavfkW4SwY+jeUcAwLZv2+bXLJkndnimxjEBm0RPHgcjW9pLCa8cw==} dependencies: '@types/cookiejar': 2.1.5 '@types/methods': 1.1.4 @@ -2872,7 +2683,7 @@ packages: resolution: {integrity: sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==} dependencies: '@types/methods': 1.1.4 - '@types/superagent': 8.1.6 + '@types/superagent': 8.1.3 dev: true /@types/[email protected]: @@ -2921,7 +2732,7 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) + ts-api-utils: 1.2.1([email protected]) typescript: 5.4.3 transitivePeerDependencies: - supports-color @@ -2978,7 +2789,7 @@ packages: '@typescript-eslint/utils': 7.4.0([email protected])([email protected]) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.3.0([email protected]) + ts-api-utils: 1.2.1([email protected]) typescript: 5.4.3 transitivePeerDependencies: - supports-color @@ -3010,7 +2821,7 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) + ts-api-utils: 1.2.1([email protected]) typescript: 5.4.3 transitivePeerDependencies: - supports-color @@ -3032,7 +2843,7 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) + ts-api-utils: 1.2.1([email protected]) typescript: 5.4.3 transitivePeerDependencies: - supports-color @@ -3104,7 +2915,7 @@ packages: '@mapbox/node-pre-gyp': 1.0.11 '@rollup/pluginutils': 4.2.1 acorn: 8.11.3 - acorn-import-attributes: 1.9.4([email protected]) + acorn-import-attributes: 1.9.2([email protected]) async-sema: 3.1.1 bindings: 1.5.0 estree-walker: 2.0.2 @@ -3123,13 +2934,13 @@ packages: peerDependencies: vitest: 1.4.0 dependencies: - '@ampproject/remapping': 2.3.0 + '@ampproject/remapping': 2.2.1 '@bcoe/v8-coverage': 0.2.3 debug: 4.3.4 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.4 - istanbul-reports: 3.1.7 + istanbul-reports: 3.1.6 magic-string: 0.30.8 magicast: 0.3.3 picocolors: 1.0.0 @@ -3197,8 +3008,8 @@ packages: event-target-shim: 5.0.1 dev: false - /[email protected]([email protected]): - resolution: {integrity: sha512-dNIX/5UEnZvVL94dV2scl4VIooK36D8AteP4xiz7cPKhDbhLhSuWkzG580g+Q7TXJklp+Z21SiaK7/HpLO84Qg==} + /[email protected]([email protected]): + resolution: {integrity: sha512-O+nfJwNolEA771IYJaiLWK1UAwjNsQmZbTRqqwBYxCgVQTmpFEMvBw6LOIQV0Me339L5UMVYFyRohGnGlQDdIQ==} peerDependencies: acorn: ^8 dependencies: @@ -3266,9 +3077,11 @@ packages: type-fest: 0.21.3 dev: true - /[email protected]: - resolution: {integrity: sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==} + /[email protected]: + resolution: {integrity: sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==} engines: {node: '>=14.16'} + dependencies: + type-fest: 3.13.1 dev: true /[email protected]: @@ -3467,8 +3280,8 @@ packages: /[email protected]: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - /[email protected]: - resolution: {integrity: sha512-h7z00dWdG0PYOQEvChhOSWvOfkIKsdZGkWr083FgN/HyoQuebSew/cgirYqh9SCuy/hRvxc5Vy6Fw8xAmYHLkQ==} + /[email protected]: + resolution: {integrity: sha512-Yyyqff4PIFfSuthCZqLlPISTWHmnQxoPuAvkmgzsJEmG3CesdIv6Xweayl0JkCZJSB2yYIdJyEz97tpxNhgjbg==} requiresBuild: true dev: false optional: true @@ -3477,15 +3290,15 @@ packages: resolution: {integrity: sha512-X9IqgvyB0/VA5OZJyb5ZstoN62AzD7YxVGog13kkfYWYqJYcK0kcqLZ6TrmH5qr4/8//ejVcX4x/a0UvaogXmA==} requiresBuild: true dependencies: - bare-events: 2.2.2 - bare-os: 2.2.1 + bare-events: 2.2.0 + bare-os: 2.2.0 bare-path: 2.1.0 - streamx: 2.16.1 + streamx: 2.15.8 dev: false optional: true - /[email protected]: - resolution: {integrity: sha512-OwPyHgBBMkhC29Hl3O4/YfxW9n7mdTr2+SsO29XBWKKJsbgj3mnorDB80r5TiCQgQstgE5ga1qNYrpes6NvX2w==} + /[email protected]: + resolution: {integrity: sha512-hD0rOPfYWOMpVirTACt4/nK8mC55La12K5fY1ij8HAdfQakD62M+H4o4tpfKzVGLgRDTuk3vjA4GqGXXCeFbag==} requiresBuild: true dev: false optional: true @@ -3494,15 +3307,15 @@ packages: resolution: {integrity: sha512-DIIg7ts8bdRKwJRJrUMy/PICEaQZaPGZ26lsSx9MJSwIhSrcdHn7/C8W+XmnG/rKi6BaRcz+JO00CjZteybDtw==} requiresBuild: true dependencies: - bare-os: 2.2.1 + bare-os: 2.2.0 dev: false optional: true /[email protected]: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - /[email protected]: - resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} + /[email protected]: + resolution: {integrity: sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==} engines: {node: '>=10.0.0'} dev: false @@ -3581,8 +3394,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001600 - electron-to-chromium: 1.4.717 + caniuse-lite: 1.0.30001587 + electron-to-chromium: 1.4.669 node-releases: 2.0.14 update-browserslist-db: 1.0.13([email protected]) dev: true @@ -3592,7 +3405,7 @@ packages: dev: false /[email protected]: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=, tarball: https://registry.npmmirror.com/buffer-equal-constant-time/download/buffer-equal-constant-time-1.0.1.tgz} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /[email protected]: @@ -3646,7 +3459,7 @@ packages: http-cache-semantics: 4.1.1 keyv: 4.5.4 mimic-response: 4.0.0 - normalize-url: 8.0.1 + normalize-url: 8.0.0 responselike: 3.0.0 dev: false @@ -3658,7 +3471,7 @@ packages: es-errors: 1.3.0 function-bind: 1.1.2 get-intrinsic: 1.2.4 - set-function-length: 1.2.2 + set-function-length: 1.2.1 /[email protected]: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -3691,8 +3504,8 @@ packages: engines: {node: '>=10'} dev: false - /[email protected]: - resolution: {integrity: sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==} + /[email protected]: + resolution: {integrity: sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==} dev: true /[email protected]: @@ -4015,7 +3828,7 @@ packages: dev: true /[email protected]: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=, tarball: https://registry.npmmirror.com/concat-map/download/concat-map-0.0.1.tgz} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} /[email protected]: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} @@ -4036,6 +3849,12 @@ packages: resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} dev: true + /[email protected]: + resolution: {integrity: sha512-iV9Pd/PsgjNWBXeq8XRtWVSgz2tKAfhfvBs7qxYty+RlRd+OCksaWmOnc4JKrTc1cToXL1N0s3l/vwlxPtdElw==} + dependencies: + browserslist: 4.23.0 + dev: true + /[email protected]: resolution: {integrity: sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==} dependencies: @@ -4134,12 +3953,11 @@ packages: resolution: {integrity: sha512-LO/lzYRw134LMDVnLyAf1dHE5tyO6axEFkR3TXjQIOmMkAM9YL6QsiUwuXzZAmFnuDJcs4hayOgyIYtViXFrLw==} dev: false - /[email protected]: - resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} - engines: {node: '>=0.12'} + /[email protected]: + resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} dependencies: es5-ext: 0.10.64 - type: 2.7.2 + type: 1.2.0 dev: false /[email protected]: @@ -4287,8 +4105,8 @@ packages: engines: {node: '>=6'} dev: true - /[email protected]: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + /[email protected]: + resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} engines: {node: '>=8'} dev: true @@ -4321,8 +4139,8 @@ packages: path-type: 4.0.0 dev: true - /[email protected]: - resolution: {integrity: sha512-hIMc9WJHs4HRZbBiNAvKGxkhjaJ2wOaFcFA0K+yj16GyBJDg28e6QgQ3hFuFB0ZRETNYZu3u85rmxIxoxWEwbA==} + /[email protected]: + resolution: {integrity: sha512-d9paCbverdqmuwR+B40phSqiHhgPKiP8dpsMz5WT9U6ug2VVQ3tqXNCedpa6iGHg6mgv9lHaoq5DJUu2IXMjsQ==} engines: {node: '>=18.17.0'} dev: false @@ -4452,8 +4270,8 @@ packages: semver: 7.6.0 dev: true - /[email protected]: - resolution: {integrity: sha512-6Fmg8QkkumNOwuZ/5mIbMU9WI3H2fmn5ajcVya64I5Yr5CcNmO7vcLt0Y7c96DCiMO5/9G+4sI2r6eEvdg1F7A==} + /[email protected]: + resolution: {integrity: sha512-E2SmpffFPrZhBSgf8ibqanRS2mpuk3FIRDzLDwt7WFpfgJMKDHJs0hmacyP0PS1cWsq0dVkwIIzlscNaterkPg==} dev: true /[email protected]: @@ -4524,7 +4342,7 @@ packages: requiresBuild: true dependencies: es6-iterator: 2.0.3 - es6-symbol: 3.1.4 + es6-symbol: 3.1.3 esniff: 2.0.1 next-tick: 1.1.0 dev: false @@ -4532,16 +4350,15 @@ packages: /[email protected]: resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} dependencies: - d: 1.0.2 + d: 1.0.1 es5-ext: 0.10.64 - es6-symbol: 3.1.4 + es6-symbol: 3.1.3 dev: false - /[email protected]: - resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} - engines: {node: '>=0.12'} + /[email protected]: + resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} dependencies: - d: 1.0.2 + d: 1.0.1 ext: 1.7.0 dev: false @@ -4574,38 +4391,6 @@ packages: '@esbuild/win32-arm64': 0.19.12 '@esbuild/win32-ia32': 0.19.12 '@esbuild/win32-x64': 0.19.12 - dev: false - - /[email protected]: - resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/aix-ppc64': 0.20.2 - '@esbuild/android-arm': 0.20.2 - '@esbuild/android-arm64': 0.20.2 - '@esbuild/android-x64': 0.20.2 - '@esbuild/darwin-arm64': 0.20.2 - '@esbuild/darwin-x64': 0.20.2 - '@esbuild/freebsd-arm64': 0.20.2 - '@esbuild/freebsd-x64': 0.20.2 - '@esbuild/linux-arm': 0.20.2 - '@esbuild/linux-arm64': 0.20.2 - '@esbuild/linux-ia32': 0.20.2 - '@esbuild/linux-loong64': 0.20.2 - '@esbuild/linux-mips64el': 0.20.2 - '@esbuild/linux-ppc64': 0.20.2 - '@esbuild/linux-riscv64': 0.20.2 - '@esbuild/linux-s390x': 0.20.2 - '@esbuild/linux-x64': 0.20.2 - '@esbuild/netbsd-x64': 0.20.2 - '@esbuild/openbsd-x64': 0.20.2 - '@esbuild/sunos-x64': 0.20.2 - '@esbuild/win32-arm64': 0.20.2 - '@esbuild/win32-ia32': 0.20.2 - '@esbuild/win32-x64': 0.20.2 - dev: true /[email protected]: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} @@ -4644,6 +4429,15 @@ packages: source-map: 0.6.1 dev: false + /[email protected]([email protected]): + resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 8.57.0 + dev: true + /[email protected]([email protected]): resolution: {integrity: sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==} engines: {node: '>=12'} @@ -4701,8 +4495,8 @@ packages: optionator: 0.9.3 dev: true - /[email protected]([email protected]): - resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==} + /[email protected]([email protected]): + resolution: {integrity: sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: eslint: '>=8' @@ -4710,7 +4504,7 @@ packages: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@eslint-community/regexpp': 4.10.0 eslint: 8.57.0 - eslint-compat-utils: 0.5.0([email protected]) + eslint-compat-utils: 0.1.2([email protected]) dev: true /[email protected]([email protected]): @@ -4722,8 +4516,8 @@ packages: '@eslint-community/eslint-utils': 4.4.0([email protected]) builtins: 5.0.1 eslint: 8.57.0 - eslint-plugin-es-x: 7.6.0([email protected]) - get-tsconfig: 4.7.3 + eslint-plugin-es-x: 7.5.0([email protected]) + get-tsconfig: 4.7.2 globals: 13.24.0 ignore: 5.3.1 is-builtin-module: 3.2.1 @@ -4766,7 +4560,7 @@ packages: '@eslint/eslintrc': 2.1.4 ci-info: 4.0.0 clean-regexp: 1.0.0 - core-js-compat: 3.36.1 + core-js-compat: 3.36.0 eslint: 8.57.0 esquery: 1.5.0 indent-string: 4.0.0 @@ -4870,7 +4664,7 @@ packages: resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} engines: {node: '>=0.10'} dependencies: - d: 1.0.2 + d: 1.0.1 es5-ext: 0.10.64 event-emitter: 0.3.5 type: 2.7.2 @@ -4936,7 +4730,7 @@ packages: /[email protected]: resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} dependencies: - d: 1.0.2 + d: 1.0.1 es5-ext: 0.10.64 dev: false @@ -4976,7 +4770,7 @@ packages: human-signals: 5.0.0 is-stream: 3.0.0 merge-stream: 2.0.0 - npm-run-path: 5.3.0 + npm-run-path: 5.2.0 onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 @@ -5061,8 +4855,8 @@ packages: /[email protected]: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - /[email protected]: - resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + /[email protected]: + resolution: {integrity: sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==} engines: {node: '>=6'} dev: false @@ -5141,13 +4935,13 @@ packages: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: - flatted: 3.3.1 + flatted: 3.2.9 keyv: 4.5.4 rimraf: 3.0.2 dev: true - /[email protected]: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + /[email protected]: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} dev: true /[email protected]: @@ -5224,7 +5018,7 @@ packages: dezalgo: 1.0.4 hexoid: 1.0.0 once: 1.4.0 - qs: 6.12.0 + qs: 6.11.2 dev: true /[email protected]: @@ -5279,8 +5073,8 @@ packages: wide-align: 1.1.5 dev: true - /[email protected]: - resolution: {integrity: sha512-p+ggrQw3fBwH2F5N/PAI4k/G/y1art5OxKpb2J2chwNNHM4hHuAOtivjPuirMF4KNKwTTUal/lPfL2+7h2mEcg==} + /[email protected]: + resolution: {integrity: sha512-H6+bHeoEAU5D6XNc6mPKeN5dLZqEDs9Gpk6I+SZBEzK5So58JVrHPmevNi35fRl1J9Y5TaeLW0kYx3pCJ1U2mQ==} engines: {node: '>=14'} dependencies: extend: 3.0.2 @@ -5296,7 +5090,7 @@ packages: resolution: {integrity: sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==} engines: {node: '>=14'} dependencies: - gaxios: 6.3.0 + gaxios: 6.2.0 json-bigint: 1.0.0 transitivePeerDependencies: - encoding @@ -5328,9 +5122,9 @@ packages: dependencies: es-errors: 1.3.0 function-bind: 1.1.2 - has-proto: 1.0.3 + has-proto: 1.0.1 has-symbols: 1.0.3 - hasown: 2.0.2 + hasown: 2.0.1 /[email protected]: resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} @@ -5353,8 +5147,8 @@ packages: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} - /[email protected]: - resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} + /[email protected]: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: resolve-pkg-maps: 1.0.0 @@ -5362,7 +5156,7 @@ packages: resolution: {integrity: sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==} engines: {node: '>= 14'} dependencies: - basic-ftp: 5.0.5 + basic-ftp: 5.0.4 data-uri-to-buffer: 6.0.2 debug: 4.3.4 fs-extra: 11.2.0 @@ -5406,7 +5200,7 @@ packages: foreground-child: 3.1.1 jackspeak: 2.3.6 minimatch: 9.0.3 - minipass: 7.0.4 + minipass: 5.0.0 path-scurry: 1.10.1 dev: true @@ -5448,13 +5242,13 @@ packages: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} dev: true - /[email protected]: - resolution: {integrity: sha512-I/AvzBiUXDzLOy4iIZ2W+Zq33W4lcukQv1nl7C8WUA6SQwyQwUwu3waNmWNAvzds//FG8SZ+DnKnW/2k6mQS8A==} + /[email protected]: + resolution: {integrity: sha512-4CacM29MLC2eT9Cey5GDVK4Q8t+MMp8+OEdOaqD9MG6b0dOyLORaaeJMPQ7EESVgm/+z5EKYyFLxgzBJlJgyHQ==} engines: {node: '>=14'} dependencies: base64-js: 1.5.1 ecdsa-sig-formatter: 1.0.11 - gaxios: 6.3.0 + gaxios: 6.2.0 gcp-metadata: 6.1.0 gtoken: 7.1.0 jws: 4.0.0 @@ -5463,14 +5257,14 @@ packages: - supports-color dev: false - /[email protected]: - resolution: {integrity: sha512-p3KHiWDBBWJEXk6SYauBEvxw5+UmRy7k2scxGtsNv9eHsTbpopJ3/7If4OrNnzJ9XMLg3IlyQXpVp8YPQsStiw==} + /[email protected]: + resolution: {integrity: sha512-mgt5zsd7zj5t5QXvDanjWguMdHAcJmmDrF9RkInCecNsyV7S7YtGqm5v2IWONNID88osb7zmx5FtrAP12JfD0w==} engines: {node: '>=14.0.0'} dependencies: extend: 3.0.2 - gaxios: 6.3.0 - google-auth-library: 9.7.0 - qs: 6.12.0 + gaxios: 6.2.0 + google-auth-library: 9.6.3 + qs: 6.11.2 url-template: 2.0.8 uuid: 9.0.1 transitivePeerDependencies: @@ -5482,8 +5276,8 @@ packages: resolution: {integrity: sha512-o8LhD1754W6MHWtpwAPeP1WUHgNxuMxCnLMDFlMKAA5kCMTNqX9/eaTXnkkAIv6YRfoKMQ6D1vyR6/biXuhE9g==} engines: {node: '>=14.0.0'} dependencies: - google-auth-library: 9.7.0 - googleapis-common: 7.1.0 + google-auth-library: 9.6.3 + googleapis-common: 7.0.1 transitivePeerDependencies: - encoding - supports-color @@ -5543,7 +5337,7 @@ packages: resolution: {integrity: sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==} engines: {node: '>=14.0.0'} dependencies: - gaxios: 6.3.0 + gaxios: 6.2.0 jws: 4.0.0 transitivePeerDependencies: - encoding @@ -5590,8 +5384,8 @@ packages: dependencies: es-define-property: 1.0.0 - /[email protected]: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + /[email protected]: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} /[email protected]: @@ -5602,8 +5396,8 @@ packages: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} dev: true - /[email protected]: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + /[email protected]: + resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 @@ -5702,8 +5496,8 @@ packages: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: false - /[email protected]: - resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} + /[email protected]: + resolution: {integrity: sha512-My1KCEPs6A0hb4qCVzYp8iEvA8j8YqcvXLZZH8C9OFuTYpYjHE7N2dtG3mRl1HMD4+VGXpF3XcDVcxGBT7yDZQ==} engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 @@ -5874,7 +5668,7 @@ packages: re2: optional: true dependencies: - '@lifeomic/attempt': 3.1.0 + '@lifeomic/attempt': 3.0.3 '@types/chance': 1.1.6 '@types/request-promise': 4.1.51 bluebird: 3.7.2 @@ -5960,7 +5754,7 @@ packages: /[email protected]: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: - hasown: 2.0.2 + hasown: 2.0.1 /[email protected]: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} @@ -6096,8 +5890,8 @@ packages: - supports-color dev: true - /[email protected]: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} + /[email protected]: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} dependencies: html-escaper: 2.0.2 @@ -6174,7 +5968,7 @@ packages: decimal.js: 10.4.3 form-data: 4.0.0 html-encoding-sniffer: 4.0.0 - http-proxy-agent: 7.0.2 + http-proxy-agent: 7.0.1 https-proxy-agent: 7.0.4 is-potential-custom-element-name: 1.0.1 nwsapi: 2.2.7 @@ -6518,7 +6312,7 @@ packages: resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} engines: {node: '>=18'} dependencies: - ansi-escapes: 6.2.1 + ansi-escapes: 6.2.0 cli-cursor: 4.0.0 slice-ansi: 7.1.0 strip-ansi: 7.1.0 @@ -6599,9 +6393,9 @@ packages: /[email protected]: resolution: {integrity: sha512-ZbrP1Qxnpoes8sz47AM0z08U+jW6TyRgZzcWy3Ma3vDhJttwMwAFDMMQFobwdBxByBD46JYmxRzeF7w2+wJEuw==} dependencies: - '@babel/parser': 7.24.1 - '@babel/types': 7.24.0 - source-map-js: 1.2.0 + '@babel/parser': 7.23.9 + '@babel/types': 7.23.9 + source-map-js: 1.0.2 dev: true /[email protected]: @@ -6988,11 +6782,6 @@ packages: engines: {node: '>=8'} dev: true - /[email protected]: - resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} - engines: {node: '>=16 || 14 >=14.17'} - dev: true - /[email protected]: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} @@ -7025,7 +6814,7 @@ packages: acorn: 8.11.3 pathe: 1.1.2 pkg-types: 1.0.3 - ufo: 1.5.3 + ufo: 1.4.0 dev: true /[email protected]: @@ -7155,8 +6944,8 @@ packages: validate-npm-package-license: 3.0.4 dev: true - /[email protected]: - resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} + /[email protected]: + resolution: {integrity: sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==} engines: {node: '>=14.16'} dev: false @@ -7177,8 +6966,8 @@ packages: path-key: 2.0.1 dev: false - /[email protected]: - resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + /[email protected]: + resolution: {integrity: sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: path-key: 4.0.0 @@ -7257,7 +7046,7 @@ packages: /[email protected]: resolution: {integrity: sha512-+9g4actZKeb3czfi9gVQ4Br2Ju3KwhCAQJBNaKgye5KggqcBLIhFHH+nIkcm0BUX00TrAJl6dH4JWgM4G4JWrw==} dependencies: - yaml: 2.4.1 + yaml: 2.3.4 dev: false /[email protected]: @@ -7375,7 +7164,7 @@ packages: agent-base: 7.1.0 debug: 4.3.4 get-uri: 6.0.3 - http-proxy-agent: 7.0.2 + http-proxy-agent: 7.0.1 https-proxy-agent: 7.0.4 pac-resolver: 7.0.1 socks-proxy-agent: 8.0.2 @@ -7474,7 +7263,7 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: lru-cache: 10.2.0 - minipass: 7.0.4 + minipass: 5.0.0 dev: true /[email protected]: @@ -7537,7 +7326,7 @@ packages: hasBin: true dependencies: atomic-sleep: 1.0.0 - fast-redact: 3.5.0 + fast-redact: 3.3.0 on-exit-leak-free: 2.1.2 pino-abstract-transport: 1.1.0 pino-std-serializers: 6.2.2 @@ -7562,13 +7351,13 @@ packages: engines: {node: '>=4'} dev: true - /[email protected]: - resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + /[email protected]: + resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.7 picocolors: 1.0.0 - source-map-js: 1.2.0 + source-map-js: 1.0.2 /[email protected]: resolution: {integrity: sha512-uL9sCML4gPH6Z4hreDWbeinKU0p0Ke261nU7OvII95NU22HN6Dk7T/SaVPaj6T4TsQqGKIFw6/woLZnH7ugFNA==} @@ -7659,7 +7448,7 @@ packages: dependencies: agent-base: 7.1.0 debug: 4.3.4 - http-proxy-agent: 7.0.2 + http-proxy-agent: 7.0.1 https-proxy-agent: 7.0.4 lru-cache: 7.18.3 pac-proxy-agent: 7.0.1 @@ -7840,11 +7629,11 @@ packages: - utf-8-validate dev: false - /[email protected]: - resolution: {integrity: sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==} + /[email protected]: + resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} engines: {node: '>=0.6'} dependencies: - side-channel: 1.0.6 + side-channel: 1.0.5 /[email protected]: resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} @@ -7986,7 +7775,7 @@ packages: /[email protected]: resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.0 dev: true /[email protected]: @@ -8042,7 +7831,7 @@ packages: dev: false /[email protected]([email protected]): - resolution: {integrity: sha1-Pu3UIjII1BmGe3jOgVFn0QWToi8=, tarball: https://registry.npmmirror.com/request-promise-core/download/request-promise-core-1.1.4.tgz} + resolution: {integrity: sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==} engines: {node: '>=0.10.0'} peerDependencies: request: ^2.34 @@ -8166,26 +7955,26 @@ packages: dependencies: glob: 7.2.3 - /[email protected]: - resolution: {integrity: sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==} + /[email protected]: + resolution: {integrity: sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.13.0 - '@rollup/rollup-android-arm64': 4.13.0 - '@rollup/rollup-darwin-arm64': 4.13.0 - '@rollup/rollup-darwin-x64': 4.13.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.13.0 - '@rollup/rollup-linux-arm64-gnu': 4.13.0 - '@rollup/rollup-linux-arm64-musl': 4.13.0 - '@rollup/rollup-linux-riscv64-gnu': 4.13.0 - '@rollup/rollup-linux-x64-gnu': 4.13.0 - '@rollup/rollup-linux-x64-musl': 4.13.0 - '@rollup/rollup-win32-arm64-msvc': 4.13.0 - '@rollup/rollup-win32-ia32-msvc': 4.13.0 - '@rollup/rollup-win32-x64-msvc': 4.13.0 + '@rollup/rollup-android-arm-eabi': 4.12.0 + '@rollup/rollup-android-arm64': 4.12.0 + '@rollup/rollup-darwin-arm64': 4.12.0 + '@rollup/rollup-darwin-x64': 4.12.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.12.0 + '@rollup/rollup-linux-arm64-gnu': 4.12.0 + '@rollup/rollup-linux-arm64-musl': 4.12.0 + '@rollup/rollup-linux-riscv64-gnu': 4.12.0 + '@rollup/rollup-linux-x64-gnu': 4.12.0 + '@rollup/rollup-linux-x64-musl': 4.12.0 + '@rollup/rollup-win32-arm64-msvc': 4.12.0 + '@rollup/rollup-win32-ia32-msvc': 4.12.0 + '@rollup/rollup-win32-x64-msvc': 4.12.0 fsevents: 2.3.3 dev: true @@ -8242,7 +8031,7 @@ packages: htmlparser2: 8.0.2 is-plain-object: 5.0.0 parse-srcset: 1.0.2 - postcss: 8.4.38 + postcss: 8.4.35 dev: false /[email protected]: @@ -8282,8 +8071,8 @@ packages: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true - /[email protected]: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + /[email protected]: + resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} engines: {node: '>= 0.4'} dependencies: define-data-property: 1.1.4 @@ -8335,8 +8124,8 @@ packages: rechoir: 0.6.2 dev: false - /[email protected]: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + /[email protected]: + resolution: {integrity: sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 @@ -8410,11 +8199,20 @@ packages: dependencies: agent-base: 7.1.0 debug: 4.3.4 - socks: 2.8.1 + socks: 2.7.3 transitivePeerDependencies: - supports-color dev: false + /[email protected]: + resolution: {integrity: sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + deprecated: please use 2.7.4 or 2.8.1 to fix package-lock issue + dependencies: + ip-address: 9.0.5 + smart-buffer: 4.2.0 + dev: false + /[email protected]: resolution: {integrity: sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} @@ -8429,8 +8227,8 @@ packages: atomic-sleep: 1.0.0 dev: false - /[email protected]: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + /[email protected]: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} /[email protected]: @@ -8455,14 +8253,14 @@ packages: spdx-license-ids: 3.0.17 dev: true - /[email protected]: - resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + /[email protected]: + resolution: {integrity: sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==} dev: true /[email protected]: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: - spdx-exceptions: 2.5.0 + spdx-exceptions: 2.4.0 spdx-license-ids: 3.0.17 dev: true @@ -8536,13 +8334,13 @@ packages: bluebird: 2.11.0 dev: false - /[email protected]: - resolution: {integrity: sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==} + /[email protected]: + resolution: {integrity: sha512-6pwMeMY/SuISiRsuS8TeIrAzyFbG5gGPHFQsYjUr/pbBadaL1PCWmzKw+CHZSwainfvcF6Si6cVLq4XTEwswFQ==} dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 optionalDependencies: - bare-events: 2.2.2 + bare-events: 2.2.0 dev: false /[email protected]: @@ -8657,7 +8455,7 @@ packages: formidable: 2.1.2 methods: 1.1.2 mime: 2.6.0 - qs: 6.12.0 + qs: 6.11.2 semver: 7.6.0 transitivePeerDependencies: - supports-color @@ -8728,11 +8526,11 @@ packages: dependencies: b4a: 1.6.6 fast-fifo: 1.3.2 - streamx: 2.16.1 + streamx: 2.15.8 dev: false - /[email protected]: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} + /[email protected]: + resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==} engines: {node: '>=10'} dependencies: chownr: 2.0.0 @@ -8806,8 +8604,8 @@ packages: resolution: {integrity: sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==} dev: true - /[email protected]: - resolution: {integrity: sha512-Ud7uepAklqRH1bvwy22ynrliC7Dljz7Tm8M/0RBUW+YRa4YHhZ6e4PpgE+fu1zr/WqB1kbeuVrdfeuyIBpy4tw==} + /[email protected]: + resolution: {integrity: sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==} engines: {node: '>=14.0.0'} dev: true @@ -8836,11 +8634,6 @@ packages: hasBin: true dev: false - /[email protected]: - resolution: {integrity: sha512-yztVk5O1LGKCjPd+7soBQyiKvSBXI5qugc/X0C7pLa0rV5ufBS6xcyX0pdf4NznO8xcZ5fqX248q+jTHd4AQJA==} - hasBin: true - dev: false - /[email protected]: resolution: {integrity: sha512-McyMQkkIUFYhfs3FPTxTn+5mewxERhfwy2x7TWHkBPb1poKaTBJhXehtuMg0FrhXp53J5eXRfvSD/oH/3mk/2A==} dev: false @@ -8927,8 +8720,8 @@ packages: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} dev: true - /[email protected]([email protected]): - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + /[email protected]([email protected]): + resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' @@ -8977,7 +8770,7 @@ packages: hasBin: true dependencies: esbuild: 0.19.12 - get-tsconfig: 4.7.3 + get-tsconfig: 4.7.2 optionalDependencies: fsevents: 2.3.3 dev: false @@ -8988,8 +8781,8 @@ packages: safe-buffer: 5.2.1 dev: false - /[email protected]: - resolution: {integrity: sha512-Z3/iJ6IWh8VBiACWQJaA5ulPQE5E1QwvBHj00uGzdQxdRnd8fh1DPqNOJqzQDu6DkOstORrtXzf/9adB+vMtEA==} + /[email protected]: + resolution: {integrity: sha512-ntI9R7fcUKjqBP6QU8rBK2Ehyt8LAzt3UBT9JR9tgo6GtuKvyUzpayWmeMKJw1DPdXzktvtIT8m2mVXz+bL/Qg==} dependencies: domino: 2.1.6 dev: false @@ -9046,6 +8839,15 @@ packages: engines: {node: '>=10'} dev: false + /[email protected]: + resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} + engines: {node: '>=14.16'} + dev: true + + /[email protected]: + resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} + dev: false + /[email protected]: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} dev: false @@ -9065,8 +8867,8 @@ packages: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} dev: false - /[email protected]: - resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} + /[email protected]: + resolution: {integrity: sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==} dev: true /[email protected]: @@ -9173,7 +8975,7 @@ packages: optional: true dependencies: ip-regex: 4.3.0 - tlds: 1.251.0 + tlds: 1.250.0 dev: false /[email protected]: @@ -9224,7 +9026,7 @@ packages: resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/trace-mapping': 0.3.22 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 dev: true @@ -9273,7 +9075,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.6(@types/[email protected]) + vite: 5.1.5(@types/[email protected]) transitivePeerDependencies: - '@types/node' - less @@ -9301,8 +9103,8 @@ packages: - typescript dev: true - /[email protected](@types/[email protected]): - resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==} + /[email protected](@types/[email protected]): + resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -9330,9 +9132,9 @@ packages: optional: true dependencies: '@types/node': 20.11.30 - esbuild: 0.20.2 - postcss: 8.4.38 - rollup: 4.13.0 + esbuild: 0.19.12 + postcss: 8.4.35 + rollup: 4.12.0 optionalDependencies: fsevents: 2.3.3 dev: true @@ -9380,8 +9182,8 @@ packages: std-env: 3.7.0 strip-literal: 2.0.0 tinybench: 2.6.0 - tinypool: 0.8.3 - vite: 5.2.6(@types/[email protected]) + tinypool: 0.8.2 + vite: 5.1.5(@types/[email protected]) vite-node: 1.4.0(@types/[email protected]) why-is-node-running: 2.2.2 transitivePeerDependencies: @@ -9625,18 +9427,12 @@ packages: dependencies: eslint-visitor-keys: 3.4.3 lodash: 4.17.21 - yaml: 2.4.1 + yaml: 2.3.4 dev: true /[email protected]: resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} engines: {node: '>= 14'} - dev: true - - /[email protected]: - resolution: {integrity: sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==} - engines: {node: '>= 14'} - hasBin: true /[email protected]: resolution: {integrity: sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==}
30657490ec728b9626ec5618f05ce2ff7fa0abfc
2024-03-03 21:31:14
Yufan You
fix: use access token for all Mastodon routes (#14634)
false
use access token for all Mastodon routes (#14634)
fix
diff --git a/lib/routes/mastodon/timeline-local.js b/lib/routes/mastodon/timeline-local.js index 973a0f8bc389b0..96b9eeb2b86609 100644 --- a/lib/routes/mastodon/timeline-local.js +++ b/lib/routes/mastodon/timeline-local.js @@ -11,7 +11,7 @@ export default async (ctx) => { const url = `http://${site}/api/v1/timelines/public?local=true&only_media=${only_media}`; - const response = await got.get(url); + const response = await got.get(url, { headers: utils.apiHeaders() }); const list = response.data; ctx.set('data', { diff --git a/lib/routes/mastodon/timeline-remote.js b/lib/routes/mastodon/timeline-remote.js index 1cb3a50b41c46d..2dc557ccaae80b 100644 --- a/lib/routes/mastodon/timeline-remote.js +++ b/lib/routes/mastodon/timeline-remote.js @@ -11,7 +11,7 @@ export default async (ctx) => { const url = `http://${site}/api/v1/timelines/public?remote=true&only_media=${only_media}`; - const response = await got.get(url); + const response = await got.get(url, { headers: utils.apiHeaders() }); const list = response.data; ctx.set('data', { diff --git a/lib/routes/mastodon/utils.js b/lib/routes/mastodon/utils.js index 74d25cb196226e..df58e73f0d039a 100644 --- a/lib/routes/mastodon/utils.js +++ b/lib/routes/mastodon/utils.js @@ -5,6 +5,12 @@ import { config } from '@/config'; const allowSiteList = ['mastodon.social', 'pawoo.net']; +const apiHeaders = (site) => { + const { accessToken, apiHost } = config.mastodon; + // avoid sending API token to other sites + return accessToken && site === apiHost ? { Authorization: `Bearer ${accessToken}` } : {}; +}; + const mediaParse = (media_attachments) => media_attachments .map((item) => { @@ -59,6 +65,7 @@ async function getAccountStatuses(site, account_id, only_media) { const statuses_response = await got({ method: 'get', url: statuses_url, + headers: apiHeaders(site), }); const data = statuses_response.data; @@ -70,6 +77,7 @@ async function getAccountStatuses(site, account_id, only_media) { const account_response = await got({ method: 'get', url: account_url, + headers: apiHeaders(site), }); account_data = account_response.data; } @@ -95,9 +103,7 @@ async function getAccountIdByAcct(acct) { const search_response = await got({ method: 'get', url: search_url, - headers: { - ...(mastodonConfig.accessToken ? { Authorization: `Bearer ${mastodonConfig.accessToken}` } : {}), - }, + headers: apiHeaders(site), searchParams: { q: acct, type: 'accounts', @@ -123,6 +129,7 @@ async function getAccountIdByAcct(acct) { } module.exports = { + apiHeaders, parseStatuses, getAccountStatuses, getAccountIdByAcct,
b77ea8a8b4a366087b72a63ec5c8b9c5d90a1407
2024-10-30 08:29:24
karasu
fix(route): follow (#17360)
false
follow (#17360)
fix
diff --git a/lib/routes/follow/profile.ts b/lib/routes/follow/profile.ts index c2d6108291e4ee..5301a2a5436222 100644 --- a/lib/routes/follow/profile.ts +++ b/lib/routes/follow/profile.ts @@ -31,10 +31,18 @@ const isList = (subscription: Subscription): subscription is ListSubscription => const isInbox = (subscription: Subscription): subscription is InboxSubscription => 'inboxId' in subscription; async function handler(ctx: Context): Promise<Data> { - const uid = ctx.req.param('uid'); + const handleOrId = ctx.req.param('uid'); const host = 'https://api.follow.is'; - const profile = await ofetch<FollowResponse<Profile>>(`${host}/profiles?id=${uid}`); + const handle = isBizId(handleOrId || '') ? handleOrId : handleOrId.startsWith('@') ? handleOrId.slice(1) : handleOrId; + + const searchParams = new URLSearchParams({ handle }); + + if (isBizId(handle || '')) { + searchParams.append('id', handle); + } + + const profile = await ofetch<FollowResponse<Profile>>(`${host}/profiles?${searchParams.toString()}`); const subscriptions = await ofetch<FollowResponse<Subscription[]>>(`${host}/subscriptions?userId=${profile.data.id}`); return { @@ -56,7 +64,7 @@ async function handler(ctx: Context): Promise<Data> { category: subscription.category ? [subscription.category] : undefined, }; }), - link: `https://app.follow.is/profile/${uid}`, + link: `https://app.follow.is/share/user/${handleOrId}`, image: profile.data.image, }; } @@ -81,3 +89,29 @@ const getUrlIcon = (url: string, fallback?: boolean | undefined) => { return ret; }; + +// referenced from https://github.com/RSSNext/Follow/blob/dev/packages/utils/src/utils.ts +const EPOCH = 1_712_546_615_000n; // follow repo created +const MAX_TIMESTAMP_BITS = 41n; // Maximum number of bits typically used for timestamp +export const isBizId = (id: string): boolean => { + if (!id || !/^\d{13,19}$/.test(id)) { + return false; + } + + const snowflake = BigInt(id); + + // Extract the timestamp assuming it's in the most significant bits after the sign bit + const timestamp = (snowflake >> (63n - MAX_TIMESTAMP_BITS)) + EPOCH; + const date = new Date(Number(timestamp)); + + // Check if the date is reasonable (between 2024 and 2050) + if (date.getFullYear() >= 2024 && date.getFullYear() <= 2050) { + // Additional validation: check if the ID is not larger than the maximum possible value + const maxPossibleId = (1n << 63n) - 1n; // Maximum possible 63-bit value + if (snowflake <= maxPossibleId) { + return true; + } + } + + return false; +};
02963d1951c4a076cfc34af05083c1ee2016dbdb
2025-02-15 13:28:48
KTachibanaM
feat: fix /people items and description (#18360)
false
fix /people items and description (#18360)
feat
diff --git a/lib/routes/people/index.ts b/lib/routes/people/index.ts index 9543a452a99625..2400405f439f2f 100644 --- a/lib/routes/people/index.ts +++ b/lib/routes/people/index.ts @@ -47,7 +47,7 @@ async function handler(ctx) { $(e).parent().remove(); }); - let items = $('.p6, div.p2j_list, div.headingNews, div.ej_list_box, .fl, .leftItem') + let items = $('.p6, div.p2j_list, div.headingNews, div.ej_list_box, .leftItem') .find('a') .slice(0, limit) .toArray() @@ -75,7 +75,7 @@ async function handler(ctx) { content('.paper_num, #rwb_tjyd').remove(); - item.description = content('.rm_txt_con, .show_text').html(); + item.description = content('#rwb_zw').html(); item.pubDate = timezone(parseDate(data.match(/(\d{4}年\d{2}月\d{2}日\d{2}:\d{2})/)[1], 'YYYY年MM月DD日 HH:mm'), +8); } catch (error) { item.description = error;
a9ca8844d436c07f6f57411757b39e0f7dab2ba0
2021-08-20 11:32:52
Ethan Shen
fix(route): 站酷发现有视频条目 (#8044)
false
站酷发现有视频条目 (#8044)
fix
diff --git a/lib/routes/zcool/discover.js b/lib/routes/zcool/discover.js index f17c18df29bd6c..bf7cf0097c6817 100644 --- a/lib/routes/zcool/discover.js +++ b/lib/routes/zcool/discover.js @@ -57,6 +57,7 @@ module.exports = async (ctx) => { } queries.limit = '20'; queries.page = '1'; + } else { switch (query) { case 'home': @@ -116,15 +117,16 @@ module.exports = async (ctx) => { const videos = detailResponse.data.match(/source: '(https:\/\/video\.zcool\.cn\/.*)',/g); - let i = 0; - content('.video-content-box').each(function () { - if (i >= videos.length) { - return; - } - content(this).append(`<video src="${videos[i++].match(/source: '(https:\/\/video\.zcool\.cn\/.*)'/)[1]}" controls="controls">`); - }); + if (videos) { + content('.video-content-box').each(function (i) { + if (i >= videos.length) { + return; + } + content(this).append(`<video src="${videos[i].match(/source: '(https:\/\/video\.zcool\.cn\/.*)'/)[1]}" controls="controls">`); + }); + } - item.description = item.link.indexOf('article') < 0 ? content('.work-content-wrap').html() : content('.article-content-wraper').html(); + item.description = item.link.includes('article') ? content('.work-content-wrap').html() : content('.article-content-wraper').html(); return item; })
5f84d7557a9a0b54209d7401e23e29cd810ff9b7
2023-06-08 21:11:23
miles
fix(route): author retrieval in nationalgeographic/latest-stories.js (#12636)
false
author retrieval in nationalgeographic/latest-stories.js (#12636)
fix
diff --git a/lib/v2/nationalgeographic/latest-stories.js b/lib/v2/nationalgeographic/latest-stories.js index c5205a6b3a9c03..bc842de0f6b854 100644 --- a/lib/v2/nationalgeographic/latest-stories.js +++ b/lib/v2/nationalgeographic/latest-stories.js @@ -32,7 +32,10 @@ module.exports = async (ctx) => { const mods = findNatgeo($).page.content.article.frms.find((f) => f.cmsType === 'ArticleBodyFrame').mods; const bodyTile = mods.find((m) => m.edgs[0].cmsType === 'ArticleBodyTile').edgs[0]; - item.author = bodyTile.schma.athrs.map((a) => a.name).join(', '); + item.author = bodyTile.cntrbGrp + .flatMap((c) => c.contributors) + .map((c) => c.displayName) + .join(', '); item.description = art(join(__dirname, 'templates/stories.art'), { ldMda: bodyTile.ldMda, description: bodyTile.dscrptn,
9823d36f753cc1d7438ecf0275c0f53582624e8d
2023-10-31 12:11:12
Colin
docs: update doc email route limitations (#13663)
false
update doc email route limitations (#13663)
docs
diff --git a/website/docs/install/README.md b/website/docs/install/README.md index 046d9ecdb22b4d..0847913620a60f 100644 --- a/website/docs/install/README.md +++ b/website/docs/install/README.md @@ -859,6 +859,8 @@ See docs of the specified route and `lib/config.js` for detailed information. - `EMAIL_CONFIG_{email}`: Mail setting, replace `{email}` with the email account, replace `@` and `.` in email account with `_`, e.g. `EMAIL_CONFIG_xxx_gmail_com`. The value is in the format of `password=password&host=server&port=port`, eg: - Linux env: `EMAIL_CONFIG_xxx_qq_com="password=123456&host=imap.qq.com&port=993"` - docker env: `EMAIL_CONFIG_xxx_qq_com=password=123456&host=imap.qq.com&port=993`, please do not include quotations `'`,`"` + + - Note: socks5h proxy is not supported due to the limit of email lib `ImapFlow` - Mastodon user timeline: apply API here `https://mastodon.example/settings/applications`(repalce `mastodon.example`), please check scope `read:search`
9e6cf26a6e14e0ca8a071d9014ed393120e2bd1f
2021-11-27 14:41:37
Ethan Shen
feat(route): add 台灣衛生福利部即時新聞澄清 (#8576)
false
add 台灣衛生福利部即時新聞澄清 (#8576)
feat
diff --git a/docs/government.md b/docs/government.md index 7b0fdbb71a721d..30fd1c689fc944 100644 --- a/docs/government.md +++ b/docs/government.md @@ -234,6 +234,12 @@ pageClass: routes <Route author="EsuRt" example="/gov/suzhou/doc" path="/gov/suzhou/doc"/> +## 台灣衛生福利部 + +### 即時新聞澄清 + +<Route author="nczitzk" example="/mohw/clarification" path="/mohw/clarification"/> + ## 武汉东湖新技术开发区 ### 新闻中心 diff --git a/lib/v2/mohw/clarification.js b/lib/v2/mohw/clarification.js new file mode 100644 index 00000000000000..354f59bc029960 --- /dev/null +++ b/lib/v2/mohw/clarification.js @@ -0,0 +1,50 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.mohw.gov.tw'; + const currentUrl = `${rootUrl}/lp-17-1.html`; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + let items = $('.list01 a[title]') + .toArray() + .map((item) => { + item = $(item); + + return { + title: item.text(), + link: item.attr('href'), + }; + }); + + items = await Promise.all( + items.map((item) => + ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + + const content = cheerio.load(detailResponse.data); + + item.description = content('article').html(); + item.pubDate = parseDate(content('meta[name="DC.Date"]').attr('datetime')); + + return item; + }) + ) + ); + + ctx.state.data = { + title: '即時新聞澄清 - 台灣衛生福利部', + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/mohw/maintainer.js b/lib/v2/mohw/maintainer.js new file mode 100644 index 00000000000000..724b6bb1694176 --- /dev/null +++ b/lib/v2/mohw/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/clarification': ['nczitzk'], +}; diff --git a/lib/v2/mohw/radar.js b/lib/v2/mohw/radar.js new file mode 100644 index 00000000000000..ae2f29fe3af5df --- /dev/null +++ b/lib/v2/mohw/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'mohw.gov.tw': { + _name: '台灣衛生福利部', + '.': [ + { + title: '即時新聞澄清', + docs: 'https://docs.rsshub.app/government.html#tai-wan-wei-sheng-fu-li-bu-ji-shi-xin-wen-cheng-qing', + source: ['/'], + target: '/mohw/clarification', + }, + ], + }, +}; diff --git a/lib/v2/mohw/router.js b/lib/v2/mohw/router.js new file mode 100644 index 00000000000000..da01389b2f1c57 --- /dev/null +++ b/lib/v2/mohw/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/clarification', require('./clarification')); +};
729b32e45fc97bbc7b7702ebc8ae23c727d7131f
2024-11-01 20:20:07
dependabot[bot]
chore(deps): bump telegram from 2.26.2 to 2.26.6 (#17401)
false
bump telegram from 2.26.2 to 2.26.6 (#17401)
chore
diff --git a/package.json b/package.json index e2816b90ee25a2..77e5fe026342fb 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "simplecc-wasm": "1.1.0", "socks-proxy-agent": "8.0.4", "source-map": "0.7.4", - "telegram": "2.26.2", + "telegram": "2.26.6", "tiny-async-pool": "2.1.0", "title": "3.5.3", "tldts": "6.1.57", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index edfdb08ee07853..95f9ebbd115584 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -222,8 +222,8 @@ importers: specifier: 0.7.4 version: 0.7.4 telegram: - specifier: 2.26.2 - version: 2.26.2 + specifier: 2.26.6 + version: 2.26.6 tiny-async-pool: specifier: 2.1.0 version: 2.1.0 @@ -5233,8 +5233,8 @@ packages: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} - [email protected]: - resolution: {integrity: sha512-KKXt4pVanB6xusgsyCZXAhFOWiUVVfoXZsFzXDrcWoWNbN67d42XIN25JLJ51Tnbe3MzNVUNk6jUeE6X0AYasQ==} + [email protected]: + resolution: {integrity: sha512-2nZGL3ADRnEoWV0NMH4E+rhPFSD03HQ1ugTHJqpZR2l0iPz5m8TfD+fWoicfe8sltpCcj7nLmNsiEf5ExX/eGA==} [email protected]: resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} @@ -11201,7 +11201,7 @@ snapshots: mkdirp: 1.0.4 yallist: 4.0.0 - [email protected]: + [email protected]: dependencies: '@cryptography/aes': 0.1.1 async-mutex: 0.3.2
a072942c28d34be57ef26503f87589f192fb1db8
2022-08-23 00:15:19
Devin
feat(route): add アニメ新番組 (#10559)
false
add アニメ新番組 (#10559)
feat
diff --git a/docs/anime.md b/docs/anime.md index 1f52d8e59b9e53..33d7f87823b511 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -652,3 +652,9 @@ Sources ### 最新汉化 <Route author="junfengP" example="/zdfx" path="/zdfx"/> + +## アニメ新番組 + +### 當季新番 + +<Route author="devinmugen" example="/bangumi/online" path="/bangumi/online"/> diff --git a/lib/v2/bangumi/maintainer.js b/lib/v2/bangumi/maintainer.js index b4a30df315cca2..52659f4b725857 100644 --- a/lib/v2/bangumi/maintainer.js +++ b/lib/v2/bangumi/maintainer.js @@ -1,4 +1,5 @@ module.exports = { + '/online': ['devinmugen'], '/': ['nczitzk'], '/:tags?': ['nczitzk'], }; diff --git a/lib/v2/bangumi/online.js b/lib/v2/bangumi/online.js new file mode 100644 index 00000000000000..658e2b6032652c --- /dev/null +++ b/lib/v2/bangumi/online.js @@ -0,0 +1,26 @@ +const got = require('@/utils/got'); +const { art } = require('@/utils/render'); +const path = require('path'); + +module.exports = async (ctx) => { + const url = 'https://bangumi.online/api/home'; + + const response = await got.post(url); + + const list = response.data.data.list; + + const items = list.map((item) => ({ + title: `${item.title_zh} - 第 ${item.volume} 集`, + description: art(path.join(__dirname, 'templates/image.art'), { + src: `https:${item.cover}`, + alt: `${item.title_zh} - 第 ${item.volume} 集`, + }), + link: `https://bangumi.online/watch/${item.vid}`, + })); + + ctx.state.data = { + title: 'アニメ新番組', + link: 'https://bangumi.online', + item: items, + }; +}; diff --git a/lib/v2/bangumi/radar.js b/lib/v2/bangumi/radar.js index 98c9fbc7692f5c..eea70864b610b2 100644 --- a/lib/v2/bangumi/radar.js +++ b/lib/v2/bangumi/radar.js @@ -1,6 +1,6 @@ module.exports = { - '萌番组 Bangumi Moe': { - _name: 'bangumi.moe', + 'bangumi.moe': { + _name: '萌番組', '.': [ { title: '最新', @@ -16,4 +16,15 @@ module.exports = { }, ], }, + 'bangumi.online': { + _name: 'アニメ新番組', + '.': [ + { + title: '當季新番', + docs: 'https://docs.rsshub.app/anime.html#アニメ-xin-fan-zu-dang-ji-xin-fan', + source: ['/'], + target: '/bangumi/online', + }, + ], + }, }; diff --git a/lib/v2/bangumi/router.js b/lib/v2/bangumi/router.js index 4063156855136b..5c90781a2bc572 100644 --- a/lib/v2/bangumi/router.js +++ b/lib/v2/bangumi/router.js @@ -1,3 +1,4 @@ module.exports = function (router) { + router.get('/online', require('./online')); router.get(/([\w-/]+)?/, require('./index')); }; diff --git a/lib/v2/bangumi/templates/image.art b/lib/v2/bangumi/templates/image.art new file mode 100644 index 00000000000000..40140a947ed74c --- /dev/null +++ b/lib/v2/bangumi/templates/image.art @@ -0,0 +1 @@ +<img src="{{ src }}" alt="{{ alt }}">
96270cd1cc864c46417874441bdece24b70e8710
2022-02-02 20:23:56
cjc7373
fix(route): zhihu posts pubDate (#8947)
false
zhihu posts pubDate (#8947)
fix
diff --git a/lib/routes/zhihu/posts.js b/lib/routes/zhihu/posts.js index 03149fd72caf2d..6d9181bce80ebb 100644 --- a/lib/routes/zhihu/posts.js +++ b/lib/routes/zhihu/posts.js @@ -1,6 +1,7 @@ const got = require('@/utils/got'); const utils = require('./utils'); const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const id = ctx.params.id; @@ -38,7 +39,7 @@ module.exports = async (ctx) => { title: String(item.title), description: item.content, link: item.url, - pubDate: new Date(item.updated).toUTCString(), + pubDate: parseDate(item.updated * 1000), })), }; };
a948dac9931ede36c7d499f78cb4f00686b77ab1
2023-01-03 21:11:55
Tony
fix(route): gq taiwan (#11549)
false
gq taiwan (#11549)
fix
diff --git a/docs/new-media.md b/docs/new-media.md index 85589538469db8..4fefbc6689f1c0 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -540,15 +540,15 @@ Country ## GQ -### GQ 台湾 +### GQ Taiwan -<Route author="nczitzk" example="/gq/tw/fashion" path="/gq/tw/:caty?/:subcaty?" :paramsDesc="['分类,见下表', '子分类,见下表']"> +<Route author="nczitzk" example="/gq/tw/fashion" path="/gq/tw/:caty?/:subcaty?" :paramsDesc="['分类,见下表', '子分类,见下表']" radar="1"> 分类 -| Fashion | Entertainment | Life | Gadget | Better Men | Video | Tag | -| ------- | ------------- | ---- | ------ | ---------- | ----- | --- | -| fashion | entertainment | life | gadget | bettermen | video | tag | +| Fashion | Shopping | Entertainment | Life | Gadget | Better Men | Video | Tag | +| ------- | ------------- | ------------- | ---- | ------ | ---------- | ----- | --- | +| fashion | gq-recommends | entertainment | life | gadget | bettermen | video | tag | 子分类 @@ -560,39 +560,33 @@ Fashion Entertainment -| 最新推薦 | 電影 | 娛樂 | 名人 | 美女 | 體育 | 特別報導 | -| ---- | ----- | ---------- | ----------- | ---- | ------ | ------- | -| | movie | popculture | celebrities | girl | sports | special | +| All topics | 電影 | 娛樂 | 名人 | 美女 | 體育 | 特別報導 | +| ---------- | ----- | ---------- | ----------- | ---- | ------ | ------- | +| | movie | popculture | celebrities | girl | sports | special | Life -| 最新推薦 | 美食 | 微醺 | 戶外生活 | 設計生活 | 風格幕後 | 特別報導 | -| ---- | ---- | ---- | ------- | ------ | ---------------- | ------- | -| | food | wine | outdoor | design | lifestyleinsider | special | +| All topics | 美食 | 微醺 | 戶外生活 | 設計生活 | 風格幕後 | 特別報導 | +| ---------- | ---- | ---- | ------- | ------ | ---------------- | ------- | +| | food | wine | outdoor | design | lifestyleinsider | special | Gadget -| 最新推薦 | 3C | 車 | 腕錶 | 特別報導 | -| ---- | -- | ---- | ----- | ------- | -| | 3c | auto | watch | special | +| All topics | 3C | 車 | 腕錶 | 特別報導 | +| ---------- | -- | ---- | ----- | ------- | +| | 3c | auto | watch | special | Better Men -| 最新推薦 | 保養健身 | 感情關係 | 性愛 | 特別報導 | -| ---- | --------- | ------------ | --- | ------- | -| | wellbeing | relationship | sex | special | - -Video - -| 最新推薦 | 名人 | 全球娛樂 | 玩家收藏 | 穿搭 | 生活 | -| ---- | ------ | ------------------- | ------- | ----- | ---- | -| | people | globalentertainment | collect | style | life | +| All topics | 保養健身 | 感情關係 | 性愛 | 特別報導 | +| ---------- | --------- | ------------ | --- | ------- | +| | wellbeing | relationship | sex | special | Tag -| 奧斯卡 | -| ------------------- | -| `the-oscars-奧斯卡金像獎` | +| 奧斯卡 | MOTY | +| ------------------- | ---- | +| `the-oscars-奧斯卡金像獎` | moty | </Route> diff --git a/lib/router.js b/lib/router.js index 8e7bd61cd7e7c3..f850f5030a9488 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3179,7 +3179,7 @@ router.get('/1x/:category?', lazyloadRouteHandler('./routes/1x/index')); router.get('/jx3/:caty?', lazyloadRouteHandler('./routes/jx3/news')); // GQ -router.get('/gq/tw/:caty?/:subcaty?', lazyloadRouteHandler('./routes/gq/tw/index')); +// router.get('/gq/tw/:caty?/:subcaty?', lazyloadRouteHandler('./routes/gq/tw/index')); // 泉州市跨境电子商务协会 router.get('/qzcea/:caty?', lazyloadRouteHandler('./routes/qzcea/index')); diff --git a/lib/routes/gq/tw/index.js b/lib/routes/gq/tw/index.js deleted file mode 100644 index 76c99530b36916..00000000000000 --- a/lib/routes/gq/tw/index.js +++ /dev/null @@ -1,66 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - ctx.params.caty = ctx.params.caty || ''; - ctx.params.subcaty = ctx.params.subcaty || ''; - - const rootUrl = 'https://www.gq.com.tw'; - const currentUrl = `${rootUrl}${ctx.params.caty === '' ? '' : '/' + ctx.params.caty}${ctx.params.subcaty === '' ? '' : '/' + ctx.params.subcaty}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - $('a[data-test-id="NavElement"]').remove(); - $('a[data-test-id="Link"]').remove(); - $('a[data-test-id="FooterLink"]').remove(); - - const list = $('a[data-test-id]') - .slice(0, 10) - .map((_, item) => { - item = $(item); - return { - link: `${rootUrl}${item.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('h1').text(); - - const article = content('section[data-test-id="ArticleBodyContent"]').html(); - const gallery = content('section[data-test-id="GalleryImage"]').html(); - - if (ctx.params.caty === 'video') { - item.description = content('div[data-test-id="EmbedIframe"]').html() + content('p[data-test-id="DekText"]').parent().html(); - item.pubDate = new Date(detailResponse.data.match(/pubDate":"(.*?)","channel/)[1]).toUTCString(); - } else if (gallery !== null) { - item.description = gallery; - item.pubDate = new Date(detailResponse.data.match(/pubDate":"(.*?)","items/)[1]).toUTCString(); - } else { - item.description = article; - item.pubDate = new Date(detailResponse.data.match(/pubDate":"(.*?)","publishedRevisions/)[1]).toUTCString(); - } - - return item; - }) - ) - ); - - ctx.state.data = { - title: `${$('title').eq(0).text()} - GQ Taiwan`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/v2/gq/maintainer.js b/lib/v2/gq/maintainer.js new file mode 100644 index 00000000000000..4423efadf965fc --- /dev/null +++ b/lib/v2/gq/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/tw/:caty?/:subcaty?': ['nczitzk'], +}; diff --git a/lib/v2/gq/radar.js b/lib/v2/gq/radar.js new file mode 100644 index 00000000000000..98028fb70fd1b4 --- /dev/null +++ b/lib/v2/gq/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'gq.com.tw': { + _name: 'GQ Taiwan', + '.': [ + { + title: 'GQ Taiwan', + docs: 'https://docs.rsshub.app/new-media.html#gq', + source: ['/*path'], + target: '/gq/tw/:path', + }, + ], + }, +}; diff --git a/lib/v2/gq/router.js b/lib/v2/gq/router.js new file mode 100644 index 00000000000000..3022fe20d51bf5 --- /dev/null +++ b/lib/v2/gq/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/tw/:caty?/:subcaty?', require('./tw/index')); +}; diff --git a/lib/v2/gq/templates/embed-article.art b/lib/v2/gq/templates/embed-article.art new file mode 100644 index 00000000000000..188ad1ff16bbba --- /dev/null +++ b/lib/v2/gq/templates/embed-article.art @@ -0,0 +1 @@ +<a href="{{ url }}" target="_blank">{{ text }}</a> diff --git a/lib/v2/gq/templates/embed-product.art b/lib/v2/gq/templates/embed-product.art new file mode 100644 index 00000000000000..5f0ebf53fe3746 --- /dev/null +++ b/lib/v2/gq/templates/embed-product.art @@ -0,0 +1,4 @@ +{{@ img }} +{{ productProps.dangerousHed }}<br> +{{ if productProps.offerRetailer }}{{ productProps.offerRetailer }} {{ /if }}{{ if productProps.multipleOffers }}{{ productProps.multipleOffers[0].price }}{{ /if }} +{{ if productProps.offerUrl }}<br><a href="{{ productProps.offerUrl }}" target="_blank">Buy It</a>{{ /if }} diff --git a/lib/v2/gq/templates/img.art b/lib/v2/gq/templates/img.art new file mode 100644 index 00000000000000..3019ef2764f824 --- /dev/null +++ b/lib/v2/gq/templates/img.art @@ -0,0 +1,4 @@ +<figure> + <img src="{{ src }}"{{ if alt }} alt="{{@ alt }}"{{ /if }}> + {{ if alt }}<figcaption>{{@ alt }}</figcaption>{{ /if }} +</figure> diff --git a/lib/v2/gq/templates/tw.art b/lib/v2/gq/templates/tw.art new file mode 100644 index 00000000000000..fdbe4866bb511c --- /dev/null +++ b/lib/v2/gq/templates/tw.art @@ -0,0 +1,3 @@ +{{ if dangerousDek }}<div>{{@ dangerousDek }}</div>{{ /if }} +{{ if lede }}{{@ lede }}{{ /if }} +{{ if articleBody }}{{@ articleBody }}{{ /if }} diff --git a/lib/v2/gq/templates/videoObject.art b/lib/v2/gq/templates/videoObject.art new file mode 100644 index 00000000000000..f78ab72d10f195 --- /dev/null +++ b/lib/v2/gq/templates/videoObject.art @@ -0,0 +1,6 @@ +<video controls preload="none" poster="{{ poster }}"> +{{ each sources source }} + <source src="{{ source.src }}" type="{{ source.contentType }}"> +{{ /each }} +</video> +{{@ articleBody }} diff --git a/lib/v2/gq/templates/youtube.art b/lib/v2/gq/templates/youtube.art new file mode 100644 index 00000000000000..0fd2a915b9e1fd --- /dev/null +++ b/lib/v2/gq/templates/youtube.art @@ -0,0 +1,3 @@ +{{ if videoId }} +<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube-nocookie.com/embed/{{ videoId }}" frameborder="0" allowfullscreen></iframe> +{{ /if }} diff --git a/lib/v2/gq/tw/index.js b/lib/v2/gq/tw/index.js new file mode 100644 index 00000000000000..252debac794112 --- /dev/null +++ b/lib/v2/gq/tw/index.js @@ -0,0 +1,165 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const md = require('markdown-it')({ + linkify: true, +}); +const { art } = require('@/utils/render'); +const path = require('path'); + +const baseUrl = 'https://www.gq.com.tw'; +const parsePreloadedStateJSON = ($) => + JSON.parse( + $('script[type="text/javascript"]') + .text() + .match(/window\.__PRELOADED_STATE__ = ({.*?});/)[1] + ); +const largestImage = (sources, id) => { + if (!id) { + let maxWidth = 0; + let maxUrl = ''; + Object.values(sources).forEach((size) => { + if (size.width > maxWidth) { + maxWidth = size.width; + maxUrl = size.url; + } + }); + return maxUrl; + } + const url = sources[Object.keys(sources)[0]].url; + const filename = url.substring(url.lastIndexOf('/') + 1); + return `https://media.gq.com.tw/photos/${id}/${filename}`; +}; + +module.exports = async (ctx) => { + const { caty, subcaty } = ctx.params; + const link = `${baseUrl}${caty ? `/${caty}` : ''}${subcaty ? `/${subcaty}` : ''}`; + const { data: response } = await got(link); + const $ = cheerio.load(response); + const { transformed } = parsePreloadedStateJSON($); + + const list = transformed.bundle.containers + .filter((item) => item.items) + .map((item) => + item.items.map((item) => ({ + title: item.source?.hed || item.dangerousHed, + description: item.source?.dek || item.dangerousDek, + link: (item.url.startsWith('http') ? item.url : `${baseUrl}${item.url}`).split('#intcid')[0], + pubDate: parseDate(item.pubDate), + author: item.contributors.author.items.map((item) => item.name).join(', '), + })) + ) + .flat(); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: response } = await got(item.link); + const $ = cheerio.load(response); + const data = JSON.parse($('script[type="application/ld+json"]').first().text()); + const { transformed } = parsePreloadedStateJSON($); + const VideoObject = data['@type'] === 'VideoObject' ? true : false; + const lede = !VideoObject ? transformed.article.headerProps.lede : null; + + let articleBody = ''; + if (!VideoObject) { + // typical article + // articleBody inludes non standard markdown syntax + articleBody = cheerio.load(md.render(data.articleBody.replace(/\{: target="_blank"\}/g, '')).replace(/\{: #link\}/g, ''), null, false); + articleBody('a').each((_, item) => { + item = $(item); + if (item.text().startsWith('#video:')) { + if (item.text().match(/youtube/)) { + const videoId = item.text().match(/.*https:\/\/www\.youtube\.com\/embed\/(.*)\s/)[1]; + item.replaceWith(art(path.join(__dirname, '../templates/youtube.art'), { videoId })); + } + } + if (item.text().startsWith('![#image:')) { + const imageId = item.text().match(/!\[#image: \/photos\/(.*?)\]/)[1]; + const imgInfo = transformed.article.lightboxImages.find((item) => item.id === imageId); + item.html( + art(path.join(__dirname, '../templates/img.art'), { + src: largestImage(imgInfo.sources, imageId), + alt: imgInfo.dangerousCaption, + }) + ); + } + }); + articleBody('p').each((_, item) => { + item = $(item); + if (item.text().startsWith('+++')) { + item.remove(); + } + if (item.text().startsWith('[#image:')) { + const imageId = item.text().match(/\[#image: \/photos\/(.*?)\]/)[1]; + const imgInfo = transformed.article.lightboxImages.find((item) => item.id === imageId); + item.replaceWith( + art(path.join(__dirname, '../templates/img.art'), { + src: largestImage(imgInfo.sources, imageId), + alt: imgInfo.dangerousCaption, + }) + ); + } + if (item.text().startsWith('[#article:')) { + const articleId = item.text().match(/\[#article: \/articles\/(.*?)\]/)[1]; + const articleProps = transformed.article.body.filter((i) => i[0] === 'inline-embed').find((i) => i[1].ref === articleId)[1].props; + item.replaceWith( + art(path.join(__dirname, '../templates/embed-article.art'), { + url: `${baseUrl}${articleProps.url}`, + text: articleProps.dangerousHed, + }) + ); + } + if (item.text().startsWith('[#product:')) { + const productId = item.text().match(/\[#product: \/products\/(.*?)\]/)[1]; + const productProps = transformed.article.body.filter((i) => i[0] === 'inline-embed').find((i) => i[1].ref === productId)[1].props; + item.replaceWith( + art(path.join(__dirname, '../templates/embed-product.art'), { + img: art(path.join(__dirname, '../templates/img.art'), { + src: largestImage(productProps.image.sources), + }), + productProps, + }) + ); + } + if (item.text().startsWith('[#instagram:')) { + const instagramHref = item.text().match(/\[#instagram: (.*?)\]/)[1]; + item.replaceWith( + art(path.join(__dirname, '../templates/embed-article.art'), { + url: instagramHref, + text: instagramHref, + }) + ); + } + }); + item.description = art(path.join(__dirname, '../templates/tw.art'), { + dangerousDek: transformed.article.headerProps.dangerousDek, // quote + lede: art(path.join(__dirname, '../templates/img.art'), { + // header image + src: largestImage(lede.sources, lede.id), + alt: lede.caption, + }), + articleBody: articleBody.html(), + }); + } else { + // is VideoObject + item.description = art(path.join(__dirname, '../templates/videoObject.art'), { + poster: transformed.video.metaImageUrl, + sources: transformed.video.sources, + articleBody: data.description, + }); + } + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${transformed.coreDataLayer.content.contentTitle} | ${transformed.coreDataLayer.content.brand}`, + link, + image: `${baseUrl}${transformed.logo.sources.sm.url}`, + item: items, + allowEmpty: true, + }; +};
7a259bf4941a80ecfcf311e94de2d0735a040b58
2023-12-31 22:06:21
Ethan Shen
feat(route): add 国家气候中心最新监测 (#14151)
false
add 国家气候中心最新监测 (#14151)
feat
diff --git a/lib/v2/ncc-cma/cmdp.js b/lib/v2/ncc-cma/cmdp.js new file mode 100644 index 00000000000000..9a15d931723300 --- /dev/null +++ b/lib/v2/ncc-cma/cmdp.js @@ -0,0 +1,81 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); +const iconv = require('iconv-lite'); + +module.exports = async (ctx) => { + const { id } = ctx.params; + const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 50; + + const ids = id?.split(/\//) ?? []; + const titles = []; + + const rootUrl = 'http://cmdp.ncc-cma.net'; + const currentUrl = new URL('cn/index.htm', rootUrl).href; + + const { data: response } = await got(currentUrl, { + responseType: 'buffer', + }); + + const $ = cheerio.load(iconv.decode(response, 'gbk')); + + const author = '国家气候中心'; + + const items = $('ul.img-con-new-con li img[id]') + .toArray() + .filter((item) => ids.length === 0 || ids.includes($(item).prop('id'))) + .slice(0, limit) + .map((item) => { + item = $(item); + + const id = item.prop('id'); + const title = $(`li[data-id="${id}"]`).text() || undefined; + const src = new URL(item.prop('src'), currentUrl).href; + const date = + src + .match(/_(\d{4})(\d{2})(\d{2})_/) + ?.slice(1, 4) + .join('-') ?? new Date().toISOString().slice(0, 10); + + if (ids.length !== 0 && title) { + titles.push(title); + } + + return { + title: `${title} ${date}`, + link: currentUrl, + description: art(path.join(__dirname, 'templates/description.art'), { + image: { + src, + alt: `${title} ${date}`, + }, + }), + author, + category: [title], + guid: `ncc-cma#${id}#${date}`, + pubDate: parseDate(date), + enclosure_url: src, + enclosure_type: `image/${src.split(/\./).pop()}`, + }; + }); + + const subtitle = $('h1').last().text(); + const image = $('img.logo').prop('src'); + const icon = new URL('favicon.ico', rootUrl).href; + + ctx.state.data = { + item: items, + title: `${author} - ${subtitle}${titles.length === 0 ? '' : ` - ${titles.join('|')}`}`, + link: currentUrl, + description: $('title').text(), + language: 'zh', + image, + icon, + logo: icon, + subtitle, + author, + allowEmpty: true, + }; +}; diff --git a/lib/v2/ncc-cma/maintainer.js b/lib/v2/ncc-cma/maintainer.js new file mode 100644 index 00000000000000..f3aa9916c1dc79 --- /dev/null +++ b/lib/v2/ncc-cma/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/cmdp/image/:id?': ['nczitzk'], +}; diff --git a/lib/v2/ncc-cma/radar.js b/lib/v2/ncc-cma/radar.js new file mode 100644 index 00000000000000..583e0e9d44a350 --- /dev/null +++ b/lib/v2/ncc-cma/radar.js @@ -0,0 +1,229 @@ +module.exports = { + 'ncc-cma.net': { + _name: '国家气候中心', + cmdp: [ + { + title: '中国气温 - 日平均气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/RPJQWQYZ', + }, + { + title: '中国气温 - 近5天平均气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ5TPJQWJP', + }, + { + title: '中国气温 - 近10天平均气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ10TQWJP', + }, + { + title: '中国气温 - 近20天平均气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ20TQWJP', + }, + { + title: '中国气温 - 近30天平均气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ30TQWJP', + }, + { + title: '中国气温 - 本月以来气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BYYLQWJP', + }, + { + title: '中国气温 - 本季以来气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BJYLQWJP', + }, + { + title: '中国气温 - 本年以来气温距平', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BNYLQWJP', + }, + { + title: '中国降水 - 日降水量分布', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/QGRJSLFBT0808S', + }, + { + title: '中国降水 - 近5天降水量', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ5TJSLFBT', + }, + { + title: '中国降水 - 近10天降水量', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ10TJSL', + }, + { + title: '中国降水 - 近20天降水量', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ20TJSL', + }, + { + title: '中国降水 - 近30天降水量', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ30TJSL', + }, + { + title: '中国降水 - 本月以来降水量', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BYYLJSL', + }, + { + title: '中国降水 - 本季以来降水量', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BJYLJSL', + }, + { + title: '中国降水 - 近10天降水量距平百分率', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ10TJSLJP', + }, + { + title: '中国降水 - 近20天降水量距平百分率', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ20TJSLJP', + }, + { + title: '中国降水 - 近30天降水量距平百分率', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/ZJ30TJSLJP', + }, + { + title: '中国降水 - 本月以来降水量距平百分率', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BYYLJSLJPZYQHZ', + }, + { + title: '中国降水 - 本季以来降水量距平百分率', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BJYLJSLJPZJQHZ', + }, + { + title: '中国降水 - 本年以来降水量距平百分率', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/BNYLJSLJP', + }, + { + title: '全球气温 - 气温距平(最近10天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmeana10_', + }, + { + title: '全球气温 - 气温距平(最近20天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmeana20_', + }, + { + title: '全球气温 - 气温距平(最近30天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmeana30_', + }, + { + title: '全球气温 - 气温距平(最近90天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmeana90_', + }, + { + title: '全球气温 - 最低气温距平(最近30天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmina30_', + }, + { + title: '全球气温 - 最低气温距平(最近90天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmina90_', + }, + { + title: '全球气温 - 最高气温距平(最近30天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmaxa30_', + }, + { + title: '全球气温 - 最高气温距平(最近90天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbtmaxa90_', + }, + { + title: '全球降水 - 降水量(最近10天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbrain10_', + }, + { + title: '全球降水 - 降水量(最近20天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbrain20_', + }, + { + title: '全球降水 - 降水量(最近30天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbrain30_', + }, + { + title: '全球降水 - 降水量(最近90天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbrain90_', + }, + { + title: '全球降水 - 降水距平百分率(最近10天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbraina10_', + }, + { + title: '全球降水 - 降水距平百分率(最近20天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbraina20_', + }, + { + title: '全球降水 - 降水距平百分率(最近30天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbraina30_', + }, + { + title: '全球降水 - 降水距平百分率(最近90天)', + docs: 'https://docs.rsshub.app/routes/forecast#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce', + source: ['/cn/index.htm'], + target: '/ncc-cma/cmdp/image/glbraina90_', + }, + ], + }, +}; diff --git a/lib/v2/ncc-cma/router.js b/lib/v2/ncc-cma/router.js new file mode 100644 index 00000000000000..d2be06c8b39a0a --- /dev/null +++ b/lib/v2/ncc-cma/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/cmdp/image/:id*', require('./cmdp')); +}; diff --git a/lib/v2/ncc-cma/templates/description.art b/lib/v2/ncc-cma/templates/description.art new file mode 100644 index 00000000000000..baa09169346de4 --- /dev/null +++ b/lib/v2/ncc-cma/templates/description.art @@ -0,0 +1,9 @@ +{{ if image?.src }} + <figure> + <img + {{ if image.alt }} + alt="{{ image.alt }}" + {{ /if }} + src="{{ image.src }}"> + </figure> +{{ /if }} \ No newline at end of file diff --git a/website/docs/routes/forecast.mdx b/website/docs/routes/forecast.mdx index bb8faf7362b34b..2f17b104edabbe 100644 --- a/website/docs/routes/forecast.mdx +++ b/website/docs/routes/forecast.mdx @@ -68,6 +68,77 @@ <Route author="Fatpandac" example="/gov/guangdong/tqyb/sncsyjxh" path="/gov/guangdong/tqyb/sncsyjxh" /> +## 国家气候中心 {#guo-jia-qi-hou-zhong-xin} + +### 最新监测 {#guo-jia-qi-hou-zhong-xin-zui-xin-jian-ce} + +<Route author="nczitzk" example="/ncc-cma/cmdp/image" path="/ncc-cma/cmdp/image" paramsDesc={['分类 id,见下表,默认为全部']} radar="1" supportBT="1"> + :::tip + 若订阅全部最新监测信息,此时路由为 [`/ncc-cma/cmdp/image`](https://rsshub.app/ncc-cma/cmdp/image)。 + + 若订阅中国气温 **日平均气温距平** 的最新监测信息,此时路由为 [`/ncc-cma/cmdp/image/RPJQWQYZ`](https://rsshub.app/ncc-cma/cmdp/image/RPJQWQYZ)。 + + 若订阅全球降水 **降水量(最近 10 天)** / **降水量(最近 10 天)** / **降水量(最近 10 天)** 的最新监测信息,此时路由为 [`/ncc-cma/cmdp/image/glbrain10_/glbrain20_/glbrain30_`](https://rsshub.app/ncc-cma/cmdp/image/glbrain10_/glbrain20_/glbrain30_)。 + ::: + + #### [中国气温](http://cmdp.ncc-cma.net/cn/index.htm) + + | 分类 | ID | + | -------------------- | ---------- | + | 日平均气温距平 | RPJQWQYZ | + | 近 5 天平均气温距平 | ZJ5TPJQWJP | + | 近 10 天平均气温距平 | ZJ10TQWJP | + | 近 20 天平均气温距平 | ZJ20TQWJP | + | 近 30 天平均气温距平 | ZJ30TQWJP | + | 本月以来气温距平 | BYYLQWJP | + | 本季以来气温距平 | BJYLQWJP | + | 本年以来气温距平 | BNYLQWJP | + + #### [中国降水](http://cmdp.ncc-cma.net/cn/index.htm) + + | 分类 | ID | + | ------------------------ | -------------- | + | 日降水量分布 | QGRJSLFBT0808S | + | 近 5 天降水量 | ZJ5TJSLFBT | + | 近 10 天降水量 | ZJ10TJSL | + | 近 20 天降水量 | ZJ20TJSL | + | 近 30 天降水量 | ZJ30TJSL | + | 本月以来降水量 | BYYLJSL | + | 本季以来降水量 | BJYLJSL | + | 近 10 天降水量距平百分率 | ZJ10TJSLJP | + | 近 20 天降水量距平百分率 | ZJ20TJSLJP | + | 近 30 天降水量距平百分率 | ZJ30TJSLJP | + | 本月以来降水量距平百分率 | BYYLJSLJPZYQHZ | + | 本季以来降水量距平百分率 | BJYLJSLJPZJQHZ | + | 本年以来降水量距平百分率 | BNYLJSLJP | + + #### [全球气温](http://cmdp.ncc-cma.net/cn/index.htm) + + | 分类 | ID | + | -------------------------- | ------------- | + | 气温距平(最近 10 天) | glbtmeana10\_ | + | 气温距平(最近 20 天) | glbtmeana20\_ | + | 气温距平(最近 30 天) | glbtmeana30\_ | + | 气温距平(最近 90 天) | glbtmeana90\_ | + | 最低气温距平(最近 30 天) | glbtmina30\_ | + | 最低气温距平(最近 90 天) | glbtmina90\_ | + | 最高气温距平(最近 30 天) | glbtmaxa30\_ | + | 最高气温距平(最近 90 天) | glbtmaxa90\_ | + + #### [全球降水](http://cmdp.ncc-cma.net/cn/index.htm) + + | 分类 | ID | + | ---------------------------- | ------------ | + | 降水量(最近 10 天) | glbrain10\_ | + | 降水量(最近 20 天) | glbrain20\_ | + | 降水量(最近 30 天) | glbrain30\_ | + | 降水量(最近 90 天) | glbrain90\_ | + | 降水距平百分率(最近 10 天) | glbraina10\_ | + | 降水距平百分率(最近 20 天) | glbraina20\_ | + | 降水距平百分率(最近 30 天) | glbraina30\_ | + | 降水距平百分率(最近 90 天) | glbraina90\_ | +</Route> + ## 国家突发事件预警信息发布网 {#guo-jia-tu-fa-shi-jian-yu-jing-xin-xi-fa-bu-wang} ### 当前生效预警 {#guo-jia-tu-fa-shi-jian-yu-jing-xin-xi-fa-bu-wang-dang-qian-sheng-xiao-yu-jing}
e37886529b4c754cdc0b43a518defb2eba141bea
2023-10-04 03:34:16
dependabot[bot]
chore(deps-dev): bump @types/supertest from 2.0.13 to 2.0.14 (#13460)
false
bump @types/supertest from 2.0.13 to 2.0.14 (#13460)
chore
diff --git a/package.json b/package.json index fbf141b5fbe57f..75720a96bfa00d 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "@types/request-promise-native": "1.0.19", "@types/require-all": "3.0.4", "@types/showdown": "2.0.2", - "@types/supertest": "2.0.13", + "@types/supertest": "2.0.14", "@types/tiny-async-pool": "2.0.0", "@types/tough-cookie": "4.0.3", "@vercel/nft": "0.24.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b2b5f539d55ca3..355162d1ec295b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -281,8 +281,8 @@ devDependencies: specifier: 2.0.2 version: 2.0.2 '@types/supertest': - specifier: 2.0.13 - version: 2.0.13 + specifier: 2.0.14 + version: 2.0.14 '@types/tiny-async-pool': specifier: 2.0.0 version: 2.0.0 @@ -1756,8 +1756,8 @@ packages: '@types/node': 20.5.6 dev: true - /@types/[email protected]: - resolution: {integrity: sha512-Vc/5/pRwSC055fU7Wu8erTj4gLpID9SdG2zRMuqaHLni3GTsrJ8gyB6MbFZZGLW6vQaGPhiUWRB6uWglv87MEg==} + /@types/[email protected]: + resolution: {integrity: sha512-Q900DeeHNFF3ZYYepf/EyJfZDA2JrnWLaSQ0YNV7+2GTo8IlJzauEnDGhya+hauncpBYTYGpVHwGdssJeAQ7eA==} dependencies: '@types/superagent': 4.1.18 dev: true
c5700979c3ac8f75b05d16870c13575d702de70e
2023-11-29 14:29:13
Fatpandac
docs: add new instances (#13911)
false
add new instances (#13911)
docs
diff --git a/website/src/components/InstanceList.tsx b/website/src/components/InstanceList.tsx index 6b35f9f1b4ef14..d481091b571390 100644 --- a/website/src/components/InstanceList.tsx +++ b/website/src/components/InstanceList.tsx @@ -24,6 +24,11 @@ export default function InstanceList(): JSX.Element { location: '🇺🇸', maintainer: 'Zeabur', maintainerUrl: 'https://zeabur.com', + }, { + url: 'https://rss.fatpandac.com', + location: '🇺🇸', + maintainer: 'Fatpandac', + maintainerUrl: 'https://fatpandac.com', }] return (
c8f182dc4c5278f0e272a669cef4ad4f26f7db9d
2024-11-07 20:53:21
Andvari
fix(route/caixin): filter out articles that does not have ID (#17495)
false
filter out articles that does not have ID (#17495)
fix
diff --git a/lib/routes/caixin/utils-fulltext.ts b/lib/routes/caixin/utils-fulltext.ts index dd41e12a36eece..1a8289049dda18 100644 --- a/lib/routes/caixin/utils-fulltext.ts +++ b/lib/routes/caixin/utils-fulltext.ts @@ -12,6 +12,10 @@ export async function getFulltext(url: string) { if (!config.caixin.cookie) { return; } + if (!/(\d+)\.html/.test(url)) { + return; + } + const articleID = url.match(/(\d+)\.html/)[1]; const nonce = crypto.randomUUID().replaceAll('-', '').toUpperCase(); @@ -20,7 +24,6 @@ export async function getFulltext(url: string) { .find((e) => e.includes('SA_USER_UID')) ?.split('=')[1]; // - const articleID = url.match(/(\d+)\.html/)[1]; const rawString = `id=${articleID}&uid=${userID}&${nonce}=nonce`; const sig = new KJUR.crypto.Signature({ alg: 'SHA256withRSA' });
8699b4c9d32f29ad9942f1de202531bb5fe49f9f
2023-04-20 07:02:13
Tony
fix(route): fix namespace mess from #4283 (#12353)
false
fix namespace mess from #4283 (#12353)
fix
diff --git a/docs/reading.md b/docs/reading.md index 86903b19ccd0ab..ec0f6895b7a591 100644 --- a/docs/reading.md +++ b/docs/reading.md @@ -323,7 +323,7 @@ For instance, when doing search at <https://magazinelib.com/> and you get url <h ### 单读 -<Route author="KeNorizon" example="/owspace/read/0" path="/owspace/read/:type?" :paramsDesc="['栏目分类,不填则默认为首页']"> +<Route author="imkero" example="/owspace/read/0" path="/owspace/read/:type?" :paramsDesc="['栏目分类,不填则默认为首页']"> | 首页 | 文字 | 影像 | 声音 | 单向历 | 谈论 | | ---- | ---- | ---- | ---- | ------ | ---- | diff --git a/docs/university.md b/docs/university.md index 2f768c0012a3d6..e3f2d521032358 100644 --- a/docs/university.md +++ b/docs/university.md @@ -252,15 +252,19 @@ pageClass: routes ### 教务处通知 -<Route author="sinofp" example="/bit/jwc" path="/bit/jwc" /> +<Route author="sinofp" example="/bit/jwc" path="/bit/jwc" radar="1"/> ### 计院通知 -<Route author="sinofp" example="/bit/cs" path="/bit/cs" /> +<Route author="sinofp" example="/bit/cs" path="/bit/cs" radar="1"/> ### 人才招聘 -<Route author="nczitzk" example="/bit/rszhaopin" path="/bit/rszhaopin" /> +<Route author="nczitzk" example="/bit/rszhaopin" path="/bit/rszhaopin" radar="1"/> + +### 研究生院招生信息 + +<Route author="shengmaosu" example="/bit/yjs" path="/bit/yjs" radar="1"/> ## 北京林业大学 @@ -1091,17 +1095,17 @@ pageClass: routes ## 广州大学 -## 广州大学研招网通知公告 +### 研究生院招生动态 -<Route author="shengmaosu" example="/gzyjs" path="/gzyjs" /> +<Route author="shengmaosu" example="/gzhu/yjs" path="/gzhu/yjs" radar="1" /> ## 广州航海学院 -## 广州航海学院教务处通知公告 +### 教务处通知公告 <Route author="skyedai910" example="/gzmtu/jwc" path="/gzmtu/jwc" /> -## 广州航海学院图书馆通知公告 +### 图书馆通知公告 <Route author="skyedai910" example="/gzmtu/tsg" path="/gzmtu/tsg" /> @@ -1484,17 +1488,17 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 研究生院 -<Route author="shengmaosu" example="/ecnuyjs" path="/ecnuyjs" /> +<Route author="shengmaosu" example="/ecnu/yjs" path="/ecnu/yjs" radar="1" /> ## 华南理工大学 ### 研究生院通知公告 -<Route author="shengmaosu" example="/scutyjs" path="/scutyjs" /> +<Route author="shengmaosu" example="/scut/yjs" path="/scut/yjs" radar="1" /> ### 教务处通知公告 -<Route author="KeNorizon" example="/scut/jwc/notice/all" path="/scut/jwc/notice/:category?" :paramsDesc="['通知分类,默认为 `all`']"> +<Route author="imkero" example="/scut/jwc/notice/all" path="/scut/jwc/notice/:category?" :paramsDesc="['通知分类,默认为 `all`']"> | 全部 | 选课 | 考试 | 实践 | 交流 | 教师 | 信息 | | ---- | ------ | ---- | -------- | ------------- | ------- | ---- | @@ -1504,7 +1508,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 教务处学院通知 -<Route author="KeNorizon Rongronggg9" example="/scut/jwc/school/all" path="/scut/jwc/school/:category?" :paramsDesc="['通知分类,默认为 `all`']"> +<Route author="imkero Rongronggg9" example="/scut/jwc/school/all" path="/scut/jwc/school/:category?" :paramsDesc="['通知分类,默认为 `all`']"> | 全部 | 选课 | 考试 | 信息 | | ---- | ------ | ---- | ---- | @@ -1514,79 +1518,85 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 教务处新闻动态 -<Route author="KeNorizon" example="/scut/jwc/news" path="/scut/jwc/news" /> +<Route author="imkero" example="/scut/jwc/news" path="/scut/jwc/news" /> ### 土木与交通学院 - 学工通知 -<Route author="railzy" example="/scut/scet/notice" path="/scut/scet/notice" /> +<Route author="railzy" example="/scut/scet/notice" path="/scut/scet/notice" radar="1" /> ### 电子与信息学院 - 新闻速递 -<Route author="auto-bot-ty" example="/scut/seie/news_center" path="/scut/seie/news_center" /> +<Route author="auto-bot-ty" example="/scut/seie/news_center" path="/scut/seie/news_center" radar="1" /> ::: warning 注意 由于学院官网对非大陆 IP 的访问存在限制,需自行部署。 ::: +## 华南农业大学 + +### 华农研讯 + +<Route author="shengmaosu" example="/scau/yzb" path="/scau/yzb" radar="1"/> + ## 华南师范大学 ### 软件学院通知公告 -<Route author="shengmaosu" example="/scnucs" path="/scnucs" /> +<Route author="shengmaosu" example="/scnu/ss" path="/scnu/ss" radar="1"/> ### 研究生院通知公告 -<Route author="shengmaosu" example="/scnuyjs" path="/scnuyjs" /> +<Route author="shengmaosu" example="/scnu/yjs" path="/scnu/yjs" radar="1"/> ### 教务处通知 -<Route author="fengkx" example="/scnu/jw" path="/scnu/jw"/> +<Route author="fengkx" example="/scnu/jw" path="/scnu/jw" radar="1"/> ### 图书馆通知 -<Route author="fengkx" example="/scnu/library" path="/scnu/library"/> +<Route author="fengkx" example="/scnu/library" path="/scnu/library" radar="1"/> ### 计算机学院竞赛通知 -<Route author="fengkx" example="/scnu/cs/match" path="/scnu/cs/match"/> +<Route author="fengkx" example="/scnu/cs/match" path="/scnu/cs/match" radar="1"/> ## 华中科技大学 -### 华中科技大学研究生院通知公告 +### 研究生院通知公告 -<Route author="shengmaosu" example="/hustyjs" path="/hustyjs" /> +<Route author="shengmaosu" example="/hust/yjs" path="/hust/yjs" radar="1"/> ### 人工智能和自动化学院通知 -<Route author="RayHY" example="/hust/aia/notice/0" path="/hust/aia/notice/:type?" :paramsDesc="['分区 type,默认为最新通知 可在网页 HTML中找到']"> +<Route author="budui" example="/hust/aia/notice" path="/hust/aia/notice/:type?" :paramsDesc="['分区,默认为最新通知,可在网页 URL 中找到']" radar="1"> -| 最新 | 行政 | 人事 | 科研 | 讲座 | 本科生 | 研究生 | 学工 | -| ---- | ---- | ---- | ---- | ---- | ------ | ------ | ---- | -| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +| 最新 | 党政 | 科研 | 本科生 | 研究生 | 学工思政 | 离退休 | +| ---- | ---- | ---- | ------ | ------ | -------- | ------ | +| | dz | ky | bk | yjs | xgsz | litui | </Route> ### 人工智能和自动化学院新闻 -<Route author="RayHY" example="/hust/aia/news" path="/hust/aia/news" /> +<Route author="budui" example="/hust/aia/news" path="/hust/aia/news" radar="1"/> ## 华中师范大学 -### 华中师范大学研究生通知公告 +### 研究生通知公告 -<Route author="shengmaosu" example="/ccnuyjs" path="/ccnuyjs" /> +<Route author="shengmaosu" example="/ccnu/yjs" path="/ccnu/yjs" radar="1"/> -### 华中师范大学计算机学院 +### 计算机学院 -<Route author="shengmaosu" example="/ccnucs" path="/ccnucs" /> +<Route author="shengmaosu" example="/ccnu/cs" path="/ccnu/cs" radar="1"/> -### 华中师范大学伍论贡学院 +### 伍论贡学院 -<Route author="shengmaosu" example="/ccnuwu" path="/ccnuwu" /> +<Route author="shengmaosu" example="/ccnu/wu" path="/ccnu/wu" radar="1"/> ### 就业信息 -<Route author="jackyu1996" example="/ccnu/career" path="/ccnu/career" /> +<Route author="jackyu1996" example="/ccnu/career" path="/ccnu/career" radar="1"/> ## 吉林大学 @@ -1791,17 +1801,17 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ## 南方科技大学 -### 南方科技大学研究生网通知公告 +### 研究生网通知公告 -<Route author="shengmaosu" example="/sustyjs" path="/sustyjs" /> +<Route author="shengmaosu" example="/sustech/yjs" path="/sustech/yjs" radar="1"/> -### 南方科技大学新闻网(中文) +### 新闻网(中文) -<Route author="sparkcyf" example="/sustech/newshub-zh" path="/sustech/newshub-zh" /> +<Route author="sparkcyf" example="/sustech/newshub-zh" path="/sustech/newshub-zh" radar="1"/> -### 南方科技大学采购与招标管理部 +### 采购与招标管理部 -<Route author="sparkcyf" example="/sustech/bidding" path="/sustech/bidding" /> +<Route author="sparkcyf" example="/sustech/bidding" path="/sustech/bidding" radar="1"/> ## 南京大学 @@ -2594,13 +2604,9 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ## 深圳大学 -### 深圳大学研究生招生网通知公告 - -<Route author="shengmaosu" example="/szuyjs" path="/szuyjs" /> - -### 深圳大学研究生招生网 +### 研究生招生网 -<Route author="NagaruZ" example="/szu/yz/1" path="/szu/yz/:type?" :paramsDesc="['默认为1']" > +<Route author="NagaruZ" example="/szu/yz/1" path="/szu/yz/:type?" :paramsDesc="['默认为 `1`']" radar="1"> | 研究生 | 博士生 | | ------ | ------ | @@ -2742,21 +2748,21 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ## 同济大学 -### 同济大学研究生院通知公告 +### 研究生院通知公告 -<Route author="shengmaosu" example="/tjuyjs" path="/tjuyjs" /> +<Route author="shengmaosu" example="/tongji/yjs" path="/tongji/yjs" radar="1"/> -### 同济大学软件学院通知 +### 软件学院通知 -<Route author="sgqy" example="/tju/sse/xwdt" path="/tju/sse/:type?" :paramsDesc="['通知类型. 默认为 `xwdt`']"> +<Route author="sgqy" example="/tongji/sse/xytz" path="/tongji/sse/:type?" :paramsDesc="['通知类型,默认为 `xytz`']" radar="1"> | 本科生通知 | 研究生通知 | 教工通知 | 全体通知 | 学院通知 | 学院新闻 | 学院活动 | | ---------- | ---------- | -------- | -------- | -------- | -------- | -------- | -| bkstz | yjstz | jgtz | qttz | xwdt | xyxw | xyhd | +| bkstz | yjstz | jgtz | qttz | xytz | xyxw | xyhd | -注意: `qttz` 与 `xwdt` 在原网站等价. +注意: `qttz` 与 `xytz` 在原网站等价. - </Route> +</Route> ## 潍坊学院 @@ -3445,11 +3451,11 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ## 中国传媒大学 -### 中国传媒大学研究生招生网 +### 研究生招生网 <Route author="YunYouJun niuyi1017" example="/cuc/yz" path="/cuc/yz" /> -## 中国地质大学 (武汉) +## 中国地质大学(武汉) ### 今日文章 - 包含全校网站最新通知 @@ -3479,7 +3485,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 信息科学与工程学院 -<Route author="Geo" example="/ouc/it/0" path="/ouc/it/:type?" :paramsDesc="['默认为 `0`']"> +<Route author="GeoffreyChen777" example="/ouc/it/0" path="/ouc/it/:type?" :paramsDesc="['默认为 `0`']" radar="1"> | 学院要闻 | 学院公告 | 学院活动 | | -------- | -------- | -------- | @@ -3487,13 +3493,13 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS </Route> -### 中国海洋大学研究生院 +### 研究生院 -<Route author="shengmaosu" example="/outyjs" path="/outyjs" /> +<Route author="shengmaosu" example="/ouc/yjs" path="/ouc/yjs" radar="1"/> -### 中国海洋大学信电学院通知公告 +### 信息科学与工程学院研究生招生通知公告 -<Route author="shengmaosu" example="/outele" path="/outele" /> +<Route author="shengmaosu" example="/ouc/it/postgraduate" path="/ouc/it/postgraduate" radar="1"/> ## 中国科学技术大学 @@ -3581,11 +3587,15 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS <Route author="nczitzk" example="/cas/iee/kydt" path="/cas/iee/kydt" radar="1"/> +### 自动化所 + +<Route author="shengmaosu" example="/cas/ia/yjs" path="/cas/ia/yjs" radar="1"/> + ## 中国科学院大学 ### 招聘信息 -<Route author="Fatpandac" example="/ucas/job" path="/ucas/job/:type?" :paramsDesc="['招聘类型,默认为博士后']"> +<Route author="Fatpandac" example="/ucas/job" path="/ucas/job/:type?" :paramsDesc="['招聘类型,默认为博士后']" radar="1"> | 招聘类型 | 博士后 | 课题项目聘用 | 管理支撑人才 | 教学科研人才 | | :------: | :----: | :----------: | :----------: | :----------: | @@ -3593,15 +3603,19 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS </Route> +### 人工智能学院 + +<Route author="shengmaosu" example="/ucas/ai" path="/ucas/ai" radar="1"/> + ## 中国农业大学 -### 中国农业大学研招网通知公告 +### 研招网通知公告 -<Route author="shengmaosu" example="/cauyjs" path="/cauyjs" /> +<Route author="shengmaosu" example="/cau/yjs" path="/cau/yjs" radar="1"/> -#### 中国农业大学信电学院 +#### 信电学院 -<Route author="shengmaosu" example="/cauele" path="/cauele" /> +<Route author="shengmaosu" example="/cau/ele" path="/cau/ele" radar="1"/> ## 中国人民大学 @@ -3621,13 +3635,13 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ## 中国石油大学(华东) -### 中国石油大学研究生院通知公告 +### 研究生院通知公告 -<Route author="shengmaosu" example="/upcyjs" path="/upcyjs" /> +<Route author="shengmaosu" example="/upc/yjs" path="/upc/yjs" radar="1"/> ### 主页 -<Route author="Veagau" example="/upc/main" path="/upc/main/:type" :paramsDesc="['分类,见下表']"> +<Route author="Veagau" example="/upc/main/notice" path="/upc/main/:type" :paramsDesc="['分类,见下表']" radar="1"> | 通知公告 | 学术动态 | | -------- | -------- | @@ -3637,7 +3651,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 计算机科学与技术学院 -<Route author="Veagau" example="/upc/jsj" path="/upc/jsj/:type" :paramsDesc="['分类,见下表']"> +<Route author="Veagau" example="/upc/jsj/news" path="/upc/jsj/:type" :paramsDesc="['分类,见下表']" radar="1"> | 学院新闻 | 学术关注 | 学工动态 | 通知公告 | | -------- | -------- | -------- | -------- | @@ -3657,16 +3671,6 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS </Route> -## 中科院 - -### 中科院自动化所 - -<Route author="shengmaosu" example="/zkyyjs" path="/zkyyjs" /> - -### 中科院人工智能所 - -<Route author="shengmaosu" example="/zkyai" path="/zkyai" /> - ## 中南财经政法大学 ### 通知公告 diff --git a/lib/router.js b/lib/router.js index b36bd1d487e216..6a287632eef334 100644 --- a/lib/router.js +++ b/lib/router.js @@ -495,8 +495,8 @@ router.get('/zdfx', lazyloadRouteHandler('./routes/galgame/zdfx')); // router.get('/bjfu/it/:type', lazyloadRouteHandler('./routes/universities/bjfu/it/index')); // 北京理工大学 -router.get('/bit/jwc', lazyloadRouteHandler('./routes/universities/bit/jwc/jwc')); -router.get('/bit/cs', lazyloadRouteHandler('./routes/universities/bit/cs/cs')); +// router.get('/bit/jwc', lazyloadRouteHandler('./routes/universities/bit/jwc/jwc')); +// router.get('/bit/cs', lazyloadRouteHandler('./routes/universities/bit/cs/cs')); // 北京交通大学 router.get('/bjtu/gs/:type', lazyloadRouteHandler('./routes/universities/bjtu/gs')); @@ -582,9 +582,9 @@ router.get('/swust/jwc/notice/:type?', lazyloadRouteHandler('./routes/universiti router.get('/swust/cs/:type?', lazyloadRouteHandler('./routes/universities/swust/cs')); // 华南师范大学 -router.get('/scnu/jw', lazyloadRouteHandler('./routes/universities/scnu/jw')); -router.get('/scnu/library', lazyloadRouteHandler('./routes/universities/scnu/library')); -router.get('/scnu/cs/match', lazyloadRouteHandler('./routes/universities/scnu/cs/match')); +// router.get('/scnu/jw', lazyloadRouteHandler('./routes/universities/scnu/jw')); +// router.get('/scnu/library', lazyloadRouteHandler('./routes/universities/scnu/library')); +// router.get('/scnu/cs/match', lazyloadRouteHandler('./routes/universities/scnu/cs/match')); // 广东工业大学 // router.get('/gdut/news', lazyloadRouteHandler('./routes/universities/gdut/news')); @@ -691,10 +691,10 @@ router.get('/whu/news/:type?', lazyloadRouteHandler('./routes/universities/whu/n // router.get('/wfu/jwc', require('./routes/universities/wfu/jwc')); // 华中科技大学 -router.get('/hust/auto/notice/:type?', lazyloadRouteHandler('./routes/universities/hust/aia/notice')); -router.get('/hust/auto/news', lazyloadRouteHandler('./routes/universities/hust/aia/news')); -router.get('/hust/aia/news', lazyloadRouteHandler('./routes/universities/hust/aia/news')); -router.get('/hust/aia/notice/:type?', lazyloadRouteHandler('./routes/universities/hust/aia/notice')); +// router.get('/hust/auto/notice/:type?', lazyloadRouteHandler('./routes/universities/hust/aia/notice')); +// router.get('/hust/auto/news', lazyloadRouteHandler('./routes/universities/hust/aia/news')); +// router.get('/hust/aia/news', lazyloadRouteHandler('./routes/universities/hust/aia/news')); +// router.get('/hust/aia/notice/:type?', lazyloadRouteHandler('./routes/universities/hust/aia/notice')); // 井冈山大学 router.get('/jgsu/jwc', lazyloadRouteHandler('./routes/universities/jgsu/jwc')); @@ -707,7 +707,7 @@ router.get('/jgsu/jwc', lazyloadRouteHandler('./routes/universities/jgsu/jwc')); // router.get('/sdu/epe/:type?', lazyloadRouteHandler('./routes/universities/sdu/epe')); // 中国海洋大学 -router.get('/ouc/it/:type?', lazyloadRouteHandler('./routes/universities/ouc/it')); +// router.get('/ouc/it/:type?', lazyloadRouteHandler('./routes/universities/ouc/it')); // 大连大学 router.get('/dlu/jiaowu/news', lazyloadRouteHandler('./routes/universities/dlu/jiaowu/news')); @@ -717,12 +717,12 @@ router.get('/dgut/jwc/:type?', lazyloadRouteHandler('./routes/universities/dgut/ router.get('/dgut/xsc/:type?', lazyloadRouteHandler('./routes/universities/dgut/xsc')); // 同济大学 -router.get('/tju/sse/:type?', lazyloadRouteHandler('./routes/universities/tju/sse/notice')); +// router.get('/tju/sse/:type?', lazyloadRouteHandler('./routes/universities/tju/sse/notice')); // 华南理工大学 -router.get('/scut/jwc/notice/:category?', lazyloadRouteHandler('./routes/universities/scut/jwc/notice')); -router.get('/scut/jwc/school/:category?', lazyloadRouteHandler('./routes/universities/scut/jwc/school')); -router.get('/scut/jwc/news', lazyloadRouteHandler('./routes/universities/scut/jwc/news')); +// router.get('/scut/jwc/notice/:category?', lazyloadRouteHandler('./routes/universities/scut/jwc/notice')); +// router.get('/scut/jwc/school/:category?', lazyloadRouteHandler('./routes/universities/scut/jwc/school')); +// router.get('/scut/jwc/news', lazyloadRouteHandler('./routes/universities/scut/jwc/news')); // 温州商学院 router.get('/wzbc/:type?', lazyloadRouteHandler('./routes/universities/wzbc/news')); @@ -751,11 +751,11 @@ router.get('/shu/jwc/:type?', lazyloadRouteHandler('./routes/universities/shu/jw router.get('/ustb/tj/news/:type?', lazyloadRouteHandler('./routes/universities/ustb/tj/news')); // 深圳大学 -router.get('/szu/yz/:type?', lazyloadRouteHandler('./routes/universities/szu/yz')); +// router.get('/szu/yz/:type?', lazyloadRouteHandler('./routes/universities/szu/yz')); // 中国石油大学(华东) -router.get('/upc/main/:type?', lazyloadRouteHandler('./routes/universities/upc/main')); -router.get('/upc/jsj/:type?', lazyloadRouteHandler('./routes/universities/upc/jsj')); +// router.get('/upc/main/:type?', lazyloadRouteHandler('./routes/universities/upc/main')); +// router.get('/upc/jsj/:type?', lazyloadRouteHandler('./routes/universities/upc/jsj')); // 华北水利水电大学 // router.get('/ncwu/notice', lazyloadRouteHandler('./routes/universities/ncwu/notice')); @@ -1460,7 +1460,7 @@ router.get('/zucc/news/latest', lazyloadRouteHandler('./routes/universities/zucc router.get('/zucc/cssearch/latest/:webVpn/:key', lazyloadRouteHandler('./routes/universities/zucc/cssearch')); // 华中师范大学 -router.get('/ccnu/career', lazyloadRouteHandler('./routes/universities/ccnu/career')); +// router.get('/ccnu/career', lazyloadRouteHandler('./routes/universities/ccnu/career')); // Infoq // router.get('/infoq/recommend', lazyloadRouteHandler('./routes/infoq/recommend')); @@ -2521,32 +2521,32 @@ router.get('/guat/news/:type?', lazyloadRouteHandler('./routes/guat/news')); // router.get('/neea/:type', lazyloadRouteHandler('./routes/neea')); // 中国农业大学 -router.get('/cauyjs', lazyloadRouteHandler('./routes/universities/cauyjs/cauyjs')); +// router.get('/cauyjs', lazyloadRouteHandler('./routes/universities/cauyjs/cauyjs')); // 南方科技大学 -router.get('/sustyjs', lazyloadRouteHandler('./routes/universities/sustyjs/sustyjs')); -router.get('/sustech/newshub-zh', lazyloadRouteHandler('./routes/universities/sustech/newshub-zh')); -router.get('/sustech/bidding', lazyloadRouteHandler('./routes/universities/sustech/bidding')); +// router.get('/sustyjs', lazyloadRouteHandler('./routes/universities/sustyjs/sustyjs')); +// router.get('/sustech/newshub-zh', lazyloadRouteHandler('./routes/universities/sustech/newshub-zh')); +// router.get('/sustech/bidding', lazyloadRouteHandler('./routes/universities/sustech/bidding')); // 广州航海学院 router.get('/gzmtu/jwc', lazyloadRouteHandler('./routes/universities/gzmtu/jwc')); router.get('/gzmtu/tsg', lazyloadRouteHandler('./routes/universities/gzmtu/tsg')); // 广州大学 -router.get('/gzyjs', lazyloadRouteHandler('./routes/universities/gzyjs/gzyjs')); +// router.get('/gzyjs', lazyloadRouteHandler('./routes/universities/gzyjs/gzyjs')); // 暨南大学 router.get('/jnu/xysx/:type', lazyloadRouteHandler('./routes/universities/jnu/xysx/index')); router.get('/jnu/yw/:type?', lazyloadRouteHandler('./routes/universities/jnu/yw/index')); // 深圳大学 -router.get('/szuyjs', lazyloadRouteHandler('./routes/universities/szuyjs/szuyjs')); +// router.get('/szuyjs', lazyloadRouteHandler('./routes/universities/szuyjs/szuyjs')); // 中国传媒大学 -router.get('/cucyjs', lazyloadRouteHandler('./routes/universities/cucyjs/cucyjs')); +// router.get('/cucyjs', lazyloadRouteHandler('./routes/universities/cucyjs/cucyjs')); // 中国农业大学信电学院 -router.get('/cauele', lazyloadRouteHandler('./routes/universities/cauyjs/cauyjs')); +// router.get('/cauele', lazyloadRouteHandler('./routes/universities/cauyjs/cauyjs')); // moxingfans router.get('/moxingfans', lazyloadRouteHandler('./routes/moxingfans')); @@ -2558,22 +2558,22 @@ router.get('/chiphell/forum/:forumId?', lazyloadRouteHandler('./routes/chiphell/ // router.get('/ecustyjs', lazyloadRouteHandler('./routes/universities/ecustyjs/ecustyjs')); // 同济大学研究生院 -router.get('/tjuyjs', lazyloadRouteHandler('./routes/universities/tjuyjs/tjuyjs')); +// router.get('/tjuyjs', lazyloadRouteHandler('./routes/universities/tjuyjs/tjuyjs')); // 中国石油大学研究生院 -router.get('/upcyjs', lazyloadRouteHandler('./routes/universities/upcyjs/upcyjs')); +// router.get('/upcyjs', lazyloadRouteHandler('./routes/universities/upcyjs/upcyjs')); // 中国海洋大学研究生院 -router.get('/outyjs', lazyloadRouteHandler('./routes/universities/outyjs/outyjs')); +// router.get('/outyjs', lazyloadRouteHandler('./routes/universities/outyjs/outyjs')); // 中科院人工智能所 -router.get('/zkyai', lazyloadRouteHandler('./routes/universities/zkyai/zkyai')); +// router.get('/zkyai', lazyloadRouteHandler('./routes/universities/zkyai/zkyai')); // 中科院自动化所 -router.get('/zkyyjs', lazyloadRouteHandler('./routes/universities/zkyyjs/zkyyjs')); +// router.get('/zkyyjs', lazyloadRouteHandler('./routes/universities/zkyyjs/zkyyjs')); // 中国海洋大学信电学院 -router.get('/outele', lazyloadRouteHandler('./routes/universities/outele/outele')); +// router.get('/outele', lazyloadRouteHandler('./routes/universities/outele/outele')); // 华东师范大学研究生院 migrated to v2 // router.get('/ecnuyjs', lazyloadRouteHandler('./routes/universities/ecnuyjs/ecnuyjs')); @@ -2582,16 +2582,16 @@ router.get('/outele', lazyloadRouteHandler('./routes/universities/outele/outele' router.get('/kaoyan', lazyloadRouteHandler('./routes/kaoyan/kaoyan')); // 华中科技大学研究生院 -router.get('/hustyjs', lazyloadRouteHandler('./routes/universities/hustyjs/hustyjs')); +// router.get('/hustyjs', lazyloadRouteHandler('./routes/universities/hustyjs/hustyjs')); // 华中师范大学研究生院 -router.get('/ccnuyjs', lazyloadRouteHandler('./routes/universities/ccnu/ccnuyjs')); +// router.get('/ccnuyjs', lazyloadRouteHandler('./routes/universities/ccnu/ccnuyjs')); // 华中师范大学计算机学院 -router.get('/ccnucs', lazyloadRouteHandler('./routes/universities/ccnu/ccnucs')); +// router.get('/ccnucs', lazyloadRouteHandler('./routes/universities/ccnu/ccnucs')); // 华中师范大学伍论贡学院 -router.get('/ccnuwu', lazyloadRouteHandler('./routes/universities/ccnu/ccnuwu')); +// router.get('/ccnuwu', lazyloadRouteHandler('./routes/universities/ccnu/ccnuwu')); // WEEX router.get('/weexcn/news/:typeid', lazyloadRouteHandler('./routes/weexcn/index')); @@ -2604,22 +2604,22 @@ router.get('/weexcn/news/:typeid', lazyloadRouteHandler('./routes/weexcn/index') // router.get('/ssmh/category/:cid', lazyloadRouteHandler('./routes/ssmh/category')); // 华南师范大学研究生学院 -router.get('/scnuyjs', lazyloadRouteHandler('./routes/universities/scnu/scnuyjs')); +// router.get('/scnuyjs', lazyloadRouteHandler('./routes/universities/scnu/scnuyjs')); // 华南师范大学软件学院 -router.get('/scnucs', lazyloadRouteHandler('./routes/universities/scnu/scnucs')); +// router.get('/scnucs', lazyloadRouteHandler('./routes/universities/scnu/scnucs')); // 华南理工大学研究生院 -router.get('/scutyjs', lazyloadRouteHandler('./routes/universities/scut/scutyjs')); +// router.get('/scutyjs', lazyloadRouteHandler('./routes/universities/scut/scutyjs')); // 华南农业大学研究生院通知公告 -router.get('/scauyjs', lazyloadRouteHandler('./routes/universities/scauyjs/scauyjs')); +// router.get('/scauyjs', lazyloadRouteHandler('./routes/universities/scauyjs/scauyjs')); // 北京大学研究生招生网通知公告 migrated to v2 // router.get('/pkuyjs', lazyloadRouteHandler('./routes/universities/pku/pkuyjs')); // 北京理工大学研究生通知公告 -router.get('/bityjs', lazyloadRouteHandler('./routes/universities/bit/bityjs')); +// router.get('/bityjs', lazyloadRouteHandler('./routes/universities/bit/bityjs')); // 湖南科技大学教务处 router.get('/hnust/jwc', lazyloadRouteHandler('./routes/universities/hnust/jwc/index')); @@ -3028,10 +3028,10 @@ router.get('/hfut/tzgg', lazyloadRouteHandler('./routes/universities/hfut/tzgg') // router.get('/scvtc/xygg', lazyloadRouteHandler('./routes/universities/scvtc/xygg')); // 华南理工大学土木与交通学院 -router.get('/scut/scet/notice', lazyloadRouteHandler('./routes/universities/scut/scet/notice')); +// router.get('/scut/scet/notice', lazyloadRouteHandler('./routes/universities/scut/scet/notice')); // 华南理工大学电子与信息学院 -router.get('/scut/seie/news_center', lazyloadRouteHandler('./routes/universities/scut/seie/news_center')); +// router.get('/scut/seie/news_center', lazyloadRouteHandler('./routes/universities/scut/seie/news_center')); // OneJAV router.get('/onejav/:type/:key?', lazyloadRouteHandler('./routes/onejav/one')); diff --git a/lib/routes/universities/bit/bityjs.js b/lib/routes/universities/bit/bityjs.js deleted file mode 100644 index 66e568722917d6..00000000000000 --- a/lib/routes/universities/bit/bityjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://grd.bit.edu.cn/zsgz/zsxx/index.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.tongzhigonggao li').slice(0, 10); - - ctx.state.data = { - title: '北京理工大学研究生院', - link, - description: '北京理工大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/bit/cs/utils.js b/lib/routes/universities/bit/cs/utils.js deleted file mode 100644 index bfeb216d63dd3c..00000000000000 --- a/lib/routes/universities/bit/cs/utils.js +++ /dev/null @@ -1,73 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const url = require('url'); - -// 专门定义一个function用于加载文章内容 -async function load(link) { - // 异步请求文章 - const response = await got.get(link, { - https: { - rejectUnauthorized: false, - }, - }); - // 加载文章内容 - const $ = cheerio.load(response.data); - - // 提取作者 - const zuozhe = $('.zuozhe').children().next(); - const author = zuozhe.first().text(); - - // 解析日期 - const date = new Date( - zuozhe - .next() - .next() - .first() - .text() - .replace(/[^\d]/g, '-') - .match(/\d{4}-\d{2}-\d{2}/) - ); - const timeZone = 8; - const serverOffset = date.getTimezoneOffset() / 60; - const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString(); - - // 提取内容 - const description = $('.wz_art').html(); - - // 返回解析的结果 - return { author, description, pubDate }; -} - -const ProcessFeed = (list, caches) => { - const host = 'http://cs.bit.edu.cn/tzgg/'; - - return Promise.all( - // 遍历每一篇文章 - list.map(async (item) => { - const $ = cheerio.load(item); - - const $title = $('a'); - // 还原相对链接为绝对链接 - const itemUrl = url.resolve(host, $title.attr('href')); - - // 列表上提取到的信息 - const single = { - title: $title.text(), - link: itemUrl, - // author: '教务部', - guid: itemUrl, - }; - - // 使用tryGet方法从缓存获取内容。 - // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。 - const other = await caches.tryGet(itemUrl, () => load(itemUrl)); - - // 合并解析后的结果集作为该篇文章最终的输出结果 - return Promise.resolve(Object.assign({}, single, other)); - }) - ); -}; - -module.exports = { - ProcessFeed, -}; diff --git a/lib/routes/universities/bit/jwc/utils.js b/lib/routes/universities/bit/jwc/utils.js deleted file mode 100644 index 1b86027c507ac0..00000000000000 --- a/lib/routes/universities/bit/jwc/utils.js +++ /dev/null @@ -1,65 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const url = require('url'); - -// 专门定义一个function用于加载文章内容 -async function load(link) { - // 异步请求文章 - const response = await got.get(link, { - https: { - rejectUnauthorized: false, - }, - }); - // 加载文章内容 - const $ = cheerio.load(response.data); - - // 解析日期 - const date = new Date( - $('.aca_author span') - .text() - .match(/\d{4}-\d{2}-\d{2}/) - ); - const timeZone = 8; - const serverOffset = date.getTimezoneOffset() / 60; - const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString(); - - // 提取内容 - const description = $('.aca_article_con').html(); - - // 返回解析的结果 - return { description, pubDate }; -} - -const ProcessFeed = (list, caches) => { - const host = 'http://jwc.bit.edu.cn/tzgg/'; - - return Promise.all( - // 遍历每一篇文章 - list.map(async (item) => { - const $ = cheerio.load(item); - - const $title = $('a'); - // 还原相对链接为绝对链接 - const itemUrl = url.resolve(host, $title.attr('href')); - - // 列表上提取到的信息 - const single = { - title: $title.text(), - link: itemUrl, - author: '教务部', - guid: itemUrl, - }; - - // 使用tryGet方法从缓存获取内容。 - // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。 - const other = await caches.tryGet(itemUrl, () => load(itemUrl)); - - // 合并解析后的结果集作为该篇文章最终的输出结果 - return Promise.resolve(Object.assign({}, single, other)); - }) - ); -}; - -module.exports = { - ProcessFeed, -}; diff --git a/lib/routes/universities/cauele/cauele.js b/lib/routes/universities/cauele/cauele.js deleted file mode 100644 index d580667b6ef05c..00000000000000 --- a/lib/routes/universities/cauele/cauele.js +++ /dev/null @@ -1,24 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://ciee.cau.edu.cn/col/col26712/index.html'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.info-content li').slice(0, 10); - - ctx.state.data = { - title: '中国农业大学信电学院', - link, - description: '中国农业大学信电学院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/cauyjs/cauyjs.js b/lib/routes/universities/cauyjs/cauyjs.js deleted file mode 100644 index fe625f4b9df77f..00000000000000 --- a/lib/routes/universities/cauyjs/cauyjs.js +++ /dev/null @@ -1,24 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://yz.cau.edu.cn/infoArticleList.do?sortColumn=publicationDate&pagingNumberPer=20&columnId=10423&sortDirection=-1&pagingPage=2&'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.articleList ul li').slice(0, 10); - - ctx.state.data = { - title: '中农研究生学院', - link, - description: '中农研究生学院', - item: - list && - list - .map((index, item) => { - item = $(item); - - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/ccnu/career.js b/lib/routes/universities/ccnu/career.js deleted file mode 100644 index ec75a88e62dfc1..00000000000000 --- a/lib/routes/universities/ccnu/career.js +++ /dev/null @@ -1,43 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const host = 'http://career.ccnu.edu.cn'; - const targetSel = "a[href^='/Schedule/ScheduleDetail/'], a[href^='/Schedule/ZWSSHDetail/']"; - - const response = await got(host); - - const $ = cheerio.load(response.data); - const list = $(targetSel); - - const items = - list && - list - .map((index, item) => { - item = $(item); - - const title = item.attr('title') || item.find('font').text(); - - const timeELe = item.find('span'); - - // 照顾周五双选会的时间 - let time = timeELe.children().length === 2 ? timeELe.text().trim().slice(2) + '/' + timeELe.text().trim().slice(0, 2) : timeELe.text(); - - time = new Date(`${time.replace(/\//g, '-')}T00:00+08:00`); - - return { - title, - // 今天之后的日期写在 description 中,pubDate 写今天 - description: `${time.toLocaleDateString('zh-CN')} - ${title}`, - pubDate: time > new Date() ? new Date(new Date().setHours(0, 0, 0, 0)).toUTCString() : time.toUTCString(), - link: `${host}${item.attr('href')}`, - }; - }) - .get(); - - ctx.state.data = { - title: '华中师范大学就业信息', - link: host, - item: items, - }; -}; diff --git a/lib/routes/universities/ccnu/ccnucs.js b/lib/routes/universities/ccnu/ccnucs.js deleted file mode 100644 index 7ac54aa4103f6c..00000000000000 --- a/lib/routes/universities/ccnu/ccnucs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://cs.ccnu.edu.cn/xygk/xytg.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.NewsList li ').slice(0, 10); - - ctx.state.data = { - title: '华中师范大学计算机学院', - link, - description: '华中师范大学计算机学院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('lI A').text(), description: item.find('lI A').text(), link: item.find('lI A').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/ccnu/ccnuwu.js b/lib/routes/universities/ccnu/ccnuwu.js deleted file mode 100644 index bfacb6e5ecb472..00000000000000 --- a/lib/routes/universities/ccnu/ccnuwu.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://uowji.ccnu.edu.cn/tzgg.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.zy-mainxrx li ').slice(0, 10); - - ctx.state.data = { - title: '华中师范大学伍论贡学院', - link, - description: '华中师范大学伍论贡学院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('lI A').text(), description: item.find('lI A').text(), link: item.find('lI A').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/ccnu/ccnuyjs.js b/lib/routes/universities/ccnu/ccnuyjs.js deleted file mode 100644 index 0529b79762d509..00000000000000 --- a/lib/routes/universities/ccnu/ccnuyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://gs.ccnu.edu.cn/zsgz/ssyjs.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.main-zyrx li ').slice(0, 10); - - ctx.state.data = { - title: '华中师范大学研究生院', - link, - description: '华中师范大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('lI A').text(), description: item.find('lI A').text(), link: item.find('lI A').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/cucyjs/cucyjs.js b/lib/routes/universities/cucyjs/cucyjs.js deleted file mode 100644 index d0154b108f7e49..00000000000000 --- a/lib/routes/universities/cucyjs/cucyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://yz.cuc.edu.cn/listWYFHY/list_0_1.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data, 'utf-8'); - const list = $('.notice_main_content2 td').slice(0, 10); - - ctx.state.data = { - title: '中国传媒大学', - link, - description: '中国传媒大学研招网通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('td a').text(), description: item.find('td a').text(), link: item.find('td a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/gzyjs/gzyjs.js b/lib/routes/universities/gzyjs/gzyjs.js deleted file mode 100644 index 70857568940264..00000000000000 --- a/lib/routes/universities/gzyjs/gzyjs.js +++ /dev/null @@ -1,24 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://yjsy.gzhu.edu.cn/zsxx/zsdt/zsdt.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.picnews_cont li').slice(0, 10); - - ctx.state.data = { - title: '广州大学研究生院', - link, - description: '广州大学研招网通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/hust/aia/news.js b/lib/routes/universities/hust/aia/news.js deleted file mode 100755 index af6888b09a0818..00000000000000 --- a/lib/routes/universities/hust/aia/news.js +++ /dev/null @@ -1,32 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const url = require('url').resolve; - -module.exports = async (ctx) => { - const link = 'http://aia.hust.edu.cn/yxxw.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.N02_list li dl').slice(0, 10); - - ctx.state.data = { - title: '华科人工智能和自动化学院新闻', - link, - description: '华科人工智能和自动化学院新闻', - item: - list && - list - .map((index, item) => { - item = $(item); - const day = item.find('.N02_list_Icon i').text(); - item.find('.N02_list_Icon').find('i').remove(); - const year_month = item.find('.N02_list_Icon').text(); - return { - title: item.find('h4 a').text(), - description: item.find('dd p').text() || '华科人工智能和自动化学院新闻', - pubDate: new Date(year_month + ' ' + day).toUTCString(), - link: url(link, item.find('h4 a').attr('href')), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/hust/aia/notice.js b/lib/routes/universities/hust/aia/notice.js deleted file mode 100755 index ed1f882da8f0b6..00000000000000 --- a/lib/routes/universities/hust/aia/notice.js +++ /dev/null @@ -1,35 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const url = require('url').resolve; - -const typelist = ['最新', '行政', '人事', '科研', '讲座', '本科生', '研究生', '学工']; - -module.exports = async (ctx) => { - const type = parseInt(ctx.params.type) || 0; - const link = 'http://aia.hust.edu.cn/'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.m_content .m_con').eq(type).find('.N02_list_dl').slice(0, 10); - - ctx.state.data = { - title: `华科人工智能和自动化学院${typelist[type]}通知`, - link, - description: `华科人工智能和自动化学院${typelist[type]}通知`, - item: - list && - list - .map((index, item) => { - item = $(item); - const day = item.find('.N02_list_Icon i').text(); - item.find('.N02_list_Icon').find('i').remove(); - const year_month = item.find('.N02_list_Icon').text(); - return { - title: item.find('h4 a').text(), - description: item.find('dd p').text() || `华科人工智能和自动化学院${typelist[type]}通知`, - pubDate: new Date(year_month + ' ' + day).toUTCString(), - link: url(link, item.find('h4 a').attr('href')), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/hustyjs/hustyjs.js b/lib/routes/universities/hustyjs/hustyjs.js deleted file mode 100644 index 671caa01b7bc15..00000000000000 --- a/lib/routes/universities/hustyjs/hustyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://gszs.hust.edu.cn/zsxx/ggtz.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.main_conRCb li').slice(0, 10); - - ctx.state.data = { - title: '华中科技大学研究生院', - link, - description: '华中科技大学研究生调剂信息', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/ouc/it.js b/lib/routes/universities/ouc/it.js deleted file mode 100644 index 7bab3a73825bc1..00000000000000 --- a/lib/routes/universities/ouc/it.js +++ /dev/null @@ -1,52 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const url = require('url'); - -const host = 'https://it.ouc.edu.cn/'; -const typelist = ['学院要闻', '学院公告', '学术活动']; -const urlList = ['xyyw/list.psp', 'xygg/list.psp', 'xshd/list.psp']; - -module.exports = async (ctx) => { - const type = parseInt(ctx.params.type) || 0; - const link = url.resolve(host, urlList[type]); - const response = await got.get(link); - const $ = cheerio.load(response.data); - - const dateDict = {}; - const list = $('#wp_news_w33') - .find('li') - .slice(0, 9) - .map((i, e) => { - const divs = $(e).children(); - const tlink = host + divs.find('a')[0].attribs.href.substring(1); - dateDict[tlink] = new Date($($(divs.children()[0]).find('p')[0]).text()).toUTCString(); - return tlink; - }) - .get(); - const out = await Promise.all( - list.map(async (itemUrl) => { - const cache = await ctx.cache.get(itemUrl); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - const response = await got.get(itemUrl); - const $ = cheerio.load(response.data); - - const single = { - title: $('.content-tittle').text().trim(), - author: '中国海洋大学信息科学与工程学院', - description: $('.wp_articlecontent').html(), - pubDate: dateDict[itemUrl], - link: itemUrl, - }; - ctx.cache.set(itemUrl, JSON.stringify(single)); - return Promise.resolve(single); - }) - ); - - ctx.state.data = { - title: `中国海洋大学信息科学与工程学院${typelist[type]}`, - link, - item: out, - }; -}; diff --git a/lib/routes/universities/outele/outele.js b/lib/routes/universities/outele/outele.js deleted file mode 100644 index a7dbedd8e21bb8..00000000000000 --- a/lib/routes/universities/outele/outele.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://it.ouc.edu.cn/_s381/16619/list.psp'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.common-lists li').slice(0, 10); - - ctx.state.data = { - title: '中国海洋大学信电学院', - link, - description: '中国海洋大学信电学院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/outyjs/outyjs.js b/lib/routes/universities/outyjs/outyjs.js deleted file mode 100644 index 35fd47ce6ccc88..00000000000000 --- a/lib/routes/universities/outyjs/outyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://yz.ouc.edu.cn/5926/list.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.wp_article_list li').slice(0, 10); - - ctx.state.data = { - title: '中国海洋大学研究生院', - link, - description: '中国海洋大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scauyjs/scauyjs.js b/lib/routes/universities/scauyjs/scauyjs.js deleted file mode 100644 index b8cccf4dc9e433..00000000000000 --- a/lib/routes/universities/scauyjs/scauyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'https://yzb.scau.edu.cn/2136/list1.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('#wp_news_w25 tr').slice(0, 10); - - ctx.state.data = { - title: '华南农业大学研究生院', - link, - description: '华南农业大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('tr a').text(), description: item.find('tr a').text(), link: item.find('tr a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scnu/cs/match.js b/lib/routes/universities/scnu/cs/match.js deleted file mode 100644 index 29498b14ea1b5c..00000000000000 --- a/lib/routes/universities/scnu/cs/match.js +++ /dev/null @@ -1,35 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const res = await got({ - method: 'get', - url: 'https://cs.scnu.edu.cn/xueshenggongzuo/chengchangfazhan/kejichuangxin/', - headers: { - Referer: 'https://cs.scnu.edu.cn', - }, - }); - const $ = cheerio.load(res.data); - const list = $('.listshow').find('li').not('li.line'); - - ctx.state.data = { - title: $('title').text(), - link: 'https://cs.scnu.edu.cn/xueshenggongzuo/chengchangfazhan/kejichuangxin/', - description: '华南师范大学计算机学院 学科竞赛', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: item - .find('a') - .text() - .replace(/\d{4}-\d{2}-\d{2}/, ''), - pubDate: new Date(item.find('.r').text()).toUTCString(), - link: item.find('a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scnu/jw.js b/lib/routes/universities/scnu/jw.js deleted file mode 100644 index 90b28204517097..00000000000000 --- a/lib/routes/universities/scnu/jw.js +++ /dev/null @@ -1,32 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const res = await got({ - method: 'get', - url: 'https://jw.scnu.edu.cn/ann/index.html', - headers: { - Referer: 'https://jw.scnu.edu.cn', - }, - }); - const $ = cheerio.load(res.data); - const list = $('.notice_01').find('li').slice(0, 10); - - ctx.state.data = { - title: $('title').first().text(), - link: 'https://jw.scnu.edu.cn/ann/index.html', - description: '华南师范大学教务处 - 通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: item.find('a').text(), - pubDate: new Date(item.find('.time').text()).toUTCString(), - link: item.find('a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scnu/library.js b/lib/routes/universities/scnu/library.js deleted file mode 100644 index d7bd94530104bb..00000000000000 --- a/lib/routes/universities/scnu/library.js +++ /dev/null @@ -1,32 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const res = await got({ - method: 'get', - url: 'https://lib.scnu.edu.cn/news/zuixingonggao', - headers: { - Referer: 'https://lib.scnu.edu.cn', - }, - }); - const $ = cheerio.load(res.data); - const list = $('.article-list').find('li').slice(0, 10); - - ctx.state.data = { - title: $('title').text(), - link: 'https://lib.scnu.edu.cn/news/zuixingonggao', - description: '华南师范大学图书馆 - 通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: item.find('a').text(), - pubDate: new Date(item.find('.clock').text()).toUTCString(), - link: item.find('a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scnu/scnucs.js b/lib/routes/universities/scnu/scnucs.js deleted file mode 100644 index 1b495db703b7a4..00000000000000 --- a/lib/routes/universities/scnu/scnucs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://ss.scnu.edu.cn/tongzhigonggao/'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.listshow li').slice(0, 10); - - ctx.state.data = { - title: '华南师范大学软件学院', - link, - description: '华南师范大学软件学院', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scut/scet/notice.js b/lib/routes/universities/scut/scet/notice.js deleted file mode 100644 index 2aab32e4a7c34f..00000000000000 --- a/lib/routes/universities/scut/scet/notice.js +++ /dev/null @@ -1,32 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'http://www2.scut.edu.cn/jtxs/24241/list.htm', - }); - - const data = response.data; - - const $ = cheerio.load(data); - const list = $('#wp_news_w5 li'); - - ctx.state.data = { - title: '华南理工大学土木与交通学院 - 学工通知', - link: 'http://www2.scut.edu.cn/jtxs/24241/list.htm', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: item.find('li a').text(), - description: item.find('li a').text(), - link: item.find('li a').attr('href'), - pubDate: item.find('.Article_PublishDate').text(), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/scut/scutyjs.js b/lib/routes/universities/scut/scutyjs.js deleted file mode 100644 index 3b1cef29da334b..00000000000000 --- a/lib/routes/universities/scut/scutyjs.js +++ /dev/null @@ -1,28 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://admission.scut.edu.cn/17700/list.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.wp_article_list li').slice(0, 10); - - ctx.state.data = { - title: '华南理工大学研究生院', - link, - description: '华南理工大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: item.find('li a').text(), - description: item.find('li a').text(), - link: item.find('li a').attr('href'), - pubDate: item.find('.Article_PublishDate').text(), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/sustech/bidding.js b/lib/routes/universities/sustech/bidding.js deleted file mode 100644 index 2d4e74396bdef3..00000000000000 --- a/lib/routes/universities/sustech/bidding.js +++ /dev/null @@ -1,34 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'http://biddingoffice.sustech.edu.cn/', - }); - - const data = response.data; - - const $ = cheerio.load(data); - - const list = $('.index-wrap.index-2 ul li'); - - ctx.state.data = { - title: '南方科技大学采购与招标管理部', - link: 'http://biddingoffice.sustech.edu.cn/', - item: - list && - list - .map((index, item) => { - item = $(item); - const itemPubdate = item.find('li > span').text(); - return { - pubDate: itemPubdate, - title: item.find('li > a').text(), - description: item.find('li > a').text(), - link: item.find('li > a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/sustech/newshub-zh.js b/lib/routes/universities/sustech/newshub-zh.js deleted file mode 100644 index 4f705abaa4beb9..00000000000000 --- a/lib/routes/universities/sustech/newshub-zh.js +++ /dev/null @@ -1,35 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'https://newshub.sustech.edu.cn/zh/news/', - }); - - const data = response.data; - - const $ = cheerio.load(data); - - const list = $('.m-newslist ul li'); - - ctx.state.data = { - title: '南方科技大学新闻网-中文', - link: 'https://newshub.sustech.edu.cn/zh/news/', - item: - list && - list - .map((index, item) => { - item = $(item); - const itemPicUrl = String(item.find('a > div.u-pic').attr('style')).replace('background-image:url(', 'https://newshub.sustech.edu.cn/').replace(');', ''); - const itemPubdate = item.find('a > div.u-date').text(); - return { - pubDate: itemPubdate, - title: item.find('a > div.u-text > div.title.f-clamp').text(), - description: `<img src="${itemPicUrl}" class="type:primaryImage" ><br>${item.find('a > div.u-text > div.details.f-clamp4 > p').text()}`, - link: item.find('a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/sustyjs/sustyjs.js b/lib/routes/universities/sustyjs/sustyjs.js deleted file mode 100644 index 376a36829139fd..00000000000000 --- a/lib/routes/universities/sustyjs/sustyjs.js +++ /dev/null @@ -1,24 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'https://gs.sustech.edu.cn/tonggao/p/1'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.block02 ul li').slice(0, 10); - - ctx.state.data = { - title: '南方科技大学研究生院', - link, - description: '南方科技大学研招网通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/szuyjs/szuyjs.js b/lib/routes/universities/szuyjs/szuyjs.js deleted file mode 100644 index ceb76e2bede5fd..00000000000000 --- a/lib/routes/universities/szuyjs/szuyjs.js +++ /dev/null @@ -1,24 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'https://yz.szu.edu.cn/sszs/gg.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.list li').slice(0, 10); - - ctx.state.data = { - title: '深圳大学', - link, - description: '深圳大学研招网通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - - return { title: item.find('li A').text(), description: item.find('li A').text(), link: item.find('li A').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/tju/sse/_article.js b/lib/routes/universities/tju/sse/_article.js deleted file mode 100644 index bf29e5719387a7..00000000000000 --- a/lib/routes/universities/tju/sse/_article.js +++ /dev/null @@ -1,34 +0,0 @@ -const got = require('@/utils/got'); // get web content -const cheerio = require('cheerio'); // html parser - -const domain = 'http://sse.tongji.edu.cn'; - -module.exports = async function get_article(url) { - if (/^\/.*$/.test(url)) { - url = domain + url; - } - const response = await got({ - method: 'get', - url, - }); - const data = response.data; - - const $ = cheerio.load(data); - const title = $('div.view-title').text(); - const pub_date_raw = $('div.view-info').text(); - const pub_date_parse = /\d{2,4}-\d{1,2}-\d{1,2}/.exec(pub_date_raw); - const pub_date = new Date(pub_date_parse[0]).toUTCString(); - const content = $('div.view-cnt') - .html() - .replace(/<!\[CDATA\[/g, '<!--') - .replace(/\]\]>/g, '-->') - .replace(/href="\//g, 'href="' + domain + '/'); - - const item = { - title, - pubDate: pub_date, - link: url, - description: content, - }; - return item; -}; diff --git a/lib/routes/universities/tju/sse/notice.js b/lib/routes/universities/tju/sse/notice.js deleted file mode 100644 index 93053cd19306d3..00000000000000 --- a/lib/routes/universities/tju/sse/notice.js +++ /dev/null @@ -1,41 +0,0 @@ -// Warning: The author still knows nothing about javascript! - -// params: -// type: notification type - -const got = require('@/utils/got'); // get web content -const cheerio = require('cheerio'); // html parser -const get_article = require('./_article'); - -const base_url = 'http://sse.tongji.edu.cn/data/list/$type$'; -module.exports = async (ctx) => { - const type = ctx.params.type || 'xwdt'; - - const list_url = base_url.replace('$type$', type); - const response = await got({ - method: 'get', - url: list_url, - }); - const data = response.data; // content is html format - const $ = cheerio.load(data); - - // get urls - const detail_urls = []; - - const a = $('ul.data-list').find('a').slice(0, 10); - - for (let i = 0; i < a.length; ++i) { - const tmp = $(a[i]).attr('href'); - detail_urls.push(tmp); - } - - // get articles - const article_list = await Promise.all(detail_urls.map((url) => get_article(url))); - - // feed the data - ctx.state.data = { - title: '同济大学软件学院', - link: list_url, - item: article_list, - }; -}; diff --git a/lib/routes/universities/tjuyjs/tjuyjs.js b/lib/routes/universities/tjuyjs/tjuyjs.js deleted file mode 100644 index c7268abe2e480e..00000000000000 --- a/lib/routes/universities/tjuyjs/tjuyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://yz.tongji.edu.cn/zsxw/ggtz.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.list_main_content li').slice(0, 10); - - ctx.state.data = { - title: '同济大学研究生院', - link, - description: '同济大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/upc/jsj.js b/lib/routes/universities/upc/jsj.js deleted file mode 100644 index 6c9796f808b436..00000000000000 --- a/lib/routes/universities/upc/jsj.js +++ /dev/null @@ -1,81 +0,0 @@ -// 计算机科学与技术学院:http://computer.upc.edu.cn/ -// - 学院新闻:http://computer.upc.edu.cn/6277/list.htm -// - 学术关注:http://computer.upc.edu.cn/6278/list.htm -// - 学工动态:http://computer.upc.edu.cn/6279/list.htm -// - 通知公告:http://computer.upc.edu.cn/6280/list.htm - -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const baseurl = 'http://computer.upc.edu.cn/'; -// 地址映射 -const MAP = { - news: '6277', - scholar: '6278', - states: '6279', - notice: '6280', -}; -// 头部信息 -const HEAD = { - news: '学院新闻', - scholar: '学术关注', - states: '学工动态', - notice: '通知公告', -}; - -module.exports = async (ctx) => { - const type = ctx.params.type; - const response = await got({ - method: 'get', - url: baseurl + MAP[type] + '/list.htm', - }); - const $ = cheerio.load(response.data); - // ## 获取列表 - const list = $('#wp_news_w15 > table > tbody > tr > td > table > tbody > tr > td > a').get(); - // ## 定义输出的item - const out = await Promise.all( - // ### 遍历列表,筛选出自己想要的内容 - list.map(async (item) => { - const itemSingle = cheerio.load(item); - const title = itemSingle.text(); - const re = /<a[^>]*href=['"]([^"]*)['"][^>]*>(.*?)<\/a>/g; - let singleUrl = ''; - if (re.exec(itemSingle.html()) !== null) { - singleUrl = RegExp.$1; - } - if (singleUrl.search('http') === -1) { - singleUrl = baseurl + singleUrl; - } - const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息 - // ### 判断缓存是否存在,如果存在即跳过此次获取的信息 - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - // 获取详情页面的介绍 - const detail_response = await got({ - method: 'get', - url: singleUrl, - }); - const $ = cheerio.load(detail_response.data); - const detail_content = $('div.contain > div.main > div.right_cont > article').html(); - // ### 设置 RSS feed item - const single = { - title, - link: singleUrl, - // author, - description: detail_content, - // pubDate: updateDate, - }; - // // ### 设置缓存 - ctx.cache.set(singleUrl, JSON.stringify(single)); - return Promise.resolve(single); - // } - }) - ); - - ctx.state.data = { - title: HEAD[type] + `-计算机科学与技术学院`, - link: baseurl + MAP[type] + '.htm', - description: HEAD[type] + `-计算机科学与技术学院`, - item: out, - }; -}; diff --git a/lib/routes/universities/upc/main.js b/lib/routes/universities/upc/main.js deleted file mode 100644 index ee745ff7e32efc..00000000000000 --- a/lib/routes/universities/upc/main.js +++ /dev/null @@ -1,72 +0,0 @@ -// 学校官网:http://www.upc.edu.cn/ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const baseurl = 'http://news.upc.edu.cn/'; -// 地址映射 -const MAP = { - notice: 'tzgg', - scholar: 'xsdt', -}; -// 头部信息 -const HEAD = { - notice: '通知公告', - scholar: '学术动态', -}; - -module.exports = async (ctx) => { - const type = ctx.params.type; - const response = await got({ - method: 'get', - url: baseurl + MAP[type] + '.htm', - }); - const $ = cheerio.load(response.data); - // ## 获取列表 - const list = $('div.container > div.main-ny > div.main-ny-cont > div.main-ny-cont-box > div.main-list-box > div.main-list-box-left > ul > li > div.li-right > div.li-right-bt > a').get(); - // ## 定义输出的item - const out = await Promise.all( - // ### 遍历列表,筛选出自己想要的内容 - list.map(async (item) => { - const itemSingle = cheerio.load(item); - const title = itemSingle.text(); - const re = /<a[^>]*href=['"]([^"]*)['"][^>]*>(.*?)<\/a>/g; - let singleUrl = ''; - if (re.exec(itemSingle.html()) !== null) { - singleUrl = RegExp.$1; - } - if (singleUrl.search('http') === -1) { - singleUrl = `http://news.upc.edu.cn/` + singleUrl; - } - const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息 - // ### 判断缓存是否存在,如果存在即跳过此次获取的信息 - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - // 获取详情页面的介绍 - const detail_response = await got({ - method: 'get', - url: singleUrl, - }); - const $ = cheerio.load(detail_response.data); - const detail_content = $('div.container > div.main-ny > div.main-ny-cont > div.main-ny-cont-box > div.main-content-box > form').html(); - // ### 设置 RSS feed item - const single = { - title, - link: singleUrl, - // author, - description: detail_content, - // pubDate: updateDate, - }; - // // ### 设置缓存 - ctx.cache.set(singleUrl, JSON.stringify(single)); - return Promise.resolve(single); - // } - }) - ); - - ctx.state.data = { - title: HEAD[type] + `-中国石油大学(华东)`, - link: baseurl + MAP[type] + '.htm', - description: HEAD[type] + `-中国石油大学(华东)`, - item: out, - }; -}; diff --git a/lib/routes/universities/upcyjs/upcyjs.js b/lib/routes/universities/upcyjs/upcyjs.js deleted file mode 100644 index c24316bd7c6249..00000000000000 --- a/lib/routes/universities/upcyjs/upcyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://zs.gs.upc.edu.cn/sszs/list.htm'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.list tr').slice(0, 10); - - ctx.state.data = { - title: '中国石油大学研究生院', - link, - description: '中国石油大学研究生院通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('tr a').text(), description: item.find('tr a').text(), link: item.find('tr a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/zkyai/zkyai.js b/lib/routes/universities/zkyai/zkyai.js deleted file mode 100644 index 0f8cbdfa2d360b..00000000000000 --- a/lib/routes/universities/zkyai/zkyai.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'https://ai.ucas.ac.cn/index.php/zh-cn/tzgg'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.b-list li').slice(0, 10); - - ctx.state.data = { - title: '中科院人工智能所', - link, - description: '中科院人工智能通知公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/bit/cs/cs.js b/lib/v2/bit/cs/cs.js similarity index 69% rename from lib/routes/universities/bit/cs/cs.js rename to lib/v2/bit/cs/cs.js index ab923eb31e3415..23b45fbb530955 100644 --- a/lib/routes/universities/bit/cs/cs.js +++ b/lib/v2/bit/cs/cs.js @@ -3,23 +3,21 @@ const cheerio = require('cheerio'); const util = require('./utils'); module.exports = async (ctx) => { + const link = 'https://cs.bit.edu.cn/tzgg/'; const response = await got({ method: 'get', - url: 'http://cs.bit.edu.cn/tzgg', - https: { - rejectUnauthorized: false, - }, + url: link, }); const $ = cheerio.load(response.data); - const list = $('.box_list01 li').slice(0, 10).get(); + const list = $('.box_list01 li').toArray(); const result = await util.ProcessFeed(list, ctx.cache); ctx.state.data = { title: $('title').text(), - link: 'http://cs.bit.edu.cn/tzgg', + link, description: $('meta[name="description"]').attr('content'), item: result, }; diff --git a/lib/v2/bit/cs/utils.js b/lib/v2/bit/cs/utils.js new file mode 100644 index 00000000000000..df40bde5443531 --- /dev/null +++ b/lib/v2/bit/cs/utils.js @@ -0,0 +1,53 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); + +// 专门定义一个function用于加载文章内容 +async function load(item) { + // 异步请求文章 + const response = await got(item.link); + // 加载文章内容 + const $ = cheerio.load(response.data); + + // 提取作者 + const zuozhe = $('.zuozhe').children().next(); + item.author = zuozhe.first().text(); + + // 提取内容 + item.description = $('.wz_art').html(); + + // 返回解析的结果 + return item; +} + +const ProcessFeed = (list, caches) => { + const host = 'https://cs.bit.edu.cn/tzgg/'; + + return Promise.all( + // 遍历每一篇文章 + list.map((item) => { + const $ = cheerio.load(item); + + const $title = $('a'); + // 还原相对链接为绝对链接 + const itemUrl = new URL($title.attr('href'), host).href; + + // 列表上提取到的信息 + const single = { + title: $title.text(), + link: itemUrl, + // author: '教务部', + pubDate: timezone(parseDate($('span').text()), 8), + }; + + // 使用tryGet方法从缓存获取内容。 + // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。 + return caches.tryGet(single.link, () => load(single)); + }) + ); +}; + +module.exports = { + ProcessFeed, +}; diff --git a/lib/routes/universities/bit/jwc/jwc.js b/lib/v2/bit/jwc/jwc.js similarity index 68% rename from lib/routes/universities/bit/jwc/jwc.js rename to lib/v2/bit/jwc/jwc.js index 52859cfe6f7c7a..176f9154989c92 100644 --- a/lib/routes/universities/bit/jwc/jwc.js +++ b/lib/v2/bit/jwc/jwc.js @@ -3,23 +3,21 @@ const cheerio = require('cheerio'); const util = require('./utils'); module.exports = async (ctx) => { + const link = 'https://jwc.bit.edu.cn/tzgg/'; const response = await got({ method: 'get', - url: 'http://jwc.bit.edu.cn/tzgg', - https: { - rejectUnauthorized: false, - }, + url: link, }); const $ = cheerio.load(response.data); - const list = $('.crules div').slice(0, 10).get(); + const list = $('li.gpTextArea').toArray(); const result = await util.ProcessFeed(list, ctx.cache); ctx.state.data = { title: $('title').text(), - link: 'http://jwc.bit.edu.cn/tzgg', + link, description: '北京理工大学教务部', item: result, }; diff --git a/lib/v2/bit/jwc/utils.js b/lib/v2/bit/jwc/utils.js new file mode 100644 index 00000000000000..4cd762be6a168f --- /dev/null +++ b/lib/v2/bit/jwc/utils.js @@ -0,0 +1,49 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); + +// 专门定义一个function用于加载文章内容 +async function load(item) { + // 异步请求文章 + const response = await got(item.link); + // 加载文章内容 + const $ = cheerio.load(response.data); + + // 提取内容 + item.description = $('.gp-article').html(); + + // 返回解析的结果 + return item; +} + +const ProcessFeed = (list, caches) => { + const host = 'https://jwc.bit.edu.cn/tzgg/'; + + return Promise.all( + // 遍历每一篇文章 + list.map((item) => { + const $ = cheerio.load(item); + + const $title = $('a'); + // 还原相对链接为绝对链接 + const itemUrl = new URL($title.attr('href'), host).href; + + // 列表上提取到的信息 + const single = { + title: $title.text(), + link: itemUrl, + author: '教务部', + pubDate: timezone(parseDate($('span').text()), 8), + }; + + // 使用tryGet方法从缓存获取内容。 + // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。 + return caches.tryGet(single.link, () => load(single)); + }) + ); +}; + +module.exports = { + ProcessFeed, +}; diff --git a/lib/v2/bit/maintainer.js b/lib/v2/bit/maintainer.js index 9dd417bee93a00..f033852ac4818b 100644 --- a/lib/v2/bit/maintainer.js +++ b/lib/v2/bit/maintainer.js @@ -1,3 +1,6 @@ module.exports = { + '/cs': ['sinofp'], + '/jwc': ['sinofp'], '/rszhaopin': ['nczitzk'], + '/yjs': ['shengmaosu'], }; diff --git a/lib/v2/bit/radar.js b/lib/v2/bit/radar.js index 0d73faa9af48c9..8e917f8d366307 100644 --- a/lib/v2/bit/radar.js +++ b/lib/v2/bit/radar.js @@ -1,12 +1,36 @@ module.exports = { 'bit.edu.cn': { _name: '北京理工大学', + cs: [ + { + title: '计院通知', + docs: 'https://docs.rsshub.app/university.html#bei-jing-li-gong-da-xue', + source: ['/tzgg', '/'], + target: '/bit/cs', + }, + ], + grd: [ + { + title: '研究生院招生信息', + docs: 'https://docs.rsshub.app/university.html#bei-jing-li-gong-da-xue', + source: ['/zsgz/zsxx/index.htm', '/'], + target: '/bit/yjs', + }, + ], + jwc: [ + { + title: '教务处通知', + docs: 'https://docs.rsshub.app/university.html#bei-jing-li-gong-da-xue', + source: ['/tzgg', '/'], + target: '/bit/jwc', + }, + ], rszhaopin: [ { title: '人才招聘', docs: 'https://docs.rsshub.app/university.html#bei-jing-li-gong-da-xue-ren-cai-zhao-pin', source: ['/'], - target: '/bit/:category?', + target: '/bit/rszhaopin', }, ], }, diff --git a/lib/v2/bit/router.js b/lib/v2/bit/router.js index 8b006ea98e7323..512df27d6ddc52 100644 --- a/lib/v2/bit/router.js +++ b/lib/v2/bit/router.js @@ -1,3 +1,6 @@ module.exports = function (router) { + router.get('/cs', require('./cs/cs')); + router.get('/jwc', require('./jwc/jwc')); router.get('/rszhaopin', require('./rszhaopin')); + router.get('/yjs', require('./yjs')); }; diff --git a/lib/v2/bit/yjs.js b/lib/v2/bit/yjs.js new file mode 100644 index 00000000000000..70f14f8e4a3c7d --- /dev/null +++ b/lib/v2/bit/yjs.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://grd.bit.edu.cn/zsgz/zsxx/index.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.tongzhigonggao li'); + + ctx.state.data = { + title: '北京理工大学研究生院', + link, + description: '北京理工大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('span').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/routes/universities/zkyyjs/zkyyjs.js b/lib/v2/cas/ia/yjs.js similarity index 50% rename from lib/routes/universities/zkyyjs/zkyyjs.js rename to lib/v2/cas/ia/yjs.js index bcf146e0af8bc3..2c62156034e721 100644 --- a/lib/routes/universities/zkyyjs/zkyyjs.js +++ b/lib/v2/cas/ia/yjs.js @@ -3,9 +3,9 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const link = 'http://www.ia.cas.cn/yjsjy/zs/sszs/'; - const response = await got.get(link); + const response = await got(link); const $ = cheerio.load(response.data); - const list = $('.col-md-9 li').slice(0, 10); + const list = $('.col-md-9 li'); ctx.state.data = { title: '中科院自动化所', @@ -13,11 +13,13 @@ module.exports = async (ctx) => { description: '中科院自动化所通知公告', item: list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), + list.toArray().map((item) => { + item = $(item); + return { + title: item.find('li a').text(), + description: item.find('li a').text(), + link: item.find('li a').attr('href'), + }; + }), }; }; diff --git a/lib/v2/cas/maintainer.js b/lib/v2/cas/maintainer.js index 36fd4aabd1e18c..ca5f4fef71071b 100644 --- a/lib/v2/cas/maintainer.js +++ b/lib/v2/cas/maintainer.js @@ -1,5 +1,6 @@ module.exports = { '/cg/:caty?': ['nczitzk'], + '/ia/yjs': ['shengmaosu'], '/iee/kydt': ['nczitzk'], '/mesalab/kb': ['renzhexigua'], '/sim/kyjz': ['HenryQW'], diff --git a/lib/v2/cas/radar.js b/lib/v2/cas/radar.js index 7602dcfd2009b5..5f849361cebd5b 100644 --- a/lib/v2/cas/radar.js +++ b/lib/v2/cas/radar.js @@ -9,11 +9,19 @@ module.exports = { target: '/cas/cg/:caty?', }, ], + 'www.ia': [ + { + title: '自动化所', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-ke-xue-yuan', + source: ['/yjsjy/zs/sszs', '/'], + target: '/cas/ia/yjs', + }, + ], 'www.sim': [ { title: '上海微系统与信息技术研究所 - 科技进展', docs: 'https://docs.rsshub.app/university.html#zhong-guo-ke-xue-yuan', - source: ['/xwzx2016/kyjz/', '/'], + source: ['/xwzx2016/kyjz', '/'], target: '/cas/sim/kyjz', }, ], diff --git a/lib/v2/cas/router.js b/lib/v2/cas/router.js index 61e4f597f99012..adf2c80e0961fe 100644 --- a/lib/v2/cas/router.js +++ b/lib/v2/cas/router.js @@ -1,5 +1,6 @@ module.exports = (router) => { router.get('/cg/:caty?', require('./cg/index')); + router.get('/ia/yjs', require('./ia/yjs')); router.get('/iee/kydt', require('./iee/kydt')); router.get('/mesalab/kb', require('./mesalab/kb')); router.get('/sim/kyjz', require('./sim/kyjz')); diff --git a/lib/v2/cau/ele.js b/lib/v2/cau/ele.js new file mode 100644 index 00000000000000..8bc1e2645a7b01 --- /dev/null +++ b/lib/v2/cau/ele.js @@ -0,0 +1,42 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://ciee.cau.edu.cn'; + const link = `${baseUrl}/col/col26712/index.html`; + const response = await got(`${baseUrl}/module/web/jpage/dataproxy.jsp`, { + searchParams: { + page: 1, + appid: 1, + webid: 107, + path: '/', + columnid: 26712, + unitid: 38467, + webname: '信息与电气工程学院', + permissiontype: 0, + }, + }); + const $ = cheerio.load(response.data); + const list = $('recordset record'); + + ctx.state.data = { + title: '中国农业大学信电学院', + link, + description: '中国农业大学信电学院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + const title = a.attr('title'); + const link = `${baseUrl}${a.attr('href')}`; + return { + title, + link, + pubDate: parseDate(item.find('.col-lg-1').text()), + guid: `${link}#${title}`, + }; + }), + }; +}; diff --git a/lib/v2/cau/maintainer.js b/lib/v2/cau/maintainer.js new file mode 100644 index 00000000000000..116cde86fffa1b --- /dev/null +++ b/lib/v2/cau/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/ele': ['shengmaosu'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/cau/radar.js b/lib/v2/cau/radar.js new file mode 100644 index 00000000000000..7c700d573451fb --- /dev/null +++ b/lib/v2/cau/radar.js @@ -0,0 +1,21 @@ +module.exports = { + 'cau.edu.cn': { + _name: '中国农业大学', + ciee: [ + { + title: '信息与电气工程学院', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-nong-ye-da-xue', + source: ['/col/col26712/index.html', '/'], + target: '/cau/ele', + }, + ], + yz: [ + { + title: '研招网通知公告', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-nong-ye-da-xue', + source: ['/col/col41740/index.html', '/'], + target: '/cau/yjs', + }, + ], + }, +}; diff --git a/lib/v2/cau/router.js b/lib/v2/cau/router.js new file mode 100644 index 00000000000000..0c39d6f213fa04 --- /dev/null +++ b/lib/v2/cau/router.js @@ -0,0 +1,4 @@ +module.exports = (router) => { + router.get('/ele', require('./ele')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/cau/yjs.js b/lib/v2/cau/yjs.js new file mode 100644 index 00000000000000..c7aeb9652caa19 --- /dev/null +++ b/lib/v2/cau/yjs.js @@ -0,0 +1,42 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://yz.cau.edu.cn'; + const link = `${baseUrl}/col/col41740/index.html`; + const response = await got(`${baseUrl}/module/web/jpage/dataproxy.jsp`, { + searchParams: { + page: 1, + appid: 1, + webid: 146, + path: '/', + columnid: 41740, + unitid: 69493, + webname: '中国农业大学研究生院', + permissiontype: 0, + }, + }); + const $ = cheerio.load(response.data); + const list = $('recordset record'); + + ctx.state.data = { + title: '中农研究生学院', + link, + description: '中农研究生学院', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a + .contents() + .filter((_, node) => node.type === 'text') + .text(), + link: `${baseUrl}${a.attr('href')}`, + pubDate: parseDate(item.find('span').text().replace(/[[\]]/g, '')), + }; + }), + }; +}; diff --git a/lib/v2/ccnu/career.js b/lib/v2/ccnu/career.js new file mode 100644 index 00000000000000..ebb8ba9cb82c5c --- /dev/null +++ b/lib/v2/ccnu/career.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const host = 'https://ccnu.91wllm.com'; + const link = `${host}/news/index/tag/tzgg`; + + const response = await got(link); + + const $ = cheerio.load(response.data); + const list = $('.newsList'); + + const items = + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + pubDate: parseDate(item.find('.y').text(), 'YYYY-MM-DD'), + link: `${host}${a.attr('href')}`, + }; + }); + + ctx.state.data = { + title: '华中师范大学就业信息', + link, + item: items, + }; +}; diff --git a/lib/v2/ccnu/cs.js b/lib/v2/ccnu/cs.js new file mode 100644 index 00000000000000..db24020c651d34 --- /dev/null +++ b/lib/v2/ccnu/cs.js @@ -0,0 +1,28 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'http://cs.ccnu.edu.cn/xwzx/tzgg.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.list_box_07 li'); + + ctx.state.data = { + title: '华中师范大学计算机学院', + link, + description: '华中师范大学计算机学院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.attr('title'), + description: item.find('.overfloat-dot-2').text(), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('.time').text(), 'DDYYYY-MM'), + }; + }), + }; +}; diff --git a/lib/v2/ccnu/maintainer.js b/lib/v2/ccnu/maintainer.js new file mode 100644 index 00000000000000..3b95dc782a5990 --- /dev/null +++ b/lib/v2/ccnu/maintainer.js @@ -0,0 +1,6 @@ +module.exports = { + '/career': ['jackyu1996'], + '/cs': ['shengmaosu'], + '/wu': ['shengmaosu'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/ccnu/radar.js b/lib/v2/ccnu/radar.js new file mode 100644 index 00000000000000..0cbe54237d093d --- /dev/null +++ b/lib/v2/ccnu/radar.js @@ -0,0 +1,40 @@ +module.exports = { + '91wllm.com': { + _name: '湖北高校就业网络联盟', + ccnu: [ + { + title: '华中师范大学就业信息', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-shi-fan-da-xue', + source: ['/news/index/tag/tzgg', '/'], + target: '/ccnu/career', + }, + ], + }, + 'ccnu.edu.cn': { + _name: '华中师范大学', + cs: [ + { + title: '计算机学院', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-shi-fan-da-xue', + source: ['/xwzx/tzgg.htm', '/'], + target: '/ccnu/cs', + }, + ], + gs: [ + { + title: '研究生通知公告', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-shi-fan-da-xue', + source: ['/zsgz/ssyjs.htm', '/'], + target: '/ccnu/yjs', + }, + ], + uowji: [ + { + title: '伍论贡学院', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-shi-fan-da-xue', + source: ['/xwzx/tzgg.htm', '/'], + target: '/ccnu/wu', + }, + ], + }, +}; diff --git a/lib/v2/ccnu/router.js b/lib/v2/ccnu/router.js new file mode 100644 index 00000000000000..41b9929b5c5ad6 --- /dev/null +++ b/lib/v2/ccnu/router.js @@ -0,0 +1,6 @@ +module.exports = (router) => { + router.get('/career', require('./career')); + router.get('/cs', require('./cs')); + router.get('/wu', require('./wu')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/ccnu/wu.js b/lib/v2/ccnu/wu.js new file mode 100644 index 00000000000000..a84491a5f0e8cd --- /dev/null +++ b/lib/v2/ccnu/wu.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'http://uowji.ccnu.edu.cn/tzgg.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.zy-mainxrx li'); + + ctx.state.data = { + title: '华中师范大学伍论贡学院', + link, + description: '华中师范大学伍论贡学院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('small').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/ccnu/yjs.js b/lib/v2/ccnu/yjs.js new file mode 100644 index 00000000000000..9062bebd240fb9 --- /dev/null +++ b/lib/v2/ccnu/yjs.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'http://gs.ccnu.edu.cn/zsgz/ssyjs.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.main-zyrx li'); + + ctx.state.data = { + title: '华中师范大学研究生院', + link, + description: '华中师范大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.attr('title'), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('small').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/cuc/radar.js b/lib/v2/cuc/radar.js index 57e7e9088a4c6f..33a7e89463333f 100644 --- a/lib/v2/cuc/radar.js +++ b/lib/v2/cuc/radar.js @@ -5,8 +5,8 @@ module.exports = { { title: '研究生招生网', docs: 'https://docs.rsshub.app/university.html#zhong-guo-chuan-mei-da-xue', - source: '/*', - target: '/', + source: ['/8549/list.htm', '/'], + target: '/cuc/yz', }, ], }, diff --git a/lib/v2/cuc/yz.js b/lib/v2/cuc/yz.js index 00bd8d3470dfbc..d3d27e0ace991b 100644 --- a/lib/v2/cuc/yz.js +++ b/lib/v2/cuc/yz.js @@ -1,36 +1,32 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const iconv = require('iconv-lite'); - -const host = 'http://yz.cuc.edu.cn/'; +const { parseDate } = require('@/utils/parse-date'); /* 研究生招生网通知公告*/ module.exports = async (ctx) => { + const host = 'https://yz.cuc.edu.cn'; + const link = `${host}/8549/list.htm`; const response = await got({ method: 'get', - url: host, - responseType: 'buffer', + url: link, }); + const $ = cheerio.load(response.data); - const responseHtml = iconv.decode(response.data, 'gbk'); - const $ = cheerio.load(responseHtml); - - const notice = $('#notice_area').children('.notice_block_top'); - const content = notice.children('.notice_content1').children('p'); - const items = content - .map((_, elem) => { - const a = $('a', elem); - return { - link: new URL(a.attr('href'), host).href, - title: a.text(), - }; - }) - .get(); + const content = $('.news_list li'); + const items = content.toArray().map((elem) => { + elem = $(elem); + const a = elem.find('a'); + return { + link: new URL(a.attr('href'), host).href, + title: a.attr('title'), + pubDate: parseDate(elem.find('.news_meta').text(), 'YYYY-MM-DD'), + }; + }); ctx.state.data = { title: $('title').text(), - link: host, + link, description: '中国传媒大学研究生招生网 通知公告', item: items, }; diff --git a/lib/v2/gzhu/maintainer.js b/lib/v2/gzhu/maintainer.js new file mode 100644 index 00000000000000..0c5cafcc6140bb --- /dev/null +++ b/lib/v2/gzhu/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/gzhu/radar.js b/lib/v2/gzhu/radar.js new file mode 100644 index 00000000000000..b17741403f2524 --- /dev/null +++ b/lib/v2/gzhu/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'gzhu.edu.cn': { + _name: '广州大学', + yjsy: [ + { + title: '研究生院招生动态', + docs: 'https://docs.rsshub.app/university.html#guang-zhou-da-xue', + source: ['/zsxx/zsdt/zsdt.htm', '/'], + target: '/gzhu/yjs', + }, + ], + }, +}; diff --git a/lib/v2/gzhu/router.js b/lib/v2/gzhu/router.js new file mode 100644 index 00000000000000..fb3bdecd6a07ff --- /dev/null +++ b/lib/v2/gzhu/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/gzhu/yjs.js b/lib/v2/gzhu/yjs.js new file mode 100644 index 00000000000000..df9412ca15e22f --- /dev/null +++ b/lib/v2/gzhu/yjs.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://yjsy.gzhu.edu.cn/zsxx/zsdt/zsdt.htm'; + const response = await got(link, { + https: { + rejectUnauthorized: false, + }, + }); + const $ = cheerio.load(response.data); + const list = $('.picnews_cont li'); + + ctx.state.data = { + title: '广州大学研究生院', + link, + description: '广州大学研招网通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('span a'); + return { + title: a.attr('title'), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(a.text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/hust/aia/news.js b/lib/v2/hust/aia/news.js new file mode 100755 index 00000000000000..4a86a685f6bd4c --- /dev/null +++ b/lib/v2/hust/aia/news.js @@ -0,0 +1,26 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://aia.hust.edu.cn/xyxw.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.list li'); + + ctx.state.data = { + title: '华科人工智能和自动化学院新闻', + link, + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item.find('a h2').text(), + description: item.find('a div').text() || '华科人工智能和自动化学院新闻', + pubDate: parseDate(item.find('.date3').text(), 'DDYYYY-MM'), + link: new URL(item.find('a').attr('href'), link).href, + }; + }), + }; +}; diff --git a/lib/v2/hust/aia/notice.js b/lib/v2/hust/aia/notice.js new file mode 100755 index 00000000000000..7d8b15b79c612b --- /dev/null +++ b/lib/v2/hust/aia/notice.js @@ -0,0 +1,29 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const { type } = ctx.params; + const baseUrl = 'https://aia.hust.edu.cn'; + const link = `${baseUrl}/tzgg${type ? `/${type}` : ''}.htm`; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.list li'); + const title = $('title').text(); + + ctx.state.data = { + title, + link, + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item.find('a h2').text(), + description: item.find('a div').text() || title, + pubDate: parseDate(item.find('.date3').text(), 'DDYYYY-MM'), + link: new URL(item.find('a').attr('href'), link).href, + }; + }), + }; +}; diff --git a/lib/v2/hust/maintainer.js b/lib/v2/hust/maintainer.js new file mode 100644 index 00000000000000..6f7940a4bb91d4 --- /dev/null +++ b/lib/v2/hust/maintainer.js @@ -0,0 +1,7 @@ +module.exports = { + '/aia/news': ['budui'], + '/aia/notice/:type?': ['budui'], + '/auto/news': ['budui'], + '/auto/notice/:type?': ['budui'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/hust/radar.js b/lib/v2/hust/radar.js new file mode 100644 index 00000000000000..4396c1944b2ef0 --- /dev/null +++ b/lib/v2/hust/radar.js @@ -0,0 +1,27 @@ +module.exports = { + 'hust.edu.cn': { + _name: '华中科技大学', + aia: [ + { + title: '人工智能和自动化学院新闻', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-ke-ji-da-xue', + source: ['/xyxw.htm', '/'], + target: '/hust/aia/news', + }, + { + title: '人工智能和自动化学院通知', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-ke-ji-da-xue', + source: ['/tzgg/:type', '/tzgg.htm', '/'], + target: (params) => `/hust/aia/notice${params.type ? `/${params.type}` : ''}`, + }, + ], + gszs: [ + { + title: '研究生院通知公告', + docs: 'https://docs.rsshub.app/university.html#hua-zhong-ke-ji-da-xue', + source: ['/zsxx/ggtz.htm', '/'], + target: '/hust/yjs', + }, + ], + }, +}; diff --git a/lib/v2/hust/router.js b/lib/v2/hust/router.js new file mode 100644 index 00000000000000..212d6bcf4ec939 --- /dev/null +++ b/lib/v2/hust/router.js @@ -0,0 +1,7 @@ +module.exports = (router) => { + router.get('/aia/news', require('./aia/news')); + router.get('/aia/notice/:type?', require('./aia/notice')); + router.get('/auto/news', require('./aia/news')); + router.get('/auto/notice/:type?', require('./aia/notice')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/hust/yjs.js b/lib/v2/hust/yjs.js new file mode 100644 index 00000000000000..608fdbbdb0a9d0 --- /dev/null +++ b/lib/v2/hust/yjs.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://gszs.hust.edu.cn/zsxx/ggtz.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.main_conRCb li'); + + ctx.state.data = { + title: '华中科技大学研究生院', + link, + description: '华中科技大学研究生调剂信息', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('span').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/ouc/it-postgraduate.js b/lib/v2/ouc/it-postgraduate.js new file mode 100644 index 00000000000000..f492dc05191905 --- /dev/null +++ b/lib/v2/ouc/it-postgraduate.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://it.ouc.edu.cn/_s381/16619/list.psp'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.col_news_list .news_list li'); + + ctx.state.data = { + title: '中国海洋大学信息科学与工程学院', + link, + description: '中国海洋大学信息科学与工程学院研究生招生通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.attr('title'), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('span').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/ouc/it.js b/lib/v2/ouc/it.js new file mode 100644 index 00000000000000..89c9783e4d5d4b --- /dev/null +++ b/lib/v2/ouc/it.js @@ -0,0 +1,43 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const host = 'https://it.ouc.edu.cn'; + const typelist = ['学院要闻', '学院公告', '学术活动']; + const urlList = ['xyyw/list.psp', 'xygg/list.psp', 'xshd/list.psp']; + const type = parseInt(ctx.params.type) || 0; + const link = new URL(urlList[type], host).href; + const response = await got(link); + const $ = cheerio.load(response.data); + + const list = $('.col_news_list .news_list li') + .toArray() + .map((e) => { + e = $(e); + const a = e.find('a'); + return { + title: a.attr('title'), + link: new URL(a.attr('href'), host).href, + pubDate: parseDate(e.find('span').text(), 'YYYY-MM-DD'), + }; + }); + + const out = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const response = await got(item.link); + const $ = cheerio.load(response.data); + item.author = '中国海洋大学信息科学与工程学院'; + item.description = $('.wp_articlecontent').html(); + return item; + }) + ) + ); + + ctx.state.data = { + title: `中国海洋大学信息科学与工程学院${typelist[type]}`, + link, + item: out, + }; +}; diff --git a/lib/v2/ouc/maintainer.js b/lib/v2/ouc/maintainer.js new file mode 100644 index 00000000000000..bbddc647c77f9c --- /dev/null +++ b/lib/v2/ouc/maintainer.js @@ -0,0 +1,5 @@ +module.exports = { + '/it/postgraduate': ['shengmaosu'], + '/it/:type?': ['GeoffreyChen777'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/ouc/radar.js b/lib/v2/ouc/radar.js new file mode 100644 index 00000000000000..4e5ded8e74fa38 --- /dev/null +++ b/lib/v2/ouc/radar.js @@ -0,0 +1,27 @@ +module.exports = { + 'ouc.edu.cn': { + _name: '中国海洋大学', + it: [ + { + title: '信息科学与工程学院', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-hai-yang-da-xue', + source: ['/'], + target: '/ocu/it', + }, + { + title: '信息科学与工程学院研究生招生通知公告', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-hai-yang-da-xue', + source: ['/_s381/16619/list.psp', '/16619/list.htm', '/'], + target: '/ocu/it/postgraduate', + }, + ], + yz: [ + { + title: '研究生院', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-hai-yang-da-xue', + source: ['/5926/list.htm'], + target: '/ocu/yjs', + }, + ], + }, +}; diff --git a/lib/v2/ouc/router.js b/lib/v2/ouc/router.js new file mode 100644 index 00000000000000..762e8ef2932fc8 --- /dev/null +++ b/lib/v2/ouc/router.js @@ -0,0 +1,5 @@ +module.exports = (router) => { + router.get('/it/postgraduate', require('./it-postgraduate')); + router.get('/it/:type?', require('./it')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/ouc/yjs.js b/lib/v2/ouc/yjs.js new file mode 100644 index 00000000000000..a428468b178aeb --- /dev/null +++ b/lib/v2/ouc/yjs.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://yz.ouc.edu.cn/5926/list.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.wp_article_list li'); + + ctx.state.data = { + title: '中国海洋大学研究生院', + link, + description: '中国海洋大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.attr('title'), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('.Article_PublishDate').text()), + }; + }), + }; +}; diff --git a/lib/v2/scau/maintainer.js b/lib/v2/scau/maintainer.js new file mode 100644 index 00000000000000..69798711be8e6e --- /dev/null +++ b/lib/v2/scau/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/yzb': ['shengmaosu'], +}; diff --git a/lib/v2/scau/radar.js b/lib/v2/scau/radar.js new file mode 100644 index 00000000000000..a61950926abf47 --- /dev/null +++ b/lib/v2/scau/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'scau.edu.cn': { + _name: '华南农业大学', + yzb: [ + { + title: '华农研讯', + docs: 'https://docs.rsshub.app/university.html#hua-nan-nong-ye-da-xue', + source: ['/2136/list1.htm', '/'], + target: '/scau/yzb', + }, + ], + }, +}; diff --git a/lib/v2/scau/router.js b/lib/v2/scau/router.js new file mode 100644 index 00000000000000..a282d01e1c8827 --- /dev/null +++ b/lib/v2/scau/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/yzb', require('./yjs')); +}; diff --git a/lib/v2/scau/yjs.js b/lib/v2/scau/yjs.js new file mode 100644 index 00000000000000..8f33faf4b92997 --- /dev/null +++ b/lib/v2/scau/yjs.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://yzb.scau.edu.cn/2136/list1.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('#wp_news_w25 tr'); + + ctx.state.data = { + title: '华南农业大学研究生院', + link, + description: '华南农业大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + link: a.attr('href'), + pubDate: parseDate(item.find('td').eq(3).text(), 'YYYY/MM/DD'), + }; + }), + }; +}; diff --git a/lib/v2/scnu/cs/match.js b/lib/v2/scnu/cs/match.js new file mode 100644 index 00000000000000..70c336a70eaa99 --- /dev/null +++ b/lib/v2/scnu/cs/match.js @@ -0,0 +1,36 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'http://cs.scnu.edu.cn'; + const url = `${baseUrl}/xueshenggongzuo/chengchangfazhan/kejichuangxin/`; + const res = await got({ + method: 'get', + url, + headers: { + Referer: baseUrl, + }, + }); + const $ = cheerio.load(res.data); + const list = $('.listshow li a'); + + ctx.state.data = { + title: $('title').text(), + link: url, + description: '华南师范大学计算机学院 学科竞赛', + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item + .contents() + .filter((_, node) => node.type === 'text') + .text(), + pubDate: parseDate(item.find('.r').text()), + link: item.attr('href'), + }; + }), + }; +}; diff --git a/lib/v2/scnu/jw.js b/lib/v2/scnu/jw.js new file mode 100644 index 00000000000000..38b1b201b91edd --- /dev/null +++ b/lib/v2/scnu/jw.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'http://jw.scnu.edu.cn'; + const url = `${baseUrl}/ann/index.html`; + const res = await got({ + method: 'get', + url, + headers: { + Referer: baseUrl, + }, + }); + const $ = cheerio.load(res.data); + const list = $('.notice_01').find('li'); + + ctx.state.data = { + title: $('title').first().text(), + link: url, + description: '华南师范大学教务处 - 通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item.find('a').text(), + pubDate: parseDate(item.find('.time').text()), + link: item.find('a').attr('href'), + }; + }), + }; +}; diff --git a/lib/v2/scnu/library.js b/lib/v2/scnu/library.js new file mode 100644 index 00000000000000..d5cfbb5a024ac5 --- /dev/null +++ b/lib/v2/scnu/library.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://lib.scnu.edu.cn'; + const url = `${baseUrl}/news/zuixingonggao/`; + const res = await got({ + method: 'get', + url, + headers: { + Referer: baseUrl, + }, + }); + const $ = cheerio.load(res.data); + const list = $('.article-list').find('li'); + + ctx.state.data = { + title: $('title').text(), + link: url, + description: '华南师范大学图书馆 - 通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item.find('a').text(), + pubDate: parseDate(item.find('.clock').text()), + link: item.find('a').attr('href'), + }; + }), + }; +}; diff --git a/lib/v2/scnu/maintainer.js b/lib/v2/scnu/maintainer.js new file mode 100644 index 00000000000000..496dee13f930b9 --- /dev/null +++ b/lib/v2/scnu/maintainer.js @@ -0,0 +1,7 @@ +module.exports = { + '/cs/match': ['fengkx'], + '/jw': ['fengkx'], + '/library': ['fengkx'], + '/ss': ['shengmaosu'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/scnu/radar.js b/lib/v2/scnu/radar.js new file mode 100644 index 00000000000000..1984ee620063fb --- /dev/null +++ b/lib/v2/scnu/radar.js @@ -0,0 +1,45 @@ +module.exports = { + 'scnu.edu.cn': { + _name: '华南师范大学', + cs: [ + { + title: '计算机学院竞赛通知', + docs: 'https://docs.rsshub.app/university.html#hua-nan-shi-fan-da-xue', + source: ['/xueshenggongzuo/chengchangfazhan/kejichuangxin/', '/'], + target: '/scnu/cs/match', + }, + ], + jw: [ + { + title: '教务处通知', + docs: 'https://docs.rsshub.app/university.html#hua-nan-shi-fan-da-xue', + source: ['/ann/index.html', '/'], + target: '/scnu/jw', + }, + ], + lib: [ + { + title: '图书馆通知', + docs: 'https://docs.rsshub.app/university.html#hua-nan-shi-fan-da-xue', + source: ['/news/zuixingonggao', '/'], + target: '/scnu/library', + }, + ], + ss: [ + { + title: '软件学院通知公告', + docs: 'https://docs.rsshub.app/university.html#hua-nan-shi-fan-da-xue', + source: ['/tongzhigonggao', '/'], + target: '/scnu/ss', + }, + ], + yz: [ + { + title: '研究生院通知公告', + docs: 'https://docs.rsshub.app/university.html#hua-nan-shi-fan-da-xue', + source: ['/tongzhigonggao/ssgg', '/'], + target: '/scnu/yjs', + }, + ], + }, +}; diff --git a/lib/v2/scnu/router.js b/lib/v2/scnu/router.js new file mode 100644 index 00000000000000..a46091f8ef439e --- /dev/null +++ b/lib/v2/scnu/router.js @@ -0,0 +1,7 @@ +module.exports = (router) => { + router.get('/cs/match', require('./cs/match')); + router.get('/jw', require('./jw')); + router.get('/library', require('./library')); + router.get('/ss', require('./ss')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/scnu/ss.js b/lib/v2/scnu/ss.js new file mode 100644 index 00000000000000..9309e1842e948f --- /dev/null +++ b/lib/v2/scnu/ss.js @@ -0,0 +1,28 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'http://ss.scnu.edu.cn/tongzhigonggao/'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.listshow li a'); + + ctx.state.data = { + title: '华南师范大学软件学院', + link, + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item + .contents() + .filter((_, node) => node.type === 'text') + .text(), + link: item.attr('href'), + pubDate: parseDate(item.find('.time').text()), + }; + }), + }; +}; diff --git a/lib/routes/universities/scnu/scnuyjs.js b/lib/v2/scnu/yjs.js similarity index 52% rename from lib/routes/universities/scnu/scnuyjs.js rename to lib/v2/scnu/yjs.js index d917a8ed8bc4e2..d5497ef822c081 100644 --- a/lib/routes/universities/scnu/scnuyjs.js +++ b/lib/v2/scnu/yjs.js @@ -3,9 +3,9 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const link = 'https://yz.scnu.edu.cn/tongzhigonggao/ssgg/'; - const response = await got.get(link); + const response = await got(link); const $ = cheerio.load(response.data); - const list = $('.listmod div').slice(0, 10); + const list = $('.listmod div a'); ctx.state.data = { title: '华南师范大学研究生院', @@ -13,11 +13,12 @@ module.exports = async (ctx) => { description: '华南师范大学研究生院通知公告', item: list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('div a').text(), description: item.find('div a').text(), link: item.find('div a').attr('href') }; - }) - .get(), + list.toArray().map((item) => { + item = $(item); + return { + title: item.text(), + link: item.attr('href'), + }; + }), }; }; diff --git a/lib/routes/universities/scut/jwc/news.js b/lib/v2/scut/jwc/news.js similarity index 100% rename from lib/routes/universities/scut/jwc/news.js rename to lib/v2/scut/jwc/news.js diff --git a/lib/routes/universities/scut/jwc/notice.js b/lib/v2/scut/jwc/notice.js similarity index 100% rename from lib/routes/universities/scut/jwc/notice.js rename to lib/v2/scut/jwc/notice.js diff --git a/lib/routes/universities/scut/jwc/school.js b/lib/v2/scut/jwc/school.js similarity index 100% rename from lib/routes/universities/scut/jwc/school.js rename to lib/v2/scut/jwc/school.js diff --git a/lib/v2/scut/maintainer.js b/lib/v2/scut/maintainer.js new file mode 100644 index 00000000000000..b66d98b34b8264 --- /dev/null +++ b/lib/v2/scut/maintainer.js @@ -0,0 +1,8 @@ +module.exports = { + '/jwc/news': ['imkero'], + '/jwc/notice/:category?': ['imkero'], + '/jwc/school/:category?': ['imkero', 'Rongronggg9'], + '/scet/notice': ['railzy'], + '/seie/news_center': ['auto-bot-ty'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/scut/radar.js b/lib/v2/scut/radar.js new file mode 100644 index 00000000000000..6f35f7251c7536 --- /dev/null +++ b/lib/v2/scut/radar.js @@ -0,0 +1,33 @@ +module.exports = { + 'scut.edu.cn': { + _name: '华南理工大学', + jw: [ + { + title: '教务处通知公告', + docs: 'https://docs.rsshub.app/university.html#hua-nan-li-gong-da-xue', + }, + { + title: '教务处学院通知', + docs: 'https://docs.rsshub.app/university.html#hua-nan-li-gong-da-xue', + }, + { + title: '教务处新闻动态', + docs: 'https://docs.rsshub.app/university.html#hua-nan-li-gong-da-xue', + }, + ], + www2: [ + { + title: '电子与信息学院 - 新闻速递', + docs: 'https://docs.rsshub.app/university.html#hua-nan-li-gong-da-xue', + source: ['/ee/16285/list.htm'], + target: '/scut/seie/news_center', + }, + { + title: '研究生院通知公告', + docs: 'https://docs.rsshub.app/university.html#hua-nan-li-gong-da-xue', + source: ['/graduate/14562/list.htm'], + target: '/scut/yjs', + }, + ], + }, +}; diff --git a/lib/v2/scut/router.js b/lib/v2/scut/router.js new file mode 100644 index 00000000000000..6c2ecfda00a902 --- /dev/null +++ b/lib/v2/scut/router.js @@ -0,0 +1,8 @@ +module.exports = (router) => { + router.get('/jwc/news', require('./jwc/news')); + router.get('/jwc/notice/:category?', require('./jwc/notice')); + router.get('/jwc/school/:category?', require('./jwc/school')); + router.get('/scet/notice', require('./scet/notice')); + router.get('/seie/news_center', require('./seie/news_center')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/scut/scet/notice.js b/lib/v2/scut/scet/notice.js new file mode 100644 index 00000000000000..590461159d625c --- /dev/null +++ b/lib/v2/scut/scet/notice.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const link = 'https://www2.scut.edu.cn/jtxs/24241/list.htm'; + const response = await got({ + method: 'get', + url: link, + }); + + const data = response.data; + + const $ = cheerio.load(data); + const list = $('#wp_news_w5 li'); + + ctx.state.data = { + title: '华南理工大学土木与交通学院 - 学工通知', + link, + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item.find('li a').text(), + description: item.find('li a').text(), + link: item.find('li a').attr('href'), + pubDate: item.find('.Article_PublishDate').text(), + }; + }), + }; +}; diff --git a/lib/routes/universities/scut/seie/news_center.js b/lib/v2/scut/seie/news_center.js similarity index 71% rename from lib/routes/universities/scut/seie/news_center.js rename to lib/v2/scut/seie/news_center.js index d738e5c581b2b3..8228458c0b91bf 100644 --- a/lib/routes/universities/scut/seie/news_center.js +++ b/lib/v2/scut/seie/news_center.js @@ -5,30 +5,25 @@ const { parseDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const rootUrl = 'https://www2.scut.edu.cn'; const url = `${rootUrl}/ee/16285/list.htm`; - const response = await got.get(url); + const response = await got(url); const $ = cheerio.load(response.data); const list = $('.news_ul li'); - const articleList = list - .map((_, item) => { - item = $(item); - const titleElement = item.find('.news_title a'); - return { - title: titleElement.attr('title'), - link: titleElement.attr('href'), - pubDate: parseDate(item.find('.news_meta').text(), 'YYYY-MM-DD'), - }; - }) - .get(); + const articleList = list.toArray().map((item) => { + item = $(item); + const titleElement = item.find('.news_title a'); + return { + title: titleElement.attr('title'), + link: titleElement.attr('href'), + pubDate: parseDate(item.find('.news_meta').text(), 'YYYY-MM-DD'), + }; + }); const items = await Promise.all( articleList.map((item) => ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: `${rootUrl}${item.link}`, - }); - const content = cheerio.load(detailResponse.data, { decodeEntities: false }); + const detailResponse = await got(`${rootUrl}${item.link}`); + const content = cheerio.load(detailResponse.data); content('.wp_articlecontent *').each((_, child) => { const childElem = content(child); diff --git a/lib/v2/scut/yjs.js b/lib/v2/scut/yjs.js new file mode 100644 index 00000000000000..a1ac8457cb0986 --- /dev/null +++ b/lib/v2/scut/yjs.js @@ -0,0 +1,30 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://www2.scut.edu.cn'; + const link = `${baseUrl}/graduate/14562/list.htm`; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('#wp_news_w4 a'); + + ctx.state.data = { + title: '华南理工大学研究生院', + link, + description: '华南理工大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + return { + title: item + .contents() + .filter((_, node) => node.type === 'text') + .text(), + link: `${baseUrl}${item.attr('href')}`, + pubDate: parseDate(item.find('span').text()), + }; + }), + }; +}; diff --git a/lib/v2/sustech/bidding.js b/lib/v2/sustech/bidding.js new file mode 100644 index 00000000000000..e88e17d1d8b81b --- /dev/null +++ b/lib/v2/sustech/bidding.js @@ -0,0 +1,34 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'http://biddingoffice.sustech.edu.cn'; + const response = await got({ + method: 'get', + url: link, + }); + + const data = response.data; + + const $ = cheerio.load(data); + + const list = $('.index-wrap.index-2 ul li'); + + ctx.state.data = { + title: '南方科技大学采购与招标管理部', + link, + item: + list && + list.toArray().map((item) => { + item = $(item); + const itemPubdate = item.find('li > span').text(); + const a = item.find('li > a'); + return { + pubDate: parseDate(itemPubdate, 'YYYY-MM-DD'), + title: a.text(), + link: a.attr('href'), + }; + }), + }; +}; diff --git a/lib/v2/sustech/maintainer.js b/lib/v2/sustech/maintainer.js new file mode 100644 index 00000000000000..d9a6d0650bfcb8 --- /dev/null +++ b/lib/v2/sustech/maintainer.js @@ -0,0 +1,5 @@ +module.exports = { + '/bidding': ['sparkcyf'], + '/newshub-zh': ['sparkcyf'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/sustech/newshub-zh.js b/lib/v2/sustech/newshub-zh.js new file mode 100644 index 00000000000000..c80c26bf6d5b74 --- /dev/null +++ b/lib/v2/sustech/newshub-zh.js @@ -0,0 +1,39 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://newshub.sustech.edu.cn'; + const link = `${baseUrl}/news`; + const response = await got({ + method: 'get', + url: link, + }); + + const data = response.data; + + const $ = cheerio.load(data); + + const list = $('.m-newslist ul li'); + + ctx.state.data = { + title: '南方科技大学新闻网-中文', + link, + item: + list && + list.toArray().map((item) => { + item = $(item); + const itemPicUrl = item + .find('.u-pic div') + .attr('style') + .match(/url\('(.+?)'\)/)[1]; + const itemPubdate = item.find('.mobi').text(); + return { + pubDate: parseDate(itemPubdate, 'YYYY-MM-DD'), + title: item.find('.f-clamp').text(), + description: `<img src="${baseUrl}${itemPicUrl}"><br>${item.find('.f-clamp4').text()}`, + link: `${baseUrl}${item.find('a').attr('href')}`, + }; + }), + }; +}; diff --git a/lib/v2/sustech/radar.js b/lib/v2/sustech/radar.js new file mode 100644 index 00000000000000..c5b6b27a70414d --- /dev/null +++ b/lib/v2/sustech/radar.js @@ -0,0 +1,29 @@ +module.exports = { + 'sustech.edu.cn': { + _name: '南方科技大学', + biddingoffice: [ + { + title: '采购与招标管理部', + docs: 'https://docs.rsshub.app/university.html#nan-fang-ke-ji-da-xue', + source: ['/'], + target: '/sustech/bidding', + }, + ], + gs: [ + { + title: '研究生网通知公告', + docs: 'https://docs.rsshub.app/university.html#nan-fang-ke-ji-da-xue', + source: ['/'], + target: '/sustech/yjs', + }, + ], + newshub: [ + { + title: '新闻网(中文)', + docs: 'https://docs.rsshub.app/university.html#nan-fang-ke-ji-da-xue', + source: ['/news'], + target: '/sustech/newshub-zh', + }, + ], + }, +}; diff --git a/lib/v2/sustech/router.js b/lib/v2/sustech/router.js new file mode 100644 index 00000000000000..7fd476ad447ce4 --- /dev/null +++ b/lib/v2/sustech/router.js @@ -0,0 +1,5 @@ +module.exports = (router) => { + router.get('/bidding', require('./bidding')); + router.get('/newshub-zh', require('./newshub-zh')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/sustech/yjs.js b/lib/v2/sustech/yjs.js new file mode 100644 index 00000000000000..bc232796bf79dd --- /dev/null +++ b/lib/v2/sustech/yjs.js @@ -0,0 +1,29 @@ +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://gs.sustech.edu.cn'; + const link = `${baseUrl}/#/common/index?current_id=99&id=99`; + const response = await got(`${baseUrl}/api/www/v1/article/list`, { + searchParams: { + page: 1, + pageSize: 20, + kw: '', + sort_id: 99, + cas_sort_id: 99, + }, + }); + + const list = response.data.data.items.map((item) => ({ + title: item.title, + link: `${baseUrl}/#/common/detail?current_id=99&id=99&article_id=${item.id}`, + pubDate: parseDate(item.published_at, 'YYYY-MM-DD'), + })); + + ctx.state.data = { + title: '南方科技大学研究生院', + link, + description: '南方科技大学研招网通知公告', + item: list, + }; +}; diff --git a/lib/v2/szu/maintainer.js b/lib/v2/szu/maintainer.js new file mode 100644 index 00000000000000..f8f8567abd16b0 --- /dev/null +++ b/lib/v2/szu/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/yz/:type?': ['NagaruZ'], +}; diff --git a/lib/v2/szu/radar.js b/lib/v2/szu/radar.js new file mode 100644 index 00000000000000..ba71fb68d7ca09 --- /dev/null +++ b/lib/v2/szu/radar.js @@ -0,0 +1,19 @@ +module.exports = { + 'szu.edu.cn': { + _name: '深圳大学', + yz: [ + { + title: '硕士招生 - 研究生招生网', + docs: 'https://docs.rsshub.app/university.html#shen-zhen-da-xue', + source: ['/sszs/gg.htm', '/'], + target: '/szu/yz/1', + }, + { + title: '博士招生 - 研究生招生网', + docs: 'https://docs.rsshub.app/university.html#shen-zhen-da-xue', + source: ['/sszs/bszs/gg.htm', '/'], + target: '/szu/yz/2', + }, + ], + }, +}; diff --git a/lib/v2/szu/router.js b/lib/v2/szu/router.js new file mode 100644 index 00000000000000..8057c2e7a5a682 --- /dev/null +++ b/lib/v2/szu/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/yz/:type?', require('./yz')); +}; diff --git a/lib/routes/universities/szu/yz/index.js b/lib/v2/szu/yz/index.js similarity index 88% rename from lib/routes/universities/szu/yz/index.js rename to lib/v2/szu/yz/index.js index bb016e62f98451..e7f5c0c2a06deb 100644 --- a/lib/routes/universities/szu/yz/index.js +++ b/lib/v2/szu/yz/index.js @@ -8,7 +8,7 @@ const map = new Map([ ]); module.exports = async (ctx) => { - let type = Number.parseInt(ctx.params.type); + let type = parseInt(ctx.params.type); const struct = { 1: { selector: { @@ -22,7 +22,7 @@ module.exports = async (ctx) => { selector: { list: '.list', item: 'li', - content: '#vsb_content', + content: '#vsb_content, #vsb_content_2', }, url: 'https://yz.szu.edu.cn/bszs/gg.htm', }, @@ -33,11 +33,11 @@ module.exports = async (ctx) => { } const url = struct[type].url; - const response = await got.get(url); + const response = await got(url); const data = response.data; const $ = cheerio.load(data); - const list = $(struct[type].selector.list).find(struct[type].selector.item).get(); + const list = $(struct[type].selector.list).find(struct[type].selector.item).toArray(); const name = $('title').text(); const result = await util.ProcessFeed(list, ctx.cache, struct[type]); diff --git a/lib/routes/universities/szu/yz/utils.js b/lib/v2/szu/yz/utils.js similarity index 54% rename from lib/routes/universities/szu/yz/utils.js rename to lib/v2/szu/yz/utils.js index 4fe628cac52223..21618f24807e48 100644 --- a/lib/routes/universities/szu/yz/utils.js +++ b/lib/v2/szu/yz/utils.js @@ -1,34 +1,25 @@ const cheerio = require('cheerio'); const got = require('@/utils/got'); -const url = require('url'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); const ProcessFeed = (list, cache, current) => Promise.all( list .filter((item) => { // 如果不包含链接说明不是新闻item,如表头的tr - const $ = cheerio.load(item); - if ($('a').length > 0) { - return true; - } - return false; + const $ = cheerio.load(item, null, false); + return $('a').length; // return typeof ($('a').attr('href')) !== undefined; // return false; }) - .map(async (item) => { - let $ = cheerio.load(item); - const $url = url.resolve(current.url, $('a').attr('href')); - const key = $url; - // 检查缓存中是否存在该页面 - - const value = await cache.get(key); - if (value) { - // 查询返回未过期缓存 - return JSON.parse(value); - } else { + .map((item) => { + let $ = cheerio.load(item, null, false); + const $url = new URL($('a').attr('href'), current.url).href; + return cache.tryGet($url, async () => { // 加载新闻内容页面 - const response = await got.get($url); + const response = await got($url); const data = response.data; $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML @@ -38,38 +29,43 @@ const ProcessFeed = (list, cache, current) => const $elem = $(elem); const src = $elem.attr('src'); if (src) { - $elem.attr('src', url.resolve(current.url, src)); + $elem.attr('src', new URL(src, current.url).href); } }); // 还原链接地址 - $(`${current.selector.content} a`).each((index, elem) => { + $(`${current.selector.content} a, ul[style]`).each((index, elem) => { const $elem = $(elem); const src = $elem.attr('href'); if (src) { - $elem.attr('href', url.resolve(current.url, src)); + $elem.attr('href', new URL(src, current.url).href); } }); // 去除样式 - $('img, div, span, p, table, td, tr').removeAttr('style'); + $('img, div, span, p, table, td, tr, a').removeAttr('style'); $('style, script').remove(); const title = $('h2').text(); const single = { title, - description: $(current.selector.content).html(), + description: $(current.selector.content).html() + ($('ul[style]').length ? $('ul[style]').html() : ''), link: $url, - pubDate: new Date($('div.ny_fbt').text().substr(6, 16)).toUTCString(), // 混有发表时间和点击量,取出时间 + pubDate: timezone( + parseDate( + $('div.ny_fbt') + .text() + .match(/(\d{4}-\d{2}-\d{2} \d{2}:\d{2})/)[0], + 'YYYY-MM-DD HH:mm' + ), + 8 + ), // 混有发表时间和点击量,取出时间 author: '深圳大学研究生招生网', - guid: $url, // 文章唯一标识 }; - // 将内容写入缓存 - cache.set(key, JSON.stringify(single)); // 缓存时间为24h // 返回列表上提取到的信息 return single; - } + }); }) ); diff --git a/lib/v2/tongji/maintainer.js b/lib/v2/tongji/maintainer.js new file mode 100644 index 00000000000000..9a4395cf73e50a --- /dev/null +++ b/lib/v2/tongji/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/sse/:type?': ['sgqy'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/tongji/radar.js b/lib/v2/tongji/radar.js new file mode 100644 index 00000000000000..79054887c0baf7 --- /dev/null +++ b/lib/v2/tongji/radar.js @@ -0,0 +1,21 @@ +module.exports = { + 'tongji.edu.cn': { + _name: '同济大学', + sse: [ + { + title: '软件学院通知', + docs: 'https://docs.rsshub.app/university.html#tong-ji-da-xue', + source: ['/xxzx/xytz/:type', '/xxzx/:type', '/'], + target: (params) => `/tongji/sse${params.type ? `/${params.type.replace('.htm', '')}` : ''}`, + }, + ], + yz: [ + { + title: '研究生院通知公告', + docs: 'https://docs.rsshub.app/university.html#tong-ji-da-xue', + source: ['/zsxw/ggtz.htm', '/'], + target: '/tongji/yjs', + }, + ], + }, +}; diff --git a/lib/v2/tongji/router.js b/lib/v2/tongji/router.js new file mode 100644 index 00000000000000..baa0e4b72b1a3f --- /dev/null +++ b/lib/v2/tongji/router.js @@ -0,0 +1,4 @@ +module.exports = (router) => { + router.get('/sse/:type?', require('./sse/notice')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/tongji/sse/_article.js b/lib/v2/tongji/sse/_article.js new file mode 100644 index 00000000000000..7731ba514a8cd5 --- /dev/null +++ b/lib/v2/tongji/sse/_article.js @@ -0,0 +1,25 @@ +const got = require('@/utils/got'); // get web content +const cheerio = require('cheerio'); // html parser + +module.exports = async function getArticle(item) { + const response = await got({ + method: 'get', + url: item.link, + }); + const data = response.data; + + const $ = cheerio.load(data); + const title = $('div.view-title').text(); + const content = $('#vsb_content').html(); + $('[name="_newscontent_fromname"] ul a').each((_, e) => { + const href = $(e).attr('href'); + if (href.startsWith('/')) { + $(e).attr('href', new URL(href, item.link).href); + } + }); + + item.title = title; + item.description = content + ($('ul[style]').length ? $('ul[style]').html() : ''); + + return item; +}; diff --git a/lib/v2/tongji/sse/notice.js b/lib/v2/tongji/sse/notice.js new file mode 100644 index 00000000000000..850c69969f40f4 --- /dev/null +++ b/lib/v2/tongji/sse/notice.js @@ -0,0 +1,46 @@ +// Warning: The author still knows nothing about javascript! + +// params: +// type: notification type + +const got = require('@/utils/got'); // get web content +const cheerio = require('cheerio'); // html parser +const getArticle = require('./_article'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://sse.tongji.edu.cn'; + const type = ctx.params.type || 'xytz'; + const subType = ['bkstz', 'yjstz', 'jgtz', 'qttz']; + + const listUrl = `${baseUrl}/xxzx/${subType.includes(type) ? `xytz/${type}` : type}.htm`; + const response = await got({ + method: 'get', + url: listUrl, + }); + const data = response.data; // content is html format + const $ = cheerio.load(data); + + // get urls + const detailUrls = $('.data-list li') + .toArray() + .map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + link: new URL(a.attr('href'), baseUrl).href, + pubDate: parseDate(item.find('.data-list-time').text(), 'YYYY-MM-DD'), + }; + }); + + // get articles + const articleList = await Promise.all(detailUrls.map((item) => ctx.cache.tryGet(item.link, () => getArticle(item)))); + + // feed the data + ctx.state.data = { + title: '同济大学软件学院', + link: listUrl, + item: articleList, + }; +}; diff --git a/lib/v2/tongji/yjs.js b/lib/v2/tongji/yjs.js new file mode 100644 index 00000000000000..40fc54f77f836e --- /dev/null +++ b/lib/v2/tongji/yjs.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://yz.tongji.edu.cn/zsxw/ggtz.htm'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.list_main_content li'); + + ctx.state.data = { + title: '同济大学研究生院', + link, + description: '同济大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.attr('title'), + link: new URL(a.attr('href'), link).href, + pubDate: parseDate(item.find('span').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/ucas/ai.js b/lib/v2/ucas/ai.js new file mode 100644 index 00000000000000..9b816e4b01e5ce --- /dev/null +++ b/lib/v2/ucas/ai.js @@ -0,0 +1,28 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://ai.ucas.ac.cn'; + const link = `${baseUrl}/index.php/zh-cn/tzgg`; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.b-list li'); + + ctx.state.data = { + title: '中科院人工智能所', + link, + description: '中科院人工智能通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text(), + link: `${baseUrl}${a.attr('href')}`, + pubDate: parseDate(item.find('.m-date').text(), 'YYYY-MM-DD'), + }; + }), + }; +}; diff --git a/lib/v2/ucas/maintainer.js b/lib/v2/ucas/maintainer.js index 17f4089cea5ba3..af83b2205dcfa6 100644 --- a/lib/v2/ucas/maintainer.js +++ b/lib/v2/ucas/maintainer.js @@ -1,3 +1,4 @@ module.exports = { + '/ai': ['shengmaosu'], '/job/:type?': ['Fatpandac'], }; diff --git a/lib/v2/ucas/radar.js b/lib/v2/ucas/radar.js index f44368a9430cc8..c62dcfc9d59521 100644 --- a/lib/v2/ucas/radar.js +++ b/lib/v2/ucas/radar.js @@ -1,6 +1,14 @@ module.exports = { 'ucas.ac.cn': { _name: '中国科学院大学', + ai: [ + { + title: '人工智能学院', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-ke-xue-yuan-da-xue', + source: ['/index.php/zh-cn/tzgg', '/'], + target: '/ucas/ai', + }, + ], zhaopin: [ { title: '招聘信息', diff --git a/lib/v2/ucas/router.js b/lib/v2/ucas/router.js index cde55f5930e9e0..6c75b94cbe0f8d 100644 --- a/lib/v2/ucas/router.js +++ b/lib/v2/ucas/router.js @@ -1,3 +1,4 @@ module.exports = function (router) { + router.get('/ai', require('./ai')); router.get('/job/:type?', require('./index')); }; diff --git a/lib/v2/upc/jsj.js b/lib/v2/upc/jsj.js new file mode 100644 index 00000000000000..47fe2e31c87eb6 --- /dev/null +++ b/lib/v2/upc/jsj.js @@ -0,0 +1,77 @@ +// 计算机科学与技术学院:http://computer.upc.edu.cn/ +// - 学院新闻:http://computer.upc.edu.cn/6277/list.htm +// - 学术关注:http://computer.upc.edu.cn/6278/list.htm +// - 学工动态:http://computer.upc.edu.cn/6279/list.htm +// - 通知公告:http://computer.upc.edu.cn/6280/list.htm + +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); + +// 地址映射 +const MAP = { + news: '6277', + scholar: '6278', + states: '6279', + notice: '6280', +}; +// 头部信息 +const HEAD = { + news: '学院新闻', + scholar: '学术关注', + states: '学工动态', + notice: '通知公告', +}; + +module.exports = async (ctx) => { + const baseUrl = 'https://computer.upc.edu.cn'; + const type = ctx.params.type; + const link = `${baseUrl}/${MAP[type]}/list.htm`; + const response = await got({ + method: 'get', + url: link, + }); + const $ = cheerio.load(response.data); + // ## 获取列表 + const list = $('.list tbody table tr') + .toArray() + .map((item) => { + item = $(item); + const a = item.find('a'); + const link = a.attr('href'); + return { + title: a.attr('title'), + link: link.startsWith('http') ? link : `${baseUrl}${link}`, + pubDate: parseDate(item.find('div[style]').text(), 'YYYY-MM-DD'), + }; + }); + // ## 定义输出的item + const out = await Promise.all( + // ### 遍历列表,筛选出自己想要的内容 + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + // 获取详情页面的介绍 + const detail_response = await got({ + method: 'get', + url: item.link, + }); + const $ = cheerio.load(detail_response.data); + const detailContent = $('.v_news_content, .wp_articlecontent').html(); + // ### 设置 RSS feed item + // author, + item.description = detailContent; + item.pubDate = $('.nr-xinxi i').first().length ? timezone(parseDate($('.nr-xinxi i').first().text(), 'YYYY-MM-DD HH:mm:ss'), 8) : item.pubDate; + // // ### 设置缓存 + return item; + }) + ) + ); + + ctx.state.data = { + title: HEAD[type] + `-计算机科学与技术学院`, + link, + description: HEAD[type] + `-计算机科学与技术学院`, + item: out, + }; +}; diff --git a/lib/v2/upc/main.js b/lib/v2/upc/main.js new file mode 100644 index 00000000000000..aab8b9af7b20ea --- /dev/null +++ b/lib/v2/upc/main.js @@ -0,0 +1,72 @@ +// 学校官网:http://www.upc.edu.cn/ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); + +// 地址映射 +const MAP = { + notice: 'tzgg', + scholar: 'xsdt', +}; +// 头部信息 +const HEAD = { + notice: '通知公告', + scholar: '学术动态', +}; + +module.exports = async (ctx) => { + const baseUrl = 'https://news.upc.edu.cn'; + const type = ctx.params.type; + const link = `${baseUrl}/${MAP[type]}.htm`; + const response = await got({ + method: 'get', + url: link, + }); + const $ = cheerio.load(response.data); + // ## 获取列表 + const list = $('.main-list-box-left li') + .toArray() + .map((item) => { + item = $(item); + const a = item.find('.li-right-bt a'); + const link = a.attr('href'); + return { + title: a.text(), + description: item.find('.li-right-zy a').text(), + link: link.startsWith('http') ? link : `${baseUrl}/${link}`, + pubDate: parseDate(item.find('.li-left').text(), 'DDYYYY-MM'), + }; + }); + // ## 定义输出的item + const out = await Promise.all( + // ### 遍历列表,筛选出自己想要的内容 + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + if (!item.link.startsWith(`${baseUrl}/`) || item.link.includes('content.jsp')) { + return item; + } + // 获取详情页面的介绍 + const detail_response = await got({ + method: 'get', + url: item.link, + }); + const $ = cheerio.load(detail_response.data); + const detailContent = $('.v_news_content').html(); + // ### 设置 RSS feed item + // author, + item.description = detailContent; + item.pubDate = timezone(parseDate($('.nr-xinxi i').first().text(), 'YYYY-MM-DD HH:mm:ss'), 8); + // // ### 设置缓存 + return item; + }) + ) + ); + + ctx.state.data = { + title: HEAD[type] + `-中国石油大学(华东)`, + link, + description: HEAD[type] + `-中国石油大学(华东)`, + item: out, + }; +}; diff --git a/lib/v2/upc/maintainer.js b/lib/v2/upc/maintainer.js new file mode 100644 index 00000000000000..cec22a1c351bc3 --- /dev/null +++ b/lib/v2/upc/maintainer.js @@ -0,0 +1,5 @@ +module.exports = { + '/main/:type': ['Veagau'], + '/jsj/:type': ['Veagau'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/upc/radar.js b/lib/v2/upc/radar.js new file mode 100644 index 00000000000000..48c9daf3d09348 --- /dev/null +++ b/lib/v2/upc/radar.js @@ -0,0 +1,53 @@ +module.exports = { + 'upc.edu.cn': { + _name: '中国石油大学(华东)', + computer: [ + { + title: '计算机科学与技术学院学院新闻', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/6277/list.htm', '/'], + target: '/upc/jsj/news', + }, + { + title: '计算机科学与技术学院学术关注', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/6278/list.htm', '/'], + target: '/upc/jsj/scholar', + }, + { + title: '计算机科学与技术学院学工动态', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/6279/list.htm', '/'], + target: '/upc/jsj/states', + }, + { + title: '计算机科学与技术学院通知公告', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/6280/list.htm', '/'], + target: '/upc/jsj/notice', + }, + ], + news: [ + { + title: '主页通知公告', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/tzgg.htm', '/'], + target: '/upc/main/notice', + }, + { + title: '主页学术动态', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/xsdt.htm', '/'], + target: '/upc/main/scholar', + }, + ], + 'zs.gs': [ + { + title: '研究生院通知公告', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-shi-you-da-xue-hua-dong', + source: ['/sszs/list.htm', '/'], + target: '/upc/yjs', + }, + ], + }, +}; diff --git a/lib/v2/upc/router.js b/lib/v2/upc/router.js new file mode 100644 index 00000000000000..0c8162e89e24bf --- /dev/null +++ b/lib/v2/upc/router.js @@ -0,0 +1,5 @@ +module.exports = (router) => { + router.get('/main/:type', require('./main')); + router.get('/jsj/:type', require('./jsj')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/upc/yjs.js b/lib/v2/upc/yjs.js new file mode 100644 index 00000000000000..4def729675f30a --- /dev/null +++ b/lib/v2/upc/yjs.js @@ -0,0 +1,28 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'http://zs.gs.upc.edu.cn'; + const link = `${baseUrl}/sszs/list.htm`; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.list tr'); + + ctx.state.data = { + title: '中国石油大学研究生院', + link, + description: '中国石油大学研究生院通知公告', + item: + list && + list.toArray().map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.attr('title'), + link: `${baseUrl}${a.attr('href')}`, + pubDate: parseDate(item.find('div[style]').text()), + }; + }), + }; +};
2fc3b3a3360b4533811461f6682033419c5d6d5d
2024-03-24 16:06:11
cnkmmk
feat(route): add dbaplus社群 (#14925)
false
add dbaplus社群 (#14925)
feat
diff --git a/lib/routes/dbaplus/namespace.ts b/lib/routes/dbaplus/namespace.ts new file mode 100644 index 00000000000000..5de237b67c7e95 --- /dev/null +++ b/lib/routes/dbaplus/namespace.ts @@ -0,0 +1,6 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'dbaplus社群', + url: 'dbaplus.cn', +}; diff --git a/lib/routes/dbaplus/rss.ts b/lib/routes/dbaplus/rss.ts new file mode 100644 index 00000000000000..f94576c35a8129 --- /dev/null +++ b/lib/routes/dbaplus/rss.ts @@ -0,0 +1,48 @@ +import { Route } from '@/types'; +import { parseDate } from '@/utils/parse-date'; +import got from '@/utils/got'; +import { load } from 'cheerio'; + +export const route: Route = { + path: '/', + categories: ['programming'], + example: '/dbaplus', + radar: [ + { + source: ['dbaplus.cn/'], + }, + ], + name: '最新文章', + maintainers: ['cnkmmk'], + handler, + url: 'dbaplus.cn/', +}; + +async function handler() { + const url = 'https://dbaplus.cn'; + const response = await got(`${url}/news-9-1.html`); + const $ = load(response.data); + + const list = $('div.col-xs-12.col-md-8.pd30 > div.panel.panel-default.categeay > div.panel-body > ul.media-list.clearfix > li.media') + .map((i, e) => { + const element = $(e); + const title = element.find('h3 > a').text(); + const link = element.find('h3 > a').attr('href'); + const description = element.find('div.mt10.geay').text(); + const dateraw = element.find('span.time').text(); + + return { + title, + description, + link, + pubDate: parseDate(dateraw, 'YYYY年MM月DD日'), + }; + }) + .get(); + + return { + title: 'dbaplus社群', + link: url, + item: list, + }; +}
c91c46d8888a2c31a42c7dff4406d863b820d60a
2024-03-02 17:29:27
DIYgod
fix: unclean require
false
unclean require
fix
diff --git a/lib/routes/twitter/keyword.js b/lib/routes/twitter/keyword.js index 01bfca71ad85ac..027c410c4395bf 100644 --- a/lib/routes/twitter/keyword.js +++ b/lib/routes/twitter/keyword.js @@ -1,3 +1,3 @@ -const webApiImpl = require('./web-api/search'); +import webApiImpl from './web-api/search'; export default async (ctx) => await webApiImpl(ctx); diff --git a/lib/routes/twitter/media.js b/lib/routes/twitter/media.js index 595b7165cd8ff8..81eba91621be40 100644 --- a/lib/routes/twitter/media.js +++ b/lib/routes/twitter/media.js @@ -1,3 +1,3 @@ -const webApiImpl = require('./web-api/media'); +import webApiImpl from './web-api/media'; export default async (ctx) => await webApiImpl(ctx); diff --git a/lib/routes/twitter/tweet.js b/lib/routes/twitter/tweet.js index d65d1e8ea0fe82..16d93a203ed939 100644 --- a/lib/routes/twitter/tweet.js +++ b/lib/routes/twitter/tweet.js @@ -1,4 +1,4 @@ -const webApiImpl = require('./web-api/tweet'); +import webApiImpl from './web-api/tweet'; export default async (ctx) => { await webApiImpl(ctx); diff --git a/lib/routes/twitter/user.js b/lib/routes/twitter/user.js index 70359ed26b9778..c3074f0403267e 100644 --- a/lib/routes/twitter/user.js +++ b/lib/routes/twitter/user.js @@ -1,3 +1,3 @@ -const webApiImpl = require('./web-api/user'); +import webApiImpl from './web-api/user'; export default (ctx) => webApiImpl(ctx);
f6fd024df9debaa1d9974af7f97e2c1897b5daff
2022-02-22 19:10:53
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/docs/multimedia.md b/docs/multimedia.md index 5df70c1988dc2e..e54c9326d514e9 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -1245,8 +1245,8 @@ JavDB 有多个备用域名,本路由默认使用永久域名 <https://javdb.c <Route author="nczitzk" example="/qq88" path="/qq88/:category?" :paramsDesc="['分类 id,见下表,默认为首页']"> | 首页 | オトナの土ドラ | 日剧 | 日剧 SP | -| ---- | -------------- | ---- | ------- | -| | 10 | 5 | 11 | +| -- | ------- | -- | ----- | +| | 10 | 5 | 11 | </Route>
c86782b91b28eb802e1f4442159565c5f2b493a5
2022-01-23 01:32:27
Tony
fix(route): Financial Times HTTPS support (#8765)
false
Financial Times HTTPS support (#8765)
fix
diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 428bd7e51ad3a9..a67bbbe00e2697 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -157,7 +157,6 @@ pageClass: routes ::: tip 提示 - 不支持付费文章。 -- 由于未知原因 FT 中文网的 SSL 证书不被信任 (参见 [SSL Labs 报告](https://www.ssllabs.com/ssltest/analyze.html?d=www.ftchinese.com&latest)), 所有文章通过 http 协议获取。 ::: diff --git a/lib/router.js b/lib/router.js index 49724e7bd15217..25b935f614543c 100644 --- a/lib/router.js +++ b/lib/router.js @@ -988,9 +988,9 @@ router.get('/nhk/news_web_easy', lazyloadRouteHandler('./routes/nhk/news_web_eas // BBC router.get('/bbc/:site?/:channel?', lazyloadRouteHandler('./routes/bbc/index')); -// Financial Times -router.get('/ft/myft/:key', lazyloadRouteHandler('./routes/ft/myft')); -router.get('/ft/:language/:channel?', lazyloadRouteHandler('./routes/ft/channel')); +// Financial Times migrated to v2 +// router.get('/ft/myft/:key', lazyloadRouteHandler('./routes/ft/myft')); +// router.get('/ft/:language/:channel?', lazyloadRouteHandler('./routes/ft/channel')); // The Verge router.get('/verge', lazyloadRouteHandler('./routes/verge/index')); diff --git a/lib/routes/ft/myft.js b/lib/routes/ft/myft.js deleted file mode 100644 index 8b82025a125371..00000000000000 --- a/lib/routes/ft/myft.js +++ /dev/null @@ -1,46 +0,0 @@ -const got = require('@/utils/got'); -const parser = require('@/utils/rss-parser'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const ProcessFeed = (content) => { - // clean up the article - content.find('div.o-share, aside, div.o-ads').remove(); - - return content.html(); - }; - - const link = `https://www.ft.com/myft/following/${ctx.params.key}.rss`; - - const feed = await parser.parseURL(link); - - const items = await Promise.all( - feed.items.map(async (item) => { - const response = await got({ - method: 'get', - url: item.link, - headers: { - Referer: 'https://www.facebook.com', - }, - }); - - const $ = cheerio.load(response.data); - - const single = { - title: item.title, - description: ProcessFeed($('div.article__content-body')), - author: $('a.n-content-tag--author').text(), - pubDate: item.pubDate, - link: item.link, - }; - return Promise.resolve(single); - }) - ); - - ctx.state.data = { - title: `FT.com - myFT`, - link, - description: `FT.com - myFT`, - item: items, - }; -}; diff --git a/lib/routes/ft/channel.js b/lib/v2/ft/channel.js similarity index 94% rename from lib/routes/ft/channel.js rename to lib/v2/ft/channel.js index dc1c6e57ce177e..f0c823233cd3cd 100644 --- a/lib/routes/ft/channel.js +++ b/lib/v2/ft/channel.js @@ -4,5 +4,6 @@ module.exports = async (ctx) => { ctx.state.data = await utils.getData({ site: ctx.params.language === 'chinese' ? 'www' : 'big5', channel: ctx.params.channel, + ctx, }); }; diff --git a/lib/v2/ft/maintainer.js b/lib/v2/ft/maintainer.js new file mode 100644 index 00000000000000..cdbeeec8367dd2 --- /dev/null +++ b/lib/v2/ft/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/ft/myft/:key': ['HenryQW'], + '/ft/:language/:channel?': ['HenryQW', 'xyqfer'], +}; diff --git a/lib/v2/ft/myft.js b/lib/v2/ft/myft.js new file mode 100644 index 00000000000000..c5d7d0b90ce185 --- /dev/null +++ b/lib/v2/ft/myft.js @@ -0,0 +1,44 @@ +const got = require('@/utils/got'); +const parser = require('@/utils/rss-parser'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const ProcessFeed = (content) => { + // clean up the article + content.find('div.o-share, aside, div.o-ads').remove(); + + return content.html(); + }; + + const link = `https://www.ft.com/myft/following/${ctx.params.key}.rss`; + + const feed = await parser.parseURL(link); + + const items = await Promise.all( + feed.items.map((item) => + ctx.cache.tryGet(item.link, async () => { + const response = await got({ + method: 'get', + url: item.link, + headers: { + Referer: 'https://www.facebook.com', + }, + }); + + const $ = cheerio.load(response.data); + + item.description = ProcessFeed($('div.article__content-body')); + item.author = $('a.n-content-tag--author').text(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: `FT.com - myFT`, + link, + description: `FT.com - myFT`, + item: items, + }; +}; diff --git a/lib/v2/ft/radar.js b/lib/v2/ft/radar.js new file mode 100644 index 00000000000000..35238ff0561d8a --- /dev/null +++ b/lib/v2/ft/radar.js @@ -0,0 +1,24 @@ +module.exports = { + 'ftchinese.com': { + _name: 'Financial Times', + '.': [ + { + title: 'FT 中文网', + docs: 'https://docs.rsshub.app/traditional-media.html#financial-times', + }, + { + title: 'myFT 个人 RSS', + docs: 'https://docs.rsshub.app/traditional-media.html#financial-times', + }, + ], + }, + 'ft.com': { + _name: 'Financial Times', + '.': [ + { + title: 'myFT personal RSS', + docs: 'https://docs.rsshub.app/en/traditional-media.html#financial-times', + }, + ], + }, +}; diff --git a/lib/v2/ft/router.js b/lib/v2/ft/router.js new file mode 100644 index 00000000000000..11cf5c86a64329 --- /dev/null +++ b/lib/v2/ft/router.js @@ -0,0 +1,4 @@ +module.exports = function (router) { + router.get('/myft/:key', require('./myft')); + router.get('/:language/:channel?', require('./channel')); +}; diff --git a/lib/routes/ft/utils.js b/lib/v2/ft/utils.js similarity index 65% rename from lib/routes/ft/utils.js rename to lib/v2/ft/utils.js index 794058248b253f..1e6a15378fad15 100644 --- a/lib/routes/ft/utils.js +++ b/lib/v2/ft/utils.js @@ -7,21 +7,21 @@ const ProcessFeed = ($, link) => { let content = $('div.story-container'); // 处理封面图片 - content.find('div.story-image > figure').each((i, e) => { + content.find('div.story-image > figure').each((_, e) => { const src = `https://thumbor.ftacademy.cn/unsafe/1340x754/${e.attribs['data-url']}`; $(`<img src=${src}>`).insertAfter(content.find('div.story-lead')[0]); }); // 付费文章跳转 - content.find('div#subscribe-now-container').each((i, e) => { + content.find('div#subscribe-now-container').each((_, e) => { $(`<br/><p>此文章为付费文章,会员<a href='${link}'>请访问网站阅读</a>。</p>`).insertAfter(content.find('div.story-body')[0]); $(e).remove(); }); // 获取作者 let author = ''; - content.find('span.story-author > a').each((i, e) => { + content.find('span.story-author > a').each((_, e) => { author += `${$(e).text()} `; }); author = author.trim(); @@ -31,7 +31,7 @@ const ProcessFeed = ($, link) => { .find( 'div.story-theme, h1.story-headline, div.story-byline, div.mpu-container-instory,script, div#story-action-placeholder, div.copyrightstatement-container, div.clearfloat, div.o-ads, h2.list-title, div.allcomments, div.logincomment, div.nologincomment' ) - .each((i, e) => { + .each((_, e) => { $(e).remove(); }); content = content.html(); @@ -39,7 +39,7 @@ const ProcessFeed = ($, link) => { return { content, author, title }; }; -const getData = async ({ site = 'www', channel }) => { +const getData = async ({ site = 'www', channel, ctx }) => { let feed; if (channel) { @@ -47,7 +47,7 @@ const getData = async ({ site = 'www', channel }) => { channel = channel.split('-').join('/'); try { - feed = await parser.parseURL(`http://${site}.ftchinese.com/rss/${channel}`); + feed = await parser.parseURL(`https://${site}.ftchinese.com/rss/${channel}`); } catch (error) { return { title: `FT 中文网 ${channel} 不存在`, @@ -55,23 +55,23 @@ const getData = async ({ site = 'www', channel }) => { }; } } else { - feed = await parser.parseURL(`http://${site}.ftchinese.com/rss/feed`); + feed = await parser.parseURL(`https://${site}.ftchinese.com/rss/feed`); } const items = await Promise.all( - feed.items.splice(0, 10).map(async (item) => { - const response = await got.get(`${item.link}?full=y&archive`); + feed.items.splice(0, 10).map((item) => { + item.link = item.link.replace('http://', 'https://'); + return ctx.cache.tryGet(item.link, async () => { + const response = await got.get(`${item.link}?full=y&archive`); - const $ = cheerio.load(response.data); - const result = ProcessFeed($, item.link); - const single = { - title: result.title, - description: result.content, - author: result.author, - pubDate: item.pubDate, - link: item.link, - }; - return Promise.resolve(single); + const $ = cheerio.load(response.data); + const result = ProcessFeed($, item.link); + + item.title = result.title; + item.description = result.content; + item.author = result.author; + return item; + }); }) );
c2fc202578de4f7e7b05c6edb091b59be72ef245
2023-11-11 03:27:19
dependabot[bot]
chore(deps): bump lru-cache from 10.0.1 to 10.0.2 (#13753)
false
bump lru-cache from 10.0.1 to 10.0.2 (#13753)
chore
diff --git a/package.json b/package.json index 05cea6b149e4cd..fa075cd2dee72a 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "koa-favicon": "2.1.0", "koa-mount": "4.0.0", "koa-static": "5.0.0", - "lru-cache": "10.0.1", + "lru-cache": "10.0.2", "lz-string": "1.5.0", "mailparser": "3.6.5", "markdown-it": "13.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9b8fb0f8f7bfa..39d0c0edac667c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -120,8 +120,8 @@ dependencies: specifier: 5.0.0 version: 5.0.0 lru-cache: - specifier: 10.0.1 - version: 10.0.1 + specifier: 10.0.2 + version: 10.0.2 lz-string: specifier: 1.5.0 version: 1.5.0 @@ -5492,9 +5492,11 @@ packages: engines: {node: '>=8'} dev: false - /[email protected]: - resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} + /[email protected]: + resolution: {integrity: sha512-Yj9mA8fPiVgOUpByoTZO5pNrcl5Yk37FcSHsUINpAsaBIEZIuqcCclDZJCVxqQShDsmYX8QG63svJiTbOATZwg==} engines: {node: 14 || >=16.14} + dependencies: + semver: 7.5.4 dev: false /[email protected]: @@ -7080,7 +7082,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: true /[email protected]: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
814542a49a821c165287fb35365564759c447eb2
2020-02-24 21:32:11
Sean Wong
fix: remove redundant `>` (#4039)
false
remove redundant `>` (#4039)
fix
diff --git a/lib/views/rss.art b/lib/views/rss.art index 3b87f527fd29d8..e59f4c5dcd523e 100644 --- a/lib/views/rss.art +++ b/lib/views/rss.art @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" {{ if itunes_author }} - xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> + xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" {{ else if item && item.some((i) => i.media) }} xmlns:media="http://search.yahoo.com/mrss/" {{ /if }}
0972893abeb5bdefcd5c1375ea5520c5921a2987
2019-09-18 15:04:32
dependabot-preview[bot]
chore(deps-dev): bump eslint-plugin-prettier from 3.1.0 to 3.1.1
false
bump eslint-plugin-prettier from 3.1.0 to 3.1.1
chore
diff --git a/package.json b/package.json index f18f78d0924e73..addd7c94be8207 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "cross-env": "6.0.0", "eslint": "6.4.0", "eslint-config-prettier": "6.3.0", - "eslint-plugin-prettier": "3.1.0", + "eslint-plugin-prettier": "3.1.1", "jest": "24.9.0", "mockdate": "2.0.5", "nock": "11.3.4", diff --git a/yarn.lock b/yarn.lock index 36c2cbbf675241..d04e3363366801 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4030,10 +4030,10 @@ [email protected]: dependencies: get-stdin "^6.0.0" [email protected]: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" - integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== [email protected]: + version "3.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba" + integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA== dependencies: prettier-linter-helpers "^1.0.0"
85fb1e8c170c7e17650a9d5c2d7dceff28489b10
2024-06-26 12:12:06
hywell
fix(route): sehuatang 抓取原帖失败问题 (#15993)
false
sehuatang 抓取原帖失败问题 (#15993)
fix
diff --git a/lib/routes/sehuatang/index.ts b/lib/routes/sehuatang/index.ts index 08b305c2955b95..fa5cdea7546362 100644 --- a/lib/routes/sehuatang/index.ts +++ b/lib/routes/sehuatang/index.ts @@ -112,7 +112,7 @@ async function handler(ctx) { waitUntil: 'domcontentloaded', }); const response = await page.content(); - + await page.close(); const $ = load(response); const postMessage = $("td[id^='postmessage']").slice(0, 1); const images = $(postMessage).find('img'); @@ -151,7 +151,6 @@ async function handler(ctx) { info.enclosure_url = enclosureUrl; info.enclosure_type = isMag ? 'application/x-bittorrent' : 'application/octet-stream'; } - return info; }) )
7ad962a6c4d84cbb5c155afc559096f1d8f38ea4
2023-01-07 06:04:02
dependabot[bot]
chore(deps-dev): bump @vuepress/shared-utils from 1.9.7 to 1.9.8 (#11571)
false
bump @vuepress/shared-utils from 1.9.7 to 1.9.8 (#11571)
chore
diff --git a/package.json b/package.json index f55d332a8f0ad9..57e23611ae9048 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@vuepress/plugin-back-to-top": "1.9.7", "@vuepress/plugin-google-analytics": "1.9.8", "@vuepress/plugin-pwa": "1.9.8", - "@vuepress/shared-utils": "1.9.7", + "@vuepress/shared-utils": "1.9.8", "cross-env": "7.0.3", "eslint": "8.31.0", "eslint-config-prettier": "8.6.0", diff --git a/yarn.lock b/yarn.lock index 9bbd0a86f19908..3e2e642d03502e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2352,21 +2352,6 @@ dependencies: "@vuepress/types" "1.9.8" -"@vuepress/[email protected]": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.9.7.tgz#f1203c7f48e9d546078f5f9b2ec5200b29da481b" - integrity sha512-lIkO/eSEspXgVHjYHa9vuhN7DuaYvkfX1+TTJDiEYXIwgwqtvkTv55C+IOdgswlt0C/OXDlJaUe1rGgJJ1+FTw== - dependencies: - chalk "^2.3.2" - escape-html "^1.0.3" - fs-extra "^7.0.1" - globby "^9.2.0" - gray-matter "^4.0.1" - hash-sum "^1.0.2" - semver "^6.0.0" - toml "^3.0.0" - upath "^1.1.0" - "@vuepress/[email protected]", "@vuepress/shared-utils@^1.2.0": version "1.9.8" resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.9.8.tgz#1ecaf148409001fee9c00c6951dc719c9a279523"
e4deee086f20a7d0c7550a6200a1b16c4578ac96
2024-10-14 20:48:02
Tsuyumi
feat(route): add route for skeb (#17047)
false
add route for skeb (#17047)
feat
diff --git a/lib/config.ts b/lib/config.ts index e2e0e162f8794f..eaf103dddb8f0d 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -266,6 +266,9 @@ export type Config = { scihub: { host?: string; }; + skeb: { + bearerToken?: string; + }; spotify: { clientId?: string; clientSecret?: string; @@ -655,6 +658,9 @@ const calculateValue = () => { scihub: { host: envs.SCIHUB_HOST || 'https://sci-hub.se/', }, + skeb: { + bearerToken: envs.SKEB_BEARER_TOKEN, + }, spotify: { clientId: envs.SPOTIFY_CLIENT_ID, clientSecret: envs.SPOTIFY_CLIENT_SECRET, diff --git a/lib/routes/skeb/following-creators.ts b/lib/routes/skeb/following-creators.ts new file mode 100644 index 00000000000000..ac1f7840c2750d --- /dev/null +++ b/lib/routes/skeb/following-creators.ts @@ -0,0 +1,52 @@ +import { Data, DataItem, Route } from '@/types'; +import { config } from '@/config'; +import ConfigNotFoundError from '@/errors/types/config-not-found'; +import { getFollowingsItems } from './utils'; + +export const route: Route = { + path: '/following_creators/:username', + categories: ['picture'], + example: '/following_creators/@brm2_1925', + parameters: { username: 'Skeb Username with @' }, + features: { + requireConfig: [ + { + name: 'SKEB_BEARER_TOKEN', + optional: false, + description: '在瀏覽器開發者工具(F12)的主控台中輸入 `localStorage.getItem("token")` 獲取', + }, + ], + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Following Creators', + maintainers: ['SnowAgar25'], + handler, + radar: [ + { + title: 'Following Creators', + source: ['skeb.jp/:username'], + target: '/following_creators/:username', + }, + ], + description: 'Get the list of creators the specified user is following on Skeb.', +}; + +async function handler(ctx): Promise<Data> { + const username = ctx.req.param('username'); + + if (!config.skeb || !config.skeb.bearerToken) { + throw new ConfigNotFoundError('Skeb followings RSS is disabled due to the lack of relevant config'); + } + + const items = await getFollowingsItems(username, 'following_creators'); + + return { + title: `Skeb - ${username} - フォロー中のクリエイター`, + link: `https://skeb.jp/${username}`, + item: items as DataItem[], + }; +} diff --git a/lib/routes/skeb/following-works.ts b/lib/routes/skeb/following-works.ts new file mode 100644 index 00000000000000..227d31f9f4a178 --- /dev/null +++ b/lib/routes/skeb/following-works.ts @@ -0,0 +1,52 @@ +import { Data, DataItem, Route } from '@/types'; +import { config } from '@/config'; +import ConfigNotFoundError from '@/errors/types/config-not-found'; +import { getFollowingsItems } from './utils'; + +export const route: Route = { + path: '/following_works/:username', + categories: ['picture'], + example: '/following_works/@brm2_1925', + parameters: { username: 'Skeb Username with @' }, + features: { + requireConfig: [ + { + name: 'SKEB_BEARER_TOKEN', + optional: false, + description: '在瀏覽器開發者工具(F12)的主控台中輸入 `localStorage.getItem("token")` 獲取', + }, + ], + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Following Works', + maintainers: ['SnowAgar25'], + handler, + radar: [ + { + title: 'Following Works', + source: ['skeb.jp/:username'], + target: '/following_works/:username', + }, + ], + description: "Get the latest works for the specified user's followings on Skeb.", +}; + +async function handler(ctx): Promise<Data> { + const username = ctx.req.param('username'); + + if (!config.skeb || !config.skeb.bearerToken) { + throw new ConfigNotFoundError('Skeb followings RSS is disabled due to the lack of relevant config'); + } + + const items = await getFollowingsItems(username, 'following_works'); + + return { + title: `Skeb - ${username} - フォロー中のクリエイターの新着作品`, + link: `https://skeb.jp/${username}`, + item: items as DataItem[], + }; +} diff --git a/lib/routes/skeb/friend-works.ts b/lib/routes/skeb/friend-works.ts new file mode 100644 index 00000000000000..43d22528e0b3e8 --- /dev/null +++ b/lib/routes/skeb/friend-works.ts @@ -0,0 +1,52 @@ +import { Data, DataItem, Route } from '@/types'; +import { config } from '@/config'; +import ConfigNotFoundError from '@/errors/types/config-not-found'; +import { getFollowingsItems } from './utils'; + +export const route: Route = { + path: '/friend_works/:username', + categories: ['picture'], + example: '/friend_works/@brm2_1925', + parameters: { username: 'Skeb Username with @' }, + features: { + requireConfig: [ + { + name: 'SKEB_BEARER_TOKEN', + optional: false, + description: '在瀏覽器開發者工具(F12)的主控台中輸入 `localStorage.getItem("token")` 獲取', + }, + ], + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Friend Works', + maintainers: ['SnowAgar25'], + handler, + radar: [ + { + title: 'Friend Works', + source: ['skeb.jp/:username'], + target: '/friend_works/:username', + }, + ], + description: "Get the latest requests for the specified user's followings on Skeb.", +}; + +async function handler(ctx): Promise<Data> { + const username = ctx.req.param('username'); + + if (!config.skeb || !config.skeb.bearerToken) { + throw new ConfigNotFoundError('Skeb followings RSS is disabled due to the lack of relevant config'); + } + + const items = await getFollowingsItems(username, 'friend_works'); + + return { + title: `Skeb - ${username} - フォロー中のクライアントの新着リクエスト`, + link: `https://skeb.jp/${username}`, + item: items as DataItem[], + }; +} diff --git a/lib/routes/skeb/index.ts b/lib/routes/skeb/index.ts new file mode 100644 index 00000000000000..24420fe9fd4ea1 --- /dev/null +++ b/lib/routes/skeb/index.ts @@ -0,0 +1,131 @@ +import { Route, Data, DataItem } from '@/types'; +import ofetch from '@/utils/ofetch'; +import cache from '@/utils/cache'; +import { baseUrl, processWork, processCreator } from './utils'; +import { config } from '@/config'; + +const categoryMap = { + // Works categories + new_art_works: '新着作品 (Illust)', + new_voice_works: '新着作品 (Voice)', + new_novel_works: '新着作品 (Novel)', + new_video_works: '新着作品 (Video)', + new_music_works: '新着作品 (Music)', + new_correction_works: '新着作品 (Advice)', + new_comic_works: '新着作品 (Comic)', + popular_works: '人気の作品 (Popular)', + // Creators categories + popular_creators: '人気クリエイター', + new_creators: '新着クリエイター', +}; + +const workCategories = new Set(['new_art_works', 'new_voice_works', 'new_novel_works', 'new_video_works', 'new_music_works', 'new_correction_works', 'new_comic_works', 'popular_works']); + +export const route: Route = { + path: '/:category', + categories: ['picture'], + example: '/new_art_works', + parameters: { category: 'Category, the div id of the section title on the homepage. Default is new_art_works' }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Skeb', + maintainers: ['SnowAgar25'], + handler, + radar: [ + { + title: '新着作品 (Illust)', + source: ['skeb.jp'], + target: '/new_art_works', + }, + { + title: '新着作品 (Voice)', + source: ['skeb.jp'], + target: '/new_voice_works', + }, + { + title: '新着作品 (Novel)', + source: ['skeb.jp'], + target: '/new_novel_works', + }, + { + title: '新着作品 (Video)', + source: ['skeb.jp'], + target: '/new_video_works', + }, + { + title: '新着作品 (Music)', + source: ['skeb.jp'], + target: '/new_music_works', + }, + { + title: '新着作品 (Advice)', + source: ['skeb.jp'], + target: '/new_correction_works', + }, + { + title: '新着作品 (Comic)', + source: ['skeb.jp'], + target: '/new_comic_works', + }, + { + title: '人気の作品 (Popular)', + source: ['skeb.jp'], + target: '/popular_works', + }, + { + title: '人気クリエイター', + source: ['skeb.jp'], + target: '/popular_creators', + }, + { + title: '新着クリエイター', + source: ['skeb.jp'], + target: '/new_creators', + }, + ], +}; + +async function handler(ctx): Promise<Data> { + const category = ctx.req.param('category') || 'new_art_works'; + + if (!(category in categoryMap)) { + throw new Error('Invalid category'); + } + + const url = `${baseUrl}/api`; + + const apiData = await cache.tryGet( + url, + async () => { + const data = await ofetch(url); + return data; + }, + config.cache.routeExpire, + false + ); + + if (!apiData || typeof apiData !== 'object') { + throw new Error('Invalid data received from API'); + } + + const items = await cache.tryGet(category, async () => { + if (!(category in apiData) || !Array.isArray(apiData[category])) { + return []; + } + + const processItem = workCategories.has(category) ? processWork : processCreator; + return (await Promise.all(apiData[category].map(async (item) => await processItem(item)).filter(Boolean))) as DataItem[]; + }); + + return { + title: `Skeb - ${categoryMap[category]}`, + link: `${baseUrl}/#${category}`, + item: items as DataItem[], + }; +} diff --git a/lib/routes/skeb/namespace.ts b/lib/routes/skeb/namespace.ts new file mode 100644 index 00000000000000..90499f96e4ab5f --- /dev/null +++ b/lib/routes/skeb/namespace.ts @@ -0,0 +1,6 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'Skeb', + url: 'skeb.jp', +}; diff --git a/lib/routes/skeb/search.ts b/lib/routes/skeb/search.ts new file mode 100644 index 00000000000000..c2a8300f26b10f --- /dev/null +++ b/lib/routes/skeb/search.ts @@ -0,0 +1,77 @@ +import { Data, DataItem, Route } from '@/types'; +import cache from '@/utils/cache'; +import ofetch from '@/utils/ofetch'; +import { processWork, baseUrl } from './utils'; +import InvalidParameterError from '@/errors/types/invalid-parameter'; + +export const route: Route = { + path: '/search/:keyword', + categories: ['picture'], + example: '/search/初音ミク', + parameters: { keyword: 'Search keyword' }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Search Results', + maintainers: ['SnowAgar25'], + handler, + description: 'Get the search results for works on Skeb', +}; + +async function handler(ctx): Promise<Data> { + const keyword = ctx.req.param('keyword'); + + if (!keyword) { + throw new InvalidParameterError('Invalid search keyword'); + } + + const url = 'https://hb1jt3kre9-dsn.algolia.net/1/indexes/*/queries'; + + const items = await cache.tryGet(`skeb:search:${keyword}`, async () => { + const data = await ofetch(url, { + method: 'POST', + headers: { + 'x-algolia-application-id': 'HB1JT3KRE9', + 'x-algolia-api-key': '9a4ce7d609e71bf29e977925e4c6740c', + }, + body: { + requests: [ + { + indexName: 'User', + query: keyword, + params: 'hitsPerPage=40', + filters: 'genres:art OR genres:comic OR genres:voice OR genres:novel OR genres:video OR genres:music OR genres:correction', + }, + { + indexName: 'Request', + query: keyword, + params: 'hitsPerPage=40&filters=genre%3Aart%20OR%20genre%3Acomic%20OR%20genre%3Avoice%20OR%20genre%3Anovel%20OR%20genre%3Avideo%20OR%20genre%3Amusic%20OR%20genre%3Acorrection', + }, + ], + }, + }); + + if (!data || !data.results || !Array.isArray(data.results) || data.results.length < 2) { + throw new Error('Invalid data received from API'); + } + + const works = data.results[1].hits; + + if (!Array.isArray(works)) { + throw new TypeError('Invalid hits data received from API'); + } + + return works.map((item) => processWork(item)).filter(Boolean); + }); + + return { + title: `Skeb - Search Results for "${keyword}"`, + link: `${baseUrl}/search?q=${encodeURIComponent(keyword)}`, + item: items as DataItem[], + }; +} diff --git a/lib/routes/skeb/templates/creator.art b/lib/routes/skeb/templates/creator.art new file mode 100644 index 00000000000000..bb64c9a1b962c6 --- /dev/null +++ b/lib/routes/skeb/templates/creator.art @@ -0,0 +1,8 @@ +{{ if avatarUrl }} + <img src="{{ avatarUrl }}" /> +{{ /if }} +<p>委託狀況(Accepting Commissions):{{ acceptingCommissions }}</p> +<p>NSFW:{{ nsfwAcceptable }}</p> +{{ if skills }} + <p>類型(Genre):{{ skills }}</p> +{{ /if }} diff --git a/lib/routes/skeb/templates/work.art b/lib/routes/skeb/templates/work.art new file mode 100644 index 00000000000000..6c0903453d7584 --- /dev/null +++ b/lib/routes/skeb/templates/work.art @@ -0,0 +1,10 @@ +{{ if imageUrl }} + <img src="{{ imageUrl }}" /><br> +{{ /if }} +{{ if audioUrl }} + <audio controls> + <source src="{{ audioUrl }}" type="audio/mp3"> + Your browser does not support the audio element. + </audio><br> +{{ /if }} +{{ body }} diff --git a/lib/routes/skeb/utils.ts b/lib/routes/skeb/utils.ts new file mode 100644 index 00000000000000..bb8275ed2c6565 --- /dev/null +++ b/lib/routes/skeb/utils.ts @@ -0,0 +1,155 @@ +import { config } from '@/config'; +import { DataItem } from '@/types'; +import cache from '@/utils/cache'; +import ofetch from '@/utils/ofetch'; +import { art } from '@/utils/render'; +import path from 'node:path'; +import { getCurrentPath } from '@/utils/helpers'; + +const __dirname = getCurrentPath(import.meta.url); + +export const baseUrl = 'https://skeb.jp'; + +interface Work { + path: string; + private_thumbnail_image_urls: null | string; + private: boolean; + genre: string; + tipped: boolean; + creator_id: number; + client_id: number; + vtt_url: null | string; + thumbnail_image_urls: { + src: string; + srcset: string; + }; + preview_url: null | string; + duration: null | number; + nsfw: boolean; + hardcore: boolean; + consored_thumbnail_image_urls: { + src: string; + srcset: string; + }; + body: string; + nc: number; + word_count: number; + transcoder: string; + creator_acceptable_same_genre: boolean; +} + +interface Creator { + id: number; + creator: boolean; + nsfw_acceptable: boolean; + acceptable: boolean; + name: string; + screen_name: string; + avatar_url: string; + header_url: string | null; + appeal_receivable: boolean; + popular_creator_rank: number | null; + request_master_rank: number | null; + first_requester_rank: number | null; + deleted_at: string | null; + tip_acceptable_by: string; + accept_expiration_days: number; + skills: { genre: string }[]; + nc: number; +} + +export function processWork(work: Work): DataItem | null { + if (!work || typeof work !== 'object' || work.private === true) { + return null; + } + + const imageUrl = work.thumbnail_image_urls?.srcset?.split(',').pop()?.trim().split(' ')[0] || ''; + const body = work.body || ''; + + const audioUrl = work.genre === 'music' || work.genre === 'voice' ? work.preview_url : null; + + const renderedHtml = art(path.join(__dirname, 'templates/work.art'), { + imageUrl, + body, + audioUrl, + }); + + return { + title: work.path || '', + link: `${baseUrl}${work.path || ''}`, + description: renderedHtml, + }; +} + +const skillMap = { + art: 'Illust', + voice: 'Voice', + novel: 'Novel', + video: 'Video', + music: 'Music', + correction: 'Advice', + comic: 'Comic', +}; + +export function processCreator(creator: Creator): DataItem | null { + if (!creator || typeof creator !== 'object') { + return null; + } + + const avatarUrl = creator.avatar_url || ''; + + let renderedHtml; + + if (creator.creator) { + const acceptingCommissions = creator.acceptable ? 'Yes' : 'No'; + const nsfwAcceptable = creator.nsfw_acceptable ? 'Yes' : 'No'; + + let skills = ''; + if (Array.isArray(creator.skills) && creator.skills.length > 0) { + skills = creator.skills + .map((skill) => skillMap[skill.genre] || skill.genre) + .filter(Boolean) + .join(', '); + } + + renderedHtml = art(path.join(__dirname, 'templates/creator.art'), { + avatarUrl, + acceptingCommissions, + nsfwAcceptable, + skills, + }); + } + + return { + title: creator.name || '', + link: `${baseUrl}/@${creator.screen_name || ''}`, + description: renderedHtml, + }; +} + +export async function getFollowingsItems(username: string, path: 'friend_works' | 'following_works' | 'following_creators'): Promise<DataItem[]> { + const url = `${baseUrl}/api/users/${username.replace('@', '')}/followings`; + + const followings_data = await cache.tryGet( + `skeb:followings_data:${username}`, + async () => { + const data = await ofetch(url, { + headers: { + Authorization: `Bearer ${config.skeb.bearerToken}`, + }, + }); + return data; + }, + config.cache.routeExpire, + false + ); + + if (!followings_data || typeof followings_data !== 'object') { + throw new Error('Failed to fetch followings data'); + } + + if (path === 'following_creators') { + return followings_data[path].map((item) => processCreator(item)).filter(Boolean) as DataItem[]; + } + return followings_data[path].map((item) => processWork(item)).filter(Boolean) as DataItem[]; +} diff --git a/lib/routes/skeb/works.ts b/lib/routes/skeb/works.ts new file mode 100644 index 00000000000000..6c80a85596d79e --- /dev/null +++ b/lib/routes/skeb/works.ts @@ -0,0 +1,88 @@ +import { Data, DataItem, Route } from '@/types'; +import { config } from '@/config'; +import ConfigNotFoundError from '@/errors/types/config-not-found'; +import { baseUrl, processWork } from './utils'; +import cache from '@/utils/cache'; +import ofetch from '@/utils/ofetch'; + +export const route: Route = { + path: '/works/:username', + categories: ['picture'], + example: '/works/@brm2_1925', + parameters: { username: 'Skeb Username with @' }, + features: { + requireConfig: [ + { + name: 'SKEB_BEARER_TOKEN', + optional: false, + description: '在瀏覽器開發者工具(F12)的主控台中輸入 `localStorage.getItem("token")` 獲取', + }, + ], + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Creator Works', + maintainers: ['SnowAgar25'], + handler, + radar: [ + { + title: 'Creator Works', + source: ['skeb.jp/:username'], + target: '/works/:username', + }, + ], + description: 'Get the latest works of a specific creator on Skeb', +}; + +async function handler(ctx): Promise<Data> { + const username = ctx.req.param('username'); + + if (!config.skeb || !config.skeb.bearerToken) { + throw new ConfigNotFoundError('Skeb works RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>'); + } + + const url = `${baseUrl}/api/users/${username.replace('@', '')}/works`; + + const items = await cache.tryGet(url, async () => { + const fetchData = async (retryCount = 0, maxRetries = 3) => { + const data = await ofetch(url, { + retry: 0, + method: 'GET', + query: { role: 'creator', sort: 'date', offset: '0' }, + headers: { + 'User-Agent': config.ua, + Cookie: `request_key=${cache.get('skeb:request_key')}`, + Authorization: `Bearer ${config.skeb.bearerToken}`, + }, + }).catch((error) => { + if (retryCount >= maxRetries) { + throw new Error('Max retries reached'); + } + const newRequestKey = error.response?._data?.match(/request_key=(.*?);/)?.[1]; + if (newRequestKey) { + cache.set('skeb:request_key', newRequestKey); + return fetchData(retryCount + 1, maxRetries); + } + throw error; + }); + return data; + }; + + const data = await fetchData(); + + if (!data || !Array.isArray(data)) { + throw new Error('Invalid data received from API'); + } + + return data.map((item) => processWork(item)).filter(Boolean); + }); + + return { + title: `Skeb - ${username}'s Works`, + link: `${baseUrl}/${username}`, + item: items as DataItem[], + }; +}
031869011998873e9dbd8f87b6317650fe474005
2020-10-24 22:52:06
dependabot-preview[bot]
chore(deps): bump @sentry/node from 5.27.0 to 5.27.1
false
bump @sentry/node from 5.27.0 to 5.27.1
chore
diff --git a/package.json b/package.json index 1fdc87d5700f84..35264315c1d813 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "dependencies": { "@koa/router": "9.4.0", "@postlight/mercury-parser": "2.2.0", - "@sentry/node": "5.27.0", + "@sentry/node": "5.27.1", "aes-js": "3.1.2", "art-template": "4.13.2", "cheerio": "1.0.0-rc.3", diff --git a/yarn.lock b/yarn.lock index 0cbdd94f5bd2d9..c0aa78c5394bd7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1345,72 +1345,72 @@ dependencies: safe-buffer "^5.0.1" -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.27.0.tgz#661b2fd1beecaa37c013a6c364330fa29c847b3c" - integrity sha512-ddvAxVszsHzFzGedii1NxfKU3GxAEGJV5eXNlA2hqS0/OKl+IOjuI6aJjg55LMTEEejqr9djXqDMk6y5av6UKg== - dependencies: - "@sentry/hub" "5.27.0" - "@sentry/minimal" "5.27.0" - "@sentry/types" "5.27.0" - "@sentry/utils" "5.27.0" +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.27.1.tgz#489604054d821e1de155f80fe650085b37cad235" + integrity sha512-n5CxzMbOAT6HZK4U4cOUAAikkRnnHhMNhInrjfZh7BoiuX1k63Hru2H5xk5WDuEaTTr5RaBA/fqPl7wxHySlwQ== + dependencies: + "@sentry/hub" "5.27.1" + "@sentry/minimal" "5.27.1" + "@sentry/types" "5.27.1" + "@sentry/utils" "5.27.1" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.0.tgz#dcd7b36d216997f0283bd3334cbce8004d56ef89" - integrity sha512-Qe4nndgDEY8n3kKEWJTw5M201dgsoB9ZQ10483cVpGCtOfZZuzXEr4EaLG3BefH8YFvlgUP3YlxD7XFoJioRjg== +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.1.tgz#c95faaf18257c365acc09246fafd27276bfd6a2f" + integrity sha512-RBHo3T92s6s4Ian1pZcPlmNtFqB+HAP6xitU+ZNA48bYUK+R1vvqEcI8Xs83FyNaRGCgclp9erDFQYyAuxY4vw== dependencies: - "@sentry/types" "5.27.0" - "@sentry/utils" "5.27.0" + "@sentry/types" "5.27.1" + "@sentry/utils" "5.27.1" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.0.tgz#8c2fdcf9cd1e59d8ff1848a7905bac304f8e206b" - integrity sha512-KidWjo2jNd8IwPhEIDC0YddjwuIdVxTEsmpRkZ6afuiR5rMQsiqA0EwsndWiAjs67qxQRj/VD/1Xghxe0nHzXQ== +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.1.tgz#d6ce881ba3c262db29520177a4c1f0e0f5388697" + integrity sha512-MHXCeJdA1NAvaJuippcM8nrWScul8iTN0Q5nnFkGctGIGmmiZHTXAYkObqJk7H3AK+CP7r1jqN2aQj5Nd9CtyA== dependencies: - "@sentry/hub" "5.27.0" - "@sentry/types" "5.27.0" + "@sentry/hub" "5.27.1" + "@sentry/types" "5.27.1" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.27.0.tgz#5fdf377eb66140ddb405b48f23a9354d2e24fa98" - integrity sha512-Fsl6gkRKB2rnJCp32Vo5lhFOSZ32QxGRvWWddLJo/WrndAQbz17Rk+rdF3c6WTvnC9VBGZi7jEzIphpna4XcQg== +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.27.1.tgz#17f94e46a42ebdec41996c4783714a64b8d74774" + integrity sha512-OJCpUK6bbWlDCqiTZVP4ybQQDSly2EafbvvO7hoQ5ktr87WkRCgLpTNI7Doa5ANGuLNnVUvRNIsIH1DJqLZLNg== dependencies: - "@sentry/core" "5.27.0" - "@sentry/hub" "5.27.0" - "@sentry/tracing" "5.27.0" - "@sentry/types" "5.27.0" - "@sentry/utils" "5.27.0" + "@sentry/core" "5.27.1" + "@sentry/hub" "5.27.1" + "@sentry/tracing" "5.27.1" + "@sentry/types" "5.27.1" + "@sentry/utils" "5.27.1" cookie "^0.4.1" https-proxy-agent "^5.0.0" lru_map "^0.3.3" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.27.0.tgz#133b03a02640a0d63d11f341a00e96315c9d0303" - integrity sha512-h82VmO4loeWd5bMFgNWBO+eY6bEpPt5iRc1YZouC10fouhlzw2O4p2A4n1/rVQ+eIKAsfkkgsjEuKBnTPxDAsw== +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.27.1.tgz#198cd97514363369d29eef9b597be9332ab170c4" + integrity sha512-GBmdR8Ky/nv4KOa6+DEnOSBkFOFhM+asR8Y/gw2qSUWCwzKuWHh9BEnDwxtSI8CMvgUwOIZ5wiiqJGc1unYfCw== dependencies: - "@sentry/hub" "5.27.0" - "@sentry/minimal" "5.27.0" - "@sentry/types" "5.27.0" - "@sentry/utils" "5.27.0" + "@sentry/hub" "5.27.1" + "@sentry/minimal" "5.27.1" + "@sentry/types" "5.27.1" + "@sentry/utils" "5.27.1" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.0.tgz#cea288d02c727ef83541768b8738e6a829dfc831" - integrity sha512-coB2bMDxmzTwIWcXbzbnE2JtEqDkvmK9+KyZZNI/Mk3wwabFYqL7hOnqXB45/+hx+6l9/siWmB1l5um3tzqdOw== +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.1.tgz#031480a4cf8f0b6e6337fb03ee884deedcef6f40" + integrity sha512-g1aX0V0fz5BTo0mjgSVY9XmPLGZ6p+8OEzq3ubKzDUf59VHl+Vt8viZ8VXw/vsNtfAjBHn7BzSuzJo7cXJJBtA== -"@sentry/[email protected]": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.0.tgz#21c15401b43041b1208521465c09c64eafc2e0ff" - integrity sha512-XrdoxOsjqF9AVmeCefNgY0r3lvZBj34bzsG3TI8Z1bjQKB3iF/2yAI/bdo+sUqAiJiiPSk5p6SiPkyeTsSdBhg== +"@sentry/[email protected]": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.1.tgz#0ed9d9685aae6f4ef9eb6b9ebb81e361fd1c5452" + integrity sha512-VIzK8utuvFO9EogZcKJPgmLnlJtYbaPQ0jCw7od9HRw1ckrSBc84sA0uuuY6pB6KSM+7k6EjJ5IdIBaCz5ep/A== dependencies: - "@sentry/types" "5.27.0" + "@sentry/types" "5.27.1" tslib "^1.9.3" "@sindresorhus/is@^0.14.0":
7d72fcc2c9160112e87f0f135034f247a2c6b637
2018-07-28 18:16:09
DIYgod
docs: update vuepress; use service work
false
update vuepress; use service work
docs
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 3bcc1bb3419301..f9499800638a06 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -2,11 +2,18 @@ module.exports = { title: 'RSSHub', description: '🍰 万物皆可 RSS', ga: 'UA-48084758-10', - serviceWorker: false, + serviceWorker: true, themeConfig: { repo: 'DIYgod/RSSHub', editLinks: true, - editLinkText: '帮助我们改善此页面!', + editLinkText: '在 GitHub 上编辑此页', + lastUpdated: '上次更新', + serviceWorker: { + updatePopup: { + message: '发现新内容可用', + buttonText: '刷新', + }, + }, docsDir: 'docs', nav: [ { diff --git a/package.json b/package.json index 55934123e2d4d3..e5d62fbeefacbb 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lint-staged": "^7.2.0", "prettier": "^1.13.7", "prettier-check": "^2.0.0", - "vuepress": "0.12.0", + "vuepress": "0.13.0", "yorkie": "^1.0.3" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index 3a50f530fb9a29..af56f03e34eafd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6022,9 +6022,9 @@ regexpu-core@^4.1.3, regexpu-core@^4.1.4: unicode-match-property-ecmascript "^1.0.3" unicode-match-property-value-ecmascript "^1.0.1" -register-service-worker@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/register-service-worker/-/register-service-worker-1.2.0.tgz#c0472dcc856e391ba7a87c0aa96c4f6cf1aec67c" +register-service-worker@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/register-service-worker/-/register-service-worker-1.4.1.tgz#4b4c9b4200fc697942c6ae7d611349587b992b2f" registry-auth-token@^3.0.1: version "3.3.2" @@ -7196,9 +7196,9 @@ vuepress-html-webpack-plugin@^3.2.0: toposort "^1.0.0" util.promisify "1.0.0" [email protected]: - version "0.12.0" - resolved "https://registry.npmjs.org/vuepress/-/vuepress-0.12.0.tgz#1a268c34622fa5869db3883da5e0f9ef8609d5a0" [email protected]: + version "0.13.0" + resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-0.13.0.tgz#7959feeb8c4bbd1cd96238383566182419576d5d" dependencies: "@babel/core" "7.0.0-beta.47" "@vue/babel-preset-app" "3.0.0-beta.11" @@ -7238,7 +7238,7 @@ [email protected]: portfinder "^1.0.13" postcss-loader "^2.1.5" prismjs "^1.13.0" - register-service-worker "^1.2.0" + register-service-worker "^1.4.1" semver "^5.5.0" stylus "^0.54.5" stylus-loader "^3.0.2"
fe753973e2aa8dc7de98a379a33d48f2205db391
2023-06-16 23:30:40
github-actions[bot]
style: auto format
false
auto format
style
diff --git a/docs/programming.md b/docs/programming.md index ca41a70eff763b..29a45a2e9868a1 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -412,9 +412,9 @@ GitHub 官方也提供了一些 RSS: <Route author="nczitzk" example="/hacking8" path="/hacking8/:category?" :paramsDesc="['分类,见下表,默认为最近更新']"> -| 推荐 | 最近更新 | 漏洞/PoC监控 | PDF | -| ----- | -------- | ------------ | --- | -| likes | index | vul-poc | pdf | +| 推荐 | 最近更新 | 漏洞 / PoC 监控 | PDF | +| ----- | -------- | --------------- | --- | +| likes | index | vul-poc | pdf | </Route>