diff --git a/assets/radar-rules.js b/assets/radar-rules.js index a450b9351e..a27aceb260 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2109,6 +2109,17 @@ }, ], }, + 'picuki.com': { + _name: 'Picuki', + www: [ + { + title: '用户', + docs: 'https://docs.rsshub.app/social-media.html#picuki-yong-hu', + source: '/profile/:id', + target: '/picuki/profile/:id', + }, + ], + }, 'manxiaosi.com': { _name: '漫小肆', '.': [ diff --git a/docs/en/social-media.md b/docs/en/social-media.md index 4968256734..40a711348c 100644 --- a/docs/en/social-media.md +++ b/docs/en/social-media.md @@ -50,6 +50,12 @@ For example, https://pawoo.net/users/pawoo_support.atom or https://pawoo.net/use +## Picuki + +### User Profile + + + ## pixiv ### User Bookmark diff --git a/docs/social-media.md b/docs/social-media.md index 8c45db4690..c783fd618e 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -342,6 +342,12 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 +## Picuki + +### 用户 + + + ## pixiv ### 用户收藏 diff --git a/lib/router.js b/lib/router.js index 9dac95885f..92353cd1a6 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2971,6 +2971,8 @@ router.get('/ngbj/cat/:cat', require('./routes/niaogebiji/cat')); // 东方我乐多丛志 router.get('/touhougarakuta/:language/:type', require('./routes/touhougarakuta')); +// Picuki +router.get('/picuki/profile/:id', require('./routes/picuki/profile')); // 新榜 router.get('/newrank/wechat/:wxid', require('./routes/newrank/wechat')); router.get('/newrank/douyin/:dyid', require('./routes/newrank/douyin')); diff --git a/lib/routes/picuki/profile.js b/lib/routes/picuki/profile.js new file mode 100644 index 0000000000..485c7f1598 --- /dev/null +++ b/lib/routes/picuki/profile.js @@ -0,0 +1,39 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const chrono = require('chrono-node'); + +module.exports = async (ctx) => { + const id = ctx.params.id; + + const url = `https://www.picuki.com/profile/${id}`; + + const response = await got.get(url); + const $ = cheerio.load(response.data); + + const profile_name = $('.profile-name-bottom').text(); + const profile_img = $('.profile-avatar > img').attr('src'); + const profile_description = $('.profile-description').text(); + + const list = $('ul.box-photos [data-s="media"]').get(); + + ctx.state.data = { + title: `${profile_name} (@${id}) - Picuki`, + link: url, + image: profile_img, + description: profile_description, + item: list.map((post) => { + post = $(post); + const post_image = post.find('.post-image').attr('src'); + const post_description = post.find('.photo-description').text().trim(); + const post_link = post.find('.photo > a').attr('href'); + const post_time = post.find('.time'); + return { + title: post_description || 'Untitled', + author: `@${id}`, + description: `` + (post_description.length > 100 ? `

${post_description}

` : ''), + link: post_link, + pubDate: post_time ? chrono.parseDate(post_time.text()) : new Date(), + }; + }), + }; +};