mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-19 01:43:35 +08:00
feat: add picuki (#5256)
This commit is contained in:
@@ -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: '漫小肆',
|
||||
'.': [
|
||||
|
||||
@@ -50,6 +50,12 @@ For example, https://pawoo.net/users/pawoo_support.atom or https://pawoo.net/use
|
||||
|
||||
<RouteEn author="hoilc" example="/piapro/public/music/miku/2" path="/piapro/public/:type/:tag?/:category?" :paramsDesc="['work type, can be `music`,`illust`,`text`','`tag` parameter in url','category ID, `categoryId` parameter in url']"/>
|
||||
|
||||
## Picuki
|
||||
|
||||
### User Profile
|
||||
|
||||
<Route author="hoilc" example="/picuki/profile/stefaniejoosten" path="/picuki/profile/:id" :paramsDesc="['Instagram id']" />
|
||||
|
||||
## pixiv
|
||||
|
||||
### User Bookmark
|
||||
|
||||
@@ -342,6 +342,12 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
||||
|
||||
<Route author="hoilc" example="/piapro/public/music/miku/2" path="/piapro/public/:type/:tag?/:category?" :paramsDesc="['作品类别, 可选`music`,`illust`,`text`','标签, 即 URL 中`tag`参数','分类 ID, 即 URL 中 `categoryId` 参数']"/>
|
||||
|
||||
## Picuki
|
||||
|
||||
### 用户
|
||||
|
||||
<Route author="hoilc" example="/picuki/profile/stefaniejoosten" path="/picuki/profile/:id" :paramsDesc="['Instagram 用户 id']" radar="1" />
|
||||
|
||||
## pixiv
|
||||
|
||||
### 用户收藏
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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: `<img src="${post_image}">` + (post_description.length > 100 ? `<p>${post_description}</p>` : ''),
|
||||
link: post_link,
|
||||
pubDate: post_time ? chrono.parseDate(post_time.text()) : new Date(),
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user