From b8ed6b9d9d75c8b7836347871a7f9ff57dfa6ac9 Mon Sep 17 00:00:00 2001 From: teapot1de <121592812+ywh555hhh@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:14:10 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix(radar):=20=E5=8D=97=E6=98=8C=E5=A4=A7?= =?UTF-8?q?=E5=AD=A6=20(#13992)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了radar --- lib/v2/ncu/radar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2/ncu/radar.js b/lib/v2/ncu/radar.js index cbac079da23933..1a7ca053e7ff85 100644 --- a/lib/v2/ncu/radar.js +++ b/lib/v2/ncu/radar.js @@ -1,7 +1,7 @@ module.exports = { 'ncu.edu.cn': { _name: '南昌大学', - '.': [ + 'jwc': [ { title: '教务通知', docs: 'https://docs.rsshub.app/routes/university#nan-chang-da-xue', From 6dd600b09813144026b6f586c2a9cc57b2dba274 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:15:53 +0000 Subject: [PATCH 2/7] style: auto format --- lib/v2/ncu/radar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2/ncu/radar.js b/lib/v2/ncu/radar.js index 1a7ca053e7ff85..80f68b9c4e4060 100644 --- a/lib/v2/ncu/radar.js +++ b/lib/v2/ncu/radar.js @@ -1,7 +1,7 @@ module.exports = { 'ncu.edu.cn': { _name: '南昌大学', - 'jwc': [ + jwc: [ { title: '教务通知', docs: 'https://docs.rsshub.app/routes/university#nan-chang-da-xue', From 8ec0902c0997ab8786cd68f69aa5c8e584845d16 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 8 Dec 2023 13:36:55 +0000 Subject: [PATCH 3/7] feat(route): routledge (#13993) --- lib/v2/routledge/book-series.js | 78 ++++++++++++++++++++++ lib/v2/routledge/maintainer.js | 3 + lib/v2/routledge/radar.js | 13 ++++ lib/v2/routledge/router.js | 3 + lib/v2/routledge/templates/description.art | 7 ++ website/docs/routes/journal.mdx | 6 ++ 6 files changed, 110 insertions(+) create mode 100644 lib/v2/routledge/book-series.js create mode 100644 lib/v2/routledge/maintainer.js create mode 100644 lib/v2/routledge/radar.js create mode 100644 lib/v2/routledge/router.js create mode 100644 lib/v2/routledge/templates/description.art diff --git a/lib/v2/routledge/book-series.js b/lib/v2/routledge/book-series.js new file mode 100644 index 00000000000000..f876a10d784efa --- /dev/null +++ b/lib/v2/routledge/book-series.js @@ -0,0 +1,78 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const { join } = require('path'); + +module.exports = async (ctx) => { + const { bookName, bookId } = ctx.params; + const baseUrl = 'https://www.routledge.com'; + const pageUrl = `${baseUrl}/${bookName}/book-series/${bookId}`; + const { data: response } = await got(pageUrl, { + headers: { + accept: 'text/html, */*; q=0.01', + }, + searchParams: { + publishedFilter: 'alltitles', + pd: 'published,forthcoming', + pg: 1, + pp: 12, + so: 'pub', + view: 'list', + }, + }); + const $ = cheerio.load(response); + + const list = $('.row.book') + .toArray() + .map((item) => { + item = $(item); + const title = item.find('h3 a'); + const description = item.find('p.description'); + const meta = item.find('p.description').prev().text().split('\n'); + return { + title: title.text(), + link: title.attr('href'), + description: description.text(), + pubDate: parseDate(meta.pop().trim(), 'MMMM DD, YYYY'), + author: meta + .map((i) => i.trim()) + .filter((i) => i) + .join(', '), + }; + }); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data } = await got(item.link); + const $ = cheerio.load(data); + const isbn = $('meta[property="books:isbn"]').attr('content'); + const { data: image } = await got('https://productimages.routledge.com', { + searchParams: { + isbn, + size: 'amazon', + ext: 'jpg', + }, + }); + + const description = $('.sticky-div'); + description.find('button.accordion-button').contents().unwrap(); + description.find('.fa-shopping-cart').parent().parent().remove(); + + item.description = art(join(__dirname, 'templates/description.art'), { + image, + description: description.html(), + }); + return item; + }) + ) + ); + + ctx.state.data = { + title: $('head title').text(), + description: $('head meta[name="description"]').attr('content'), + link: pageUrl, + item: items, + }; +}; diff --git a/lib/v2/routledge/maintainer.js b/lib/v2/routledge/maintainer.js new file mode 100644 index 00000000000000..7c3f1201e895d5 --- /dev/null +++ b/lib/v2/routledge/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:bookName/book-series/:bookId': ['TonyRL'], +}; diff --git a/lib/v2/routledge/radar.js b/lib/v2/routledge/radar.js new file mode 100644 index 00000000000000..2eb39553b6df2e --- /dev/null +++ b/lib/v2/routledge/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'routledge.com': { + _name: 'Routledge', + '.': [ + { + title: 'Book Series', + docs: 'https://docs.rsshub.app/routes/journals#routledge', + source: ['/:bookName/book-series/:bookId'], + target: '/routledge/:bookName/book-series/:bookId', + }, + ], + }, +}; diff --git a/lib/v2/routledge/router.js b/lib/v2/routledge/router.js new file mode 100644 index 00000000000000..51935b6e99be8a --- /dev/null +++ b/lib/v2/routledge/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/:bookName/book-series/:bookId', require('./book-series')); +}; diff --git a/lib/v2/routledge/templates/description.art b/lib/v2/routledge/templates/description.art new file mode 100644 index 00000000000000..d7f9b4d48c9351 --- /dev/null +++ b/lib/v2/routledge/templates/description.art @@ -0,0 +1,7 @@ +{{ if image }} +
+{{ /if }} + +{{ if description }} +{{@ description }} +{{ /if }} diff --git a/website/docs/routes/journal.mdx b/website/docs/routes/journal.mdx index 8ab97e3200c214..efcec0bdf25ac0 100644 --- a/website/docs/routes/journal.mdx +++ b/website/docs/routes/journal.mdx @@ -411,6 +411,12 @@ In `https://pubmed.ncbi.nlm.nih.gov/trending/?filter=simsearch1.fha&filter=pubt. +## Routledge {#routledge} + +### Book Series {#routledge-book-series} + + + ## Royal Society of Chemistry {#royal-society-of-chemistry} ### Journal {#royal-society-of-chemistry-journal} From faefb73a4f84f2586e3a0fdc47b5fd468cc78b33 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 8 Dec 2023 13:54:36 +0000 Subject: [PATCH 4/7] docs: update github id (#13994) refs: https://github.com/DIYgod/RSSHub/pull/12087 --- lib/v2/1point3acres/maintainer.js | 4 ++-- lib/v2/amazon/maintainer.js | 2 +- lib/v2/arcteryx/maintainer.js | 6 +++--- lib/v2/bellroy/maintainer.js | 2 +- lib/v2/ifi-audio/maintainer.js | 2 +- lib/v2/inoreader/maintainer.js | 2 +- lib/v2/leetcode/maintainer.js | 2 +- lib/v2/magazinelib/maintainer.js | 2 +- lib/v2/patagonia/maintainer.js | 2 +- lib/v2/snowpeak/maintainer.js | 2 +- lib/v2/sony/maintainer.js | 2 +- lib/v2/techcrunch/maintainer.js | 2 +- lib/v2/theatlantic/maintainer.js | 2 +- lib/v2/wechat/maintainer.js | 2 +- lib/v2/zagg/maintainer.js | 2 +- website/docs/routes/bbs.mdx | 4 ++-- website/docs/routes/new-media.mdx | 4 ++-- website/docs/routes/program-update.mdx | 6 +++--- website/docs/routes/programming.mdx | 2 +- website/docs/routes/reading.mdx | 4 ++-- website/docs/routes/shopping.mdx | 14 +++++++------- website/docs/routes/traditional-media.mdx | 4 ++-- 22 files changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/v2/1point3acres/maintainer.js b/lib/v2/1point3acres/maintainer.js index 2695f2b3e6d174..086bc4f8d4d95a 100644 --- a/lib/v2/1point3acres/maintainer.js +++ b/lib/v2/1point3acres/maintainer.js @@ -1,8 +1,8 @@ module.exports = { '/blog/:category?': ['nczitzk'], '/category/:id?/:type?/:order?': ['nczitzk'], - '/offer/:year?/:major?/:school?': ['NavePnow'], - '/post/:type?/:order?': ['NavePnow', 'DIYgod', 'nczitzk'], + '/offer/:year?/:major?/:school?': ['EthanWng97'], + '/post/:type?/:order?': ['EthanWng97', 'DIYgod', 'nczitzk'], '/section/:id?/:type?/:order?': ['nczitzk'], '/user/:id/posts': ['Maecenas'], '/user/:id/threads': ['Maecenas'], diff --git a/lib/v2/amazon/maintainer.js b/lib/v2/amazon/maintainer.js index 49f1311dab125a..3eec2d2369de5e 100644 --- a/lib/v2/amazon/maintainer.js +++ b/lib/v2/amazon/maintainer.js @@ -1,4 +1,4 @@ module.exports = { '/awsblogs/:locale?': ['HankChow'], - '/kindle/software-updates': ['NavePnow'], + '/kindle/software-updates': ['EthanWng97'], }; diff --git a/lib/v2/arcteryx/maintainer.js b/lib/v2/arcteryx/maintainer.js index bf598fde4c34e6..e8862e908ec64a 100644 --- a/lib/v2/arcteryx/maintainer.js +++ b/lib/v2/arcteryx/maintainer.js @@ -1,5 +1,5 @@ module.exports = { - '/new-arrivals/:country/:gender': ['NavePnow'], - '/outlet/:country/:gender': ['NavePnow'], - '/regear/new-arrivals': ['NavePnow'], + '/new-arrivals/:country/:gender': ['EthanWng97'], + '/outlet/:country/:gender': ['EthanWng97'], + '/regear/new-arrivals': ['EthanWng97'], }; diff --git a/lib/v2/bellroy/maintainer.js b/lib/v2/bellroy/maintainer.js index 844916e7c8b471..131cd199a59430 100644 --- a/lib/v2/bellroy/maintainer.js +++ b/lib/v2/bellroy/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/new-releases': ['NavePnow'], + '/new-releases': ['EthanWng97'], }; diff --git a/lib/v2/ifi-audio/maintainer.js b/lib/v2/ifi-audio/maintainer.js index ad6161689aaab3..8388903753eb0f 100644 --- a/lib/v2/ifi-audio/maintainer.js +++ b/lib/v2/ifi-audio/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/download/:val/:id': ['NavePnow'], + '/download/:val/:id': ['EthanWng97'], }; diff --git a/lib/v2/inoreader/maintainer.js b/lib/v2/inoreader/maintainer.js index b8c34cc425e894..534744b82b5394 100644 --- a/lib/v2/inoreader/maintainer.js +++ b/lib/v2/inoreader/maintainer.js @@ -1,4 +1,4 @@ module.exports = { '/html_clip/:user/:tag/:num?': ['BeautyyuYanli'], - '/rss/:user/:tag': ['NavePnow'], + '/rss/:user/:tag': ['EthanWng97'], }; diff --git a/lib/v2/leetcode/maintainer.js b/lib/v2/leetcode/maintainer.js index f1613ca0b870e6..784f0ad4f4eaf7 100644 --- a/lib/v2/leetcode/maintainer.js +++ b/lib/v2/leetcode/maintainer.js @@ -1,6 +1,6 @@ module.exports = { '/articles': ['LogicJake'], - '/dailyquestion/:lang': ['NavePnow'], + '/dailyquestion/:lang': ['EthanWng97'], '/dailyquestion/solution/:lang': ['woaidouya123'], '/submission/:country/:user': ['NathanDai'], }; diff --git a/lib/v2/magazinelib/maintainer.js b/lib/v2/magazinelib/maintainer.js index b8e0456ba172e4..db17ba51dc18e9 100644 --- a/lib/v2/magazinelib/maintainer.js +++ b/lib/v2/magazinelib/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/latest-magazine/:query?': ['NavePnow'], + '/latest-magazine/:query?': ['EthanWng97'], }; diff --git a/lib/v2/patagonia/maintainer.js b/lib/v2/patagonia/maintainer.js index 4a52de0a946e30..7ac3d8f22cb4d4 100644 --- a/lib/v2/patagonia/maintainer.js +++ b/lib/v2/patagonia/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/patagonia/new-arrivals/:category': ['NavePnow'], + '/patagonia/new-arrivals/:category': ['EthanWng97'], }; diff --git a/lib/v2/snowpeak/maintainer.js b/lib/v2/snowpeak/maintainer.js index 0cf798e8435ac4..29c9d64cf7d38d 100644 --- a/lib/v2/snowpeak/maintainer.js +++ b/lib/v2/snowpeak/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/us/new-arrivals': ['NavePnow'], + '/us/new-arrivals': ['EthanWng97'], }; diff --git a/lib/v2/sony/maintainer.js b/lib/v2/sony/maintainer.js index 7465a0d08bccc3..738a2d7a214b21 100644 --- a/lib/v2/sony/maintainer.js +++ b/lib/v2/sony/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/downloads/:productType/:productId': ['NavePnow'], + '/downloads/:productType/:productId': ['EthanWng97'], }; diff --git a/lib/v2/techcrunch/maintainer.js b/lib/v2/techcrunch/maintainer.js index e2844fa7365287..3f5cb89d7cf285 100644 --- a/lib/v2/techcrunch/maintainer.js +++ b/lib/v2/techcrunch/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/news': ['NavePnow'], + '/news': ['EthanWng97'], }; diff --git a/lib/v2/theatlantic/maintainer.js b/lib/v2/theatlantic/maintainer.js index 1b6cbaac98db1a..6dd499c91aa8d5 100644 --- a/lib/v2/theatlantic/maintainer.js +++ b/lib/v2/theatlantic/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/:category': ['NavePnow'], + '/:category': ['EthanWng97'], }; diff --git a/lib/v2/wechat/maintainer.js b/lib/v2/wechat/maintainer.js index 38fbd9d87e61c3..b63ab0cb676a2e 100644 --- a/lib/v2/wechat/maintainer.js +++ b/lib/v2/wechat/maintainer.js @@ -7,7 +7,7 @@ module.exports = { '/feeds': ['tylinux'], '/mp/homepage/:biz/:hid/:cid?': ['MisteryMonster'], '/mp/msgalbum/:biz/:aid': ['MisteryMonster'], - '/sogou/:id': ['NavePnow'], + '/sogou/:id': ['EthanWng97'], '/tgchannel/:id/:mpName?/:searchQueryType?': ['LogicJake', 'Rongronggg9'], '/uread/:userid': ['kt286'], '/wechat2rss/:id': ['TonyRL'], diff --git a/lib/v2/zagg/maintainer.js b/lib/v2/zagg/maintainer.js index df9ce629fd2291..4fa84df6f150ba 100644 --- a/lib/v2/zagg/maintainer.js +++ b/lib/v2/zagg/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/new-arrivals/:query?': ['NavePnow'], + '/new-arrivals/:query?': ['EthanWng97'], }; diff --git a/website/docs/routes/bbs.mdx b/website/docs/routes/bbs.mdx index cfe143c636bce3..6abc27e750a8a9 100644 --- a/website/docs/routes/bbs.mdx +++ b/website/docs/routes/bbs.mdx @@ -1213,7 +1213,7 @@ When accessing Joeyray's Bar, `SCBOY_BBS_TOKEN` needs to be filled in `environme ### 帖子 {#yi-mu-san-fen-di-tie-zi} - + 分类 @@ -1294,7 +1294,7 @@ When accessing Joeyray's Bar, `SCBOY_BBS_TOKEN` needs to be filled in `environme ### 录取结果 {#yi-mu-san-fen-di-lu-qu-jie-guo} - + :::tip 三个 id 获取方式 diff --git a/website/docs/routes/new-media.mdx b/website/docs/routes/new-media.mdx index 50bd98ef1f8f52..1e6265b656f4a9 100644 --- a/website/docs/routes/new-media.mdx +++ b/website/docs/routes/new-media.mdx @@ -1990,7 +1990,7 @@ Member ID ### News {#techcrunch-news} - + ## TechPowerUp {#techpowerup} @@ -5769,7 +5769,7 @@ column 为 third 时可选的 category: ### 公众号(搜狗来源) {#wei-xin-gong-zhong-hao-sou-gou-lai-yuan} - + ## 维基百科 {#wei-ji-bai-ke} diff --git a/website/docs/routes/program-update.mdx b/website/docs/routes/program-update.mdx index f0b89d68e1ed83..452d7fa54e8737 100644 --- a/website/docs/routes/program-update.mdx +++ b/website/docs/routes/program-update.mdx @@ -5,7 +5,7 @@ ### Kindle Software Updates {#amazon-kindle-software-updates} - + ## AMD {#amd} @@ -374,7 +374,7 @@ Language ### Download Hub {#ifi-audio-download-hub} - + :::warning @@ -653,7 +653,7 @@ Logseq 开发团队已经放弃了 [旧网站](https://logseq.com/blog)。 ### Software Downloads {#sony-software-downloads} - + :::tip diff --git a/website/docs/routes/programming.mdx b/website/docs/routes/programming.mdx index 6ee03a34087dba..94b3c518ea876b 100644 --- a/website/docs/routes/programming.mdx +++ b/website/docs/routes/programming.mdx @@ -630,7 +630,7 @@ Subscribe to the updates (threads and submission) from a paritcular Hacker News ### Daily Question {#leetcode-daily-question} - + ### Daily Question Solution {#leetcode-daily-question-solution} diff --git a/website/docs/routes/reading.mdx b/website/docs/routes/reading.mdx index 7ea8b7dc773f8b..d73137643dd748 100644 --- a/website/docs/routes/reading.mdx +++ b/website/docs/routes/reading.mdx @@ -40,7 +40,7 @@ Eg: [https://www.inoreader.com/stream/user/1006346356/tag/News/view/html?limit=3 ### RSS {#inoreader-rss} - + ## kakuyomu {#kakuyomu} @@ -78,7 +78,7 @@ Eg: [https://kakuyomu.jp/works/1177354054883783581](https://kakuyomu.jp/works/11 ### Latest Magazine {#magazinelib-latest-magazine} - + For instance, when doing search at [https://magazinelib.com](https://magazinelib.com) and you get url `https://magazinelib.com/?s=new+yorker`, the query is `new+yorker` diff --git a/website/docs/routes/shopping.mdx b/website/docs/routes/shopping.mdx index c6583d4f6c1869..632d68122ed065 100644 --- a/website/docs/routes/shopping.mdx +++ b/website/docs/routes/shopping.mdx @@ -48,7 +48,7 @@ Parameter `time` only works when `mostwanted` is chosen as the category. ### New Arrivals {#arcteryx-new-arrivals} - + Country @@ -72,7 +72,7 @@ Parameter `country` can be found within the url of `Arcteryx` website. ### Outlet {#arcteryx-outlet} - + Country @@ -96,13 +96,13 @@ Parameter `country` can be found within the url of `Arcteryx` website. ### Regear New Arrivals {#arcteryx-regear-new-arrivals} - + ## Bellroy {#bellroy} ### New Releases {#bellroy-new-releases} - + ## booth.pm {#booth.pm} @@ -281,7 +281,7 @@ Language ### New Arrivals {#patagonia-new-arrivals} - + | Men's | Women's | Kids' & Baby | Packs & Gear | | ----- | ------- | ------------ | ------------ | @@ -299,7 +299,7 @@ Language ### New Arrivals(USA) {#snow-peak-new-arrivals-usa} - + ## The Independent {#the-independent} @@ -323,7 +323,7 @@ Language ### New Arrivals {#zagg-new-arrivals} - + For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3041`, the query is `brand=164&cat=3038%2C3041` diff --git a/website/docs/routes/traditional-media.mdx b/website/docs/routes/traditional-media.mdx index 74b074b3b6e5a8..397bfb3f4cb0e7 100644 --- a/website/docs/routes/traditional-media.mdx +++ b/website/docs/routes/traditional-media.mdx @@ -749,7 +749,7 @@ Language ### News {#the-atlantic-news} - + | Popular | Latest | Politics | Technology | Business | | ------------ | ------ | -------- | ---------- | -------- | @@ -893,7 +893,7 @@ Provides all of the articles by the specified New York Times author. ### News {#the-wall-street-journal-wsj-hua-er-jie-ri-bao-news} - + en_us From 75c718a071b652d77d771445965dd33881fdc40e Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:45:19 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat(route):=20add=20=E5=9B=BD=E5=AE=B6?= =?UTF-8?q?=E5=A4=96=E6=B1=87=E7=AE=A1=E7=90=86=E5=B1=80=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=92=A8=E8=AF=A2=20&=20=E6=8A=95=E8=AF=89=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=20(#13995)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/gov/maintainer.js | 2 + lib/v2/gov/radar.js | 25 ++++++++ lib/v2/gov/router.js | 2 + lib/v2/gov/safe/business.js | 8 +++ lib/v2/gov/safe/complaint.js | 8 +++ lib/v2/gov/safe/templates/message.art | 25 ++++++++ lib/v2/gov/safe/util.js | 87 +++++++++++++++++++++++++++ website/docs/routes/government.mdx | 51 ++++++++++++++++ 8 files changed, 208 insertions(+) create mode 100644 lib/v2/gov/safe/business.js create mode 100644 lib/v2/gov/safe/complaint.js create mode 100644 lib/v2/gov/safe/templates/message.art create mode 100644 lib/v2/gov/safe/util.js diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js index 03abde8e698071..b5bf37a17c16ad 100644 --- a/lib/v2/gov/maintainer.js +++ b/lib/v2/gov/maintainer.js @@ -49,6 +49,8 @@ module.exports = { '/pbc/tradeAnnouncement': ['nczitzk'], '/pbc/zcyj': ['Fatpandac'], '/samr/xgzlyhd/:category?/:department?': ['nczitzk'], + '/safe/bussiness/:site?': ['nczitzk'], + '/safe/complaint/:site?': ['nczitzk'], '/sasac/:path+': ['TonyRL'], '/stats/:path+': ['bigfei', 'nczitzk'], '/zhengce/govall/:advance?': ['ciaranchen'], diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js index f1d7eb875b57b2..0417214b63eee3 100644 --- a/lib/v2/gov/radar.js +++ b/lib/v2/gov/radar.js @@ -1185,6 +1185,31 @@ module.exports = { }, ], }, + 'safe.gov.cn': { + _name: '国家外汇管理局', + '.': [ + { + title: '业务咨询', + docs: 'https://docs.rsshub.app/routes/government#guo-jia-wai-hui-guan-li-ju-ye-wu-zi-xun', + source: ['/:site/ywzx/index.html'], + target: (params) => { + const site = params.site; + + return `/gov/safe/business/${site}`; + }, + }, + { + title: '投诉建议', + docs: 'https://docs.rsshub.app/routes/government#guo-jia-wai-hui-guan-li-ju-tou-su-jian-yi', + source: ['/:site/tsjy/index.html'], + target: (params) => { + const site = params.site; + + return `/gov/safe/complaint/${site}`; + }, + }, + ], + }, 'sasac.gov.cn': { _name: '国务院国有资产监督管理委员会', '.': [ diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js index 038443f0ac7c6d..2f93ef4edb4c9f 100644 --- a/lib/v2/gov/router.js +++ b/lib/v2/gov/router.js @@ -41,6 +41,8 @@ module.exports = function (router) { router.get('/pbc/gzlw', require('./pbc/gzlw')); router.get('/pbc/tradeAnnouncement', require('./pbc/tradeAnnouncement')); router.get('/pbc/zcyj', require('./pbc/zcyj')); + router.get('/safe/business/:site?', require('./safe/business')); + router.get('/safe/complaint/:site?', require('./safe/complaint')); router.get('/samr/xgzlyhd/:category?/:department?', require('./samr/xgzlyhd')); router.get('/sasac/:path+', require('./sasac/generic')); router.get(/stats(\/[\w/-]+)?/, require('./stats')); diff --git a/lib/v2/gov/safe/business.js b/lib/v2/gov/safe/business.js new file mode 100644 index 00000000000000..c9dc1c3b01c60e --- /dev/null +++ b/lib/v2/gov/safe/business.js @@ -0,0 +1,8 @@ +const { processZxfkItems } = require('./util'); + +module.exports = async (ctx) => { + const { site = 'beijing' } = ctx.params; + const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 3; + + ctx.state.data = await processZxfkItems(site, 'ywzx', limit); +}; diff --git a/lib/v2/gov/safe/complaint.js b/lib/v2/gov/safe/complaint.js new file mode 100644 index 00000000000000..d3f883be5edcfd --- /dev/null +++ b/lib/v2/gov/safe/complaint.js @@ -0,0 +1,8 @@ +const { processZxfkItems } = require('./util'); + +module.exports = async (ctx) => { + const { site = 'beijing' } = ctx.params; + const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 5; + + ctx.state.data = await processZxfkItems(site, 'tsjy', limit); +}; diff --git a/lib/v2/gov/safe/templates/message.art b/lib/v2/gov/safe/templates/message.art new file mode 100644 index 00000000000000..bb909b2f689ab0 --- /dev/null +++ b/lib/v2/gov/safe/templates/message.art @@ -0,0 +1,25 @@ + + + + + + + + {{ if message }} + {{ set object = message }} + + + + + + {{ /if }} + {{ if reply }} + {{ set object = reply }} + + + + + + {{ /if }} + +
留言人留言内容留言时间
{{ object.author }}{{ object.content }}{{ object.date }}
{{ object.author }}{{ object.content }}{{ object.date }}
\ No newline at end of file diff --git a/lib/v2/gov/safe/util.js b/lib/v2/gov/safe/util.js new file mode 100644 index 00000000000000..8fb315f13c7309 --- /dev/null +++ b/lib/v2/gov/safe/util.js @@ -0,0 +1,87 @@ +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 rootUrl = 'https://www.safe.gov.cn'; + +const zxfkCategoryApis = { + // 业务咨询 https://www.safe.gov.cn//ywzx/index.html + ywzx: 'www/busines/businessQuery?siteid=', + + // 投诉建议 https://www.safe.gov.cn//tsjy/index.html + tsjy: 'www/complaint/complaintQuery?siteid=', +}; + +const processZxfkItems = async (site = 'beijing', category = 'ywzx', limit = '3') => { + const apiUrl = new URL(`${zxfkCategoryApis[category]}${site}`, rootUrl).href; + const currentUrl = new URL(`${site}/${category}/index.html`, rootUrl).href; + + const { data: response } = await got(apiUrl); + + const $ = cheerio.load(response); + + const items = $('#complaint') + .slice(0, limit) + .toArray() + .map((item) => { + item = $(item); + + const spans = item.find('span[objid]'); + + const message = { + author: spans.first().text().replace(/:$/, ''), + content: spans.eq(1).text(), + date: spans.eq(2).text(), + }; + + const reply = { + author: spans.eq(3).text().replace(/:$/, ''), + content: spans.eq(4).text(), + date: spans.eq(5).text(), + }; + + return { + title: `${message.author}: ${message.content}`, + link: new URL(item.find('.title').prop('href'), rootUrl).href, + description: art(path.join(__dirname, 'templates/message.art'), { + message, + reply, + }), + author: `${message.author}/${reply.author}`, + guid: item.find('.id').text(), + pubDate: parseDate(message.date), + updated: parseDate(reply.date), + }; + }); + + const { data: currentResponse } = await got(currentUrl); + + const content = cheerio.load(currentResponse); + + const author = content('meta[name="ColumnName"]').prop('content'); + const subtitle = content('meta[name="ColumnType"]').prop('content'); + + const imagePath = 'safe/templateresource/372b1dfdab204181b9b4f943a8e926a6'; + const image = new URL(`${imagePath}/logo_06.png`, rootUrl).href; + const icon = new URL(`${imagePath}/safe.ico`, rootUrl).href; + + return { + item: items, + title: `${author} - ${subtitle}`, + link: currentUrl, + description: content('meta[name="ColumnDescription"]').prop('content'), + language: 'zh', + image, + icon, + logo: icon, + subtitle, + author, + allowEmpty: true, + }; +}; + +module.exports = { + processZxfkItems, +}; diff --git a/website/docs/routes/government.mdx b/website/docs/routes/government.mdx index 3ba1b5bf132616..e9d2a400d2eb2b 100644 --- a/website/docs/routes/government.mdx +++ b/website/docs/routes/government.mdx @@ -618,6 +618,57 @@ Language
+## 国家外汇管理局 {#guo-jia-wai-hui-guan-li-ju} + +
+ *业务咨询* 和 *投诉建议* 可用的站点参数 + + | 上海市 | 北京市 | 天津市 | 河北省 | + | -------- | ------- | ------- | ----- | + | shanghai | beijing | tianjin | hebei | + + | 山西省 | 内蒙古自治区 | 辽宁省 | 吉林省 | + | ------ | --------- | -------- | ----- | + | shanxi | neimenggu | liaoning | jilin | + + | 黑龙江省 | 江苏省 | 浙江省 | 安徽省 | + | ------------ | ------- | -------- | ----- | + | heilongjiang | jiangsu | zhejiang | anhui | + + | 福建省 | 江西省 | 山东省 | 河南省 | + | ------ | ------- | -------- | ----- | + | fujian | jiangxi | shandong | henan | + + | 湖北省 | 湖南省 | 广东省 | 广西壮族自治区 | + | ----- | ----- | --------- | ------- | + | hubei | hunan | guangdong | guangxi | + + | 海南省 | 重庆市 | 四川省 | 贵州省 | + | ------ | --------- | ------- | ------- | + | hainan | chongqing | sichuan | guizhou | + + | 云南省 | 西藏自治区 | 陕西省 | 甘肃省 | + | ------ | ------ | ------- | ----- | + | yunnan | xizang | shaanxi | gansu | + + | 青海省 | 宁夏回族自治区 | 新疆维吾尔自治区 | 大连市 | + | ------- | ------- | -------- | ------ | + | qinghai | ningxia | xinjiang | dalian | + + | 宁波市 | 厦门市 | 青岛市 | 深圳市 | + | ------ | ------ | ------- | -------- | + | ningbo | xiamen | qingdao | shenzhen | + +
+ +### 业务咨询 {#guo-jia-wai-hui-guan-li-ju-ye-wu-zi-xun} + + + +### 投诉建议 {#guo-jia-wai-hui-guan-li-ju-tou-su-jian-yi} + + + ## 国家新闻出版广电总局(弃用) {#guo-jia-xin-wen-chu-ban-guang-dian-zong-ju-qi-yong} ### 游戏审批结果 {#guo-jia-xin-wen-chu-ban-guang-dian-zong-ju-qi-yong-you-xi-shen-pi-jie-guo} From 06e3892106cda248bcab88a620ea16f67d94366a Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 8 Dec 2023 18:46:31 +0000 Subject: [PATCH 6/7] feat(route): missav (#13997) --- lib/v2/missav/maintainer.js | 3 +++ lib/v2/missav/new.js | 36 +++++++++++++++++++++++++++++ lib/v2/missav/radar.js | 13 +++++++++++ lib/v2/missav/router.js | 3 +++ lib/v2/missav/templates/preview.art | 3 +++ website/docs/routes/multimedia.mdx | 6 +++++ 6 files changed, 64 insertions(+) create mode 100644 lib/v2/missav/maintainer.js create mode 100644 lib/v2/missav/new.js create mode 100644 lib/v2/missav/radar.js create mode 100644 lib/v2/missav/router.js create mode 100644 lib/v2/missav/templates/preview.art diff --git a/lib/v2/missav/maintainer.js b/lib/v2/missav/maintainer.js new file mode 100644 index 00000000000000..ffb61fdc89d07c --- /dev/null +++ b/lib/v2/missav/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/new': ['TonyRL'], +}; diff --git a/lib/v2/missav/new.js b/lib/v2/missav/new.js new file mode 100644 index 00000000000000..281f12c0f9e5ea --- /dev/null +++ b/lib/v2/missav/new.js @@ -0,0 +1,36 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { art } = require('@/utils/render'); +const { join } = require('path'); + +module.exports = async (ctx) => { + const baseUrl = 'https://missav.com'; + const { data: response } = await got(`${baseUrl}/dm397/new`); + const $ = cheerio.load(response); + + const items = $('.grid .group') + .toArray() + .map((item) => { + item = $(item); + const title = item.find('.text-secondary'); + const poster = new URL(item.find('img').data('src')); + poster.searchParams.set('class', 'normal'); + const video = item.find('video').data('src'); + return { + title: title.text().trim(), + link: title.attr('href'), + description: art(join(__dirname, 'templates/preview.art'), { + poster: poster.href, + video, + type: video.split('.').pop(), + }), + }; + }); + + ctx.state.data = { + title: $('head title').text(), + description: $('head meta[name="description"]').attr('content'), + link: baseUrl, + item: items, + }; +}; diff --git a/lib/v2/missav/radar.js b/lib/v2/missav/radar.js new file mode 100644 index 00000000000000..471b84b03e66ca --- /dev/null +++ b/lib/v2/missav/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'missav.com': { + _name: 'MissAV.com', + '.': [ + { + title: '最近更新', + docs: 'https://docs.rsshub.app/multimedia#missav-com', + source: ['/dm397/new', '/new', '/'], + target: '/missav/new', + }, + ], + }, +}; diff --git a/lib/v2/missav/router.js b/lib/v2/missav/router.js new file mode 100644 index 00000000000000..cbdbafac3606dc --- /dev/null +++ b/lib/v2/missav/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/new', require('./new')); +}; diff --git a/lib/v2/missav/templates/preview.art b/lib/v2/missav/templates/preview.art new file mode 100644 index 00000000000000..5f3f875a994c66 --- /dev/null +++ b/lib/v2/missav/templates/preview.art @@ -0,0 +1,3 @@ + diff --git a/website/docs/routes/multimedia.mdx b/website/docs/routes/multimedia.mdx index 5bcaed8b2e8f50..e5ed11b913f2a4 100644 --- a/website/docs/routes/multimedia.mdx +++ b/website/docs/routes/multimedia.mdx @@ -985,6 +985,12 @@ See [Directory](https://www.javlibrary.com/en/star_list.php) to view all stars. +## MissAV.com {#missav.com} + +### 最近更新 {#missav.com-zui-jin-geng-xin} + + + ## Mixcloud {#mixcloud} ### User {#mixcloud-user} From aea213eeace882c5408db61ae423d6b22b090fa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 21:57:00 +0000 Subject: [PATCH 7/7] chore(deps): bump pinyin-pro from 3.18.3 to 3.18.4 in /website (#13998) Bumps [pinyin-pro](https://github.com/zh-lx/pinyin-pro) from 3.18.3 to 3.18.4. - [Release notes](https://github.com/zh-lx/pinyin-pro/releases) - [Changelog](https://github.com/zh-lx/pinyin-pro/blob/main/CHANGELOG.md) - [Commits](https://github.com/zh-lx/pinyin-pro/compare/3.18.3...3.18.4) --- updated-dependencies: - dependency-name: pinyin-pro dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/package.json | 2 +- website/pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/website/package.json b/website/package.json index efea2c0ee60a76..4145d286123fc6 100644 --- a/website/package.json +++ b/website/package.json @@ -25,7 +25,7 @@ "clsx": "^2.0.0", "markdown-it": "^13.0.2", "meilisearch-docsearch": "^0.6.0", - "pinyin-pro": "3.18.3", + "pinyin-pro": "3.18.4", "prism-react-renderer": "^2.3.0", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 9df636f429bf72..1295a5c116a023 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -33,8 +33,8 @@ dependencies: specifier: ^0.6.0 version: 0.6.0 pinyin-pro: - specifier: 3.18.3 - version: 3.18.3 + specifier: 3.18.4 + version: 3.18.4 prism-react-renderer: specifier: ^2.3.0 version: 2.3.0(react@18.2.0) @@ -7830,8 +7830,8 @@ packages: engines: {node: '>=8.6'} dev: false - /pinyin-pro@3.18.3: - resolution: {integrity: sha512-YkY/n+T2DoRZxmZk+ReuNeSl2SowIMVDdagydILlPI0qNsbH7K5IKAQFihKl1JNiXLqwQT6kkVwVDsUek7AIqg==} + /pinyin-pro@3.18.4: + resolution: {integrity: sha512-P2PYCyzcK/R3MWSQQSRg9G1JFh3/ooEuA8lkQ2BkQOM665X0wHKW19bJ6+zqwUXLSaXtKC5NI58fCw4HrP7L1Q==} dev: false /pkg-dir@7.0.0: