parent
3d527390ae
commit
c3ff574bf9
|
|
@ -83,6 +83,29 @@ Behance 用户主页 URL 获取用户名,如 <https://www.behance.net/mishapet
|
|||
|
||||
<Route author="nczitzk" example="/monotype/article" path="/monotype/article" />
|
||||
|
||||
## Notefolio
|
||||
|
||||
### Works
|
||||
|
||||
<Route author="nczitzk" example="/notefolio" path="/notefolio/:caty?/:order?/:time?/:query?" :paramsDesc="['分类,见下表,默认为 `all`', '排序,可选 `pick` 指 Notefolio 精选,`newest` 指 最新,`noted` 指 知名,默认为 `pick`', '时间,可选 `all` 指 全部,`day` 指 最近24小时,`week` 指 最近一周,`month` 指 最近一个月,`month3` 指 最近三个月,默认为`all`', '关键词,默认为空']">
|
||||
|
||||
| 分类 | 韩文分类名 | 中文分类名 |
|
||||
| ---- | --------------- | --------------- |
|
||||
| all | 전체 | 全部 |
|
||||
| A7 | 공예 | 工艺品 |
|
||||
| J7 | 그래픽 디자인 | 平面设计 |
|
||||
| B7 | 디지털 아트 | 数字艺术 |
|
||||
| C7 | 영상/모션그래픽 | 视频 / 图形动画 |
|
||||
| D7 | 브랜딩/편집 | 品牌创建 / 编辑 |
|
||||
| E7 | 산업 디자인 | 工业设计 |
|
||||
| F7 | UI/UX | UI/UX |
|
||||
| G7 | 일러스트레이션 | 插画 |
|
||||
| K7 | 타이포그래피 | 字体 |
|
||||
| H7 | 파인아트 | 纯艺术 |
|
||||
| I7 | 포토그래피 | 摄影 |
|
||||
|
||||
</Route>
|
||||
|
||||
## UI 中国
|
||||
|
||||
### 推荐文章
|
||||
|
|
|
|||
|
|
@ -77,6 +77,29 @@ Default is under 'https://www.methodstudios.com/en/features'.
|
|||
|
||||
</RouteEn>
|
||||
|
||||
## Notefolio
|
||||
|
||||
### Works
|
||||
|
||||
<RouteEn author="nczitzk" example="/notefolio" path="/notefolio/:caty?/:order?/:time?/:query?" :paramsDesc="['Category, see below, `all` by default', 'Order, `pick` as Notefolio Pick, `newest` as Newest, `noted` as Noted, `pick` by default', 'Time, `all` as All the time, `day` as Latest 24 hours, `week` as Latest week, `month` as Latest month, `month3` as Latest 3 months, `all` by default', 'Keyword, empty by default']">
|
||||
|
||||
| Category | Name in Korean | Name in English |
|
||||
| -------- | -------------- | --------------- |
|
||||
| all | 전체 | All |
|
||||
| A7 | 공예 | Crafts |
|
||||
| J7 | 그래픽 디자인 | Graphic Design |
|
||||
| B7 | 디지털 아트 | Digital Art |
|
||||
| C7 | 영상/모션그래픽 | Video / Motion Graphics |
|
||||
| D7 | 브랜딩/편집 | Branding / Editing |
|
||||
| E7 | 산업 디자인 | Industrial Design |
|
||||
| F7 | UI/UX | UI/UX |
|
||||
| G7 | 일러스트레이션 | Illustration |
|
||||
| K7 | 타이포그래피 | Typography |
|
||||
| H7 | 파인아트 | Fine Art |
|
||||
| I7 | 포토그래피 | Photography |
|
||||
|
||||
</RouteEn>
|
||||
|
||||
## Unit Image
|
||||
|
||||
### Films
|
||||
|
|
|
|||
|
|
@ -3241,6 +3241,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index'));
|
|||
// CGTN
|
||||
router.get('/cgtn/top', require('./routes/cgtn/top'));
|
||||
|
||||
// notefolio
|
||||
router.get('/notefolio/:caty?/:order?/:time?/:query?', require('./routes/notefolio/index'));
|
||||
|
||||
// JavDB
|
||||
router.get('/javdb/home/:caty?/:sort?/:filter?', require('./routes/javdb/home'));
|
||||
router.get('/javdb/search/:keyword?/:filter?', require('./routes/javdb/search'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const caty = ctx.params.caty || 'all';
|
||||
const order = ctx.params.order || 'pick';
|
||||
const time = ctx.params.time || 'all';
|
||||
const query = ctx.params.query || '';
|
||||
|
||||
const rootUrl = `https://notefolio.net/?work_categories=${caty === 'all' ? '' : caty}&order=${order}&from=${time}&q=${query}`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: rootUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
$('div.mobile-category-order').remove();
|
||||
|
||||
const list = $('div.work-list div.work-list-item')
|
||||
.slice(0, 5)
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
const a = item.find('a.go-to-work-info').eq(0);
|
||||
return {
|
||||
title: item.find('div.title').text(),
|
||||
link: `https://notefolio.net${a.attr('href')}`,
|
||||
author: item.find('span.go-profile-area').text(),
|
||||
};
|
||||
})
|
||||
.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.description = '<ul>';
|
||||
|
||||
content('li.block-image a img').each((_, i) => {
|
||||
i = content(i);
|
||||
item.description += `<li><img src="${i.attr('src')}"></li>`;
|
||||
});
|
||||
|
||||
content('li.block-video iframe').each((_, i) => {
|
||||
i = content(i);
|
||||
item.description += `<li><iframe src="${i.attr('src')}"></li>`;
|
||||
});
|
||||
|
||||
item.description += `<li>${content('li.block-text').html()}</li></ul>`;
|
||||
|
||||
return item;
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${$('title').text()}`,
|
||||
link: rootUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue