diff --git a/docs/new-media.md b/docs/new-media.md index 5e624f41ae..3635e291c7 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1347,13 +1347,67 @@ column 为 third 时可选的 category: ### 首页 -### 24小时热门 + +### 24 小时热门 + ### 节目 +## 留园网 + +### 分站 + + + +| 婚姻家庭 | 魅力时尚 | 女性频道 | 生活百态 | 美食厨房 | 非常影音 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| life9 | life1 | chan10 | life2 | life6 | fr | + +| 车迷沙龙 | 游戏天地 | 卡通漫画 | 体坛纵横 | 运动健身 | 电脑前线 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| enter7 | enter3 | enter6 | enter5 | sport | know1 | + +| 数码家电 | 旅游风向 | 摄影部落 | 奇珍异宝 | 笑口常开 | 娱乐八卦 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| chan6 | life7 | chan8 | page | enter1 | enter8 | + +| 吃喝玩乐 | 文化长廊 | 军事纵横 | 百家论坛 | 科技频道 | 爱子情怀 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| netstar | life10 | nz | other | chan2 | chan5 | + +| 健康人生 | 博论天下 | 史海钩沉 | 网际谈兵 | 经济观察 | 谈股论金 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| life5 | bolun | chan1 | military | finance | chan4 | + +| 杂论闲侃 | 唯美乐园 | 学习园地 | 命理玄机 | 宠物情缘 | 网络歌坛 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| pk | gz1 | gz2 | gz3 | life8 | chan7 | + +| 音乐殿堂 | 情感世界 | +| -------- | -------- | +| enter4 | life3 | + +::: tip 提示 + +酷 18 文档参见 [此处](https://docs.rsshub.app/picture.html#ku-18) + +禁忌书屋文档参见 [此处](https://docs.rsshub.app/reading.html#jin-ji-shu-wu) + +::: + + + +### 精华区 + + + +### 搜索关键字 + + + ## 妈咪帮 diff --git a/docs/picture.md b/docs/picture.md index 3ea243e1df..2c095474f3 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -358,6 +358,8 @@ R18 显示 ::: tip 提示 +留园网文档参见 [此处](https://docs.rsshub.app/new-media.html#liu-yuan-wang) + 禁忌书屋文档参见 [此处](https://docs.rsshub.app/reading.html#jin-ji-shu-wu) ::: diff --git a/lib/router.js b/lib/router.js index d1fcd6e378..82cc50463a 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3790,6 +3790,9 @@ router.get('/nace/blog/:sort?', require('./routes/nace/blog')); // Caixin Latest router.get('/caixin/latest', require('./routes/caixin/latest')); +// 留园网 +router.get('/6park/:id?/:type?/:keyword?', require('./routes/6park/index')); + // 哔嘀影视 router.get('/bde4/:type?/:caty?/:area?/:year?/:order?', require('./routes/bde4/index')); diff --git a/lib/routes/6park/index.js b/lib/routes/6park/index.js new file mode 100644 index 0000000000..4334646419 --- /dev/null +++ b/lib/routes/6park/index.js @@ -0,0 +1,58 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id || 'chan1'; + const type = ctx.params.type || ''; + const keyword = ctx.params.keyword || ''; + + const rootUrl = 'https://club.6parkbbs.com'; + const indexUrl = `${rootUrl}/${id}/index.php`; + const currentUrl = `${indexUrl}${type === '' || keyword === '' ? '' : type === 'gold' ? '?app=forum&act=gold' : `?action=search&act=threadsearch&app=forum&${type}=${keyword}&submit=${type === 'type' ? '查询' : '栏目搜索'}`}`; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('#d_list ul li, #thread_list li, .t_l .t_subject') + .slice(0, 10) + .map((_, item) => { + item = $(item); + const a = item.find('a').eq(0); + return { + link: `${rootUrl}/${id}/${a.attr('href')}`, + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.title = content('title').text().replace(' -6park.com', ''); + item.author = detailResponse.data.match(/送交者: .*>(.*)<.*\[/)[1]; + item.pubDate = new Date(detailResponse.data.match(/于 (.*) 已读/)[1]).toUTCString(); + item.description = content('pre') + .html() + .replace(/6park.com<\/font>/g, ''); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +};