mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 15:21:59 +08:00
feat: add Inside Design & Product Hunt (#3636)
This commit is contained in:
@@ -18,6 +18,13 @@ pageClass: routes
|
||||
|
||||
<Route author="DIYgod" example="/dribbble/keyword/player" path="/dribbble/keyword/:keyword" :paramsDesc="['想要订阅的关键词']"/>
|
||||
|
||||
## Inside Design
|
||||
|
||||
### Recent Stories
|
||||
|
||||
<Route author="miaoyafeng" example="/invisionapp/inside-design" path="/invisionapp/inside-design">
|
||||
</Route>
|
||||
|
||||
## UI 中国
|
||||
|
||||
### 推荐文章
|
||||
|
||||
@@ -17,3 +17,10 @@ pageClass: routes
|
||||
### Keyword
|
||||
|
||||
<RouteEn path="/dribbble/keyword/:keyword" example="/dribbble/keyword/player" :paramsDesc="['desired keyword']" />
|
||||
|
||||
## Inside Design
|
||||
|
||||
### Recent Stories
|
||||
|
||||
<RouteEn author="miaoyafeng" example="/invisionapp/inside-design" path="/invisionapp/inside-design">
|
||||
</RouteEn>
|
||||
|
||||
@@ -79,6 +79,15 @@ pageClass: routes
|
||||
|
||||
<RouteEn author="hoilc" example="/pocket/trending" path="/pocket/trending"/>
|
||||
|
||||
## Product Hunt
|
||||
|
||||
> The official feed: [https://www.producthunt.com/feed](https://www.producthunt.com/feed)
|
||||
|
||||
### Today Popular
|
||||
|
||||
<RouteEn author="miaoyafeng" example="/producthunt/today" path="/producthunt/today">
|
||||
</RouteEn>
|
||||
|
||||
## Remote.work
|
||||
|
||||
### Remote.work Job Information
|
||||
|
||||
@@ -91,6 +91,15 @@ pageClass: routes
|
||||
|
||||
<Route author="hoilc" example="/pocket/trending" path="/pocket/trending"/>
|
||||
|
||||
## Product Hunt
|
||||
|
||||
> 官方 Feed 地址为: [https://www.producthunt.com/feed](https://www.producthunt.com/feed)
|
||||
|
||||
### Today Popular
|
||||
|
||||
<Route author="miaoyafeng" example="/producthunt/today" path="/producthunt/today">
|
||||
</Route>
|
||||
|
||||
## SANS Institute
|
||||
|
||||
### 最新会议材料
|
||||
|
||||
@@ -2052,4 +2052,10 @@ router.get('/xinwenlianbo/index', require('./routes/xinwenlianbo/index'));
|
||||
// Paul Graham - Essays
|
||||
router.get('/blogs/paulgraham', require('./routes/blogs/paulgraham'));
|
||||
|
||||
// invisionapp
|
||||
router.get('/invisionapp/inside-design', require('./routes/invisionapp/inside-design'));
|
||||
|
||||
// producthunt
|
||||
router.get('/producthunt/today', require('./routes/producthunt/today'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
24
lib/routes/invisionapp/inside-design.js
Normal file
24
lib/routes/invisionapp/inside-design.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got.get('https://www.invisionapp.com/inside-design/');
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const list = $('#recent-stories #articles-wrapper > div');
|
||||
ctx.state.data = {
|
||||
title: 'Inside Design',
|
||||
link: 'https://www.invisionapp.com/inside-design/',
|
||||
item: list
|
||||
.map((i, item) => {
|
||||
const itemDom = $(item);
|
||||
return {
|
||||
title: itemDom.find('.text h3').text(),
|
||||
description: `<img src="${itemDom.find('img').attr('src')}">`,
|
||||
link: 'https://www.invisionapp.com' + itemDom.find('.hover > a').attr('href'),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
24
lib/routes/producthunt/today.js
Normal file
24
lib/routes/producthunt/today.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got.get('https://www.producthunt.com/');
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const list = $('ul[class^="postsList"] li');
|
||||
ctx.state.data = {
|
||||
title: 'Product Hunt Today Popular',
|
||||
link: 'https://www.producthunt.com/',
|
||||
item: list
|
||||
.map((i, item) => {
|
||||
const itemDom = $(item);
|
||||
return {
|
||||
title: itemDom.find('h3').text(),
|
||||
description: `${itemDom.find('h3 + p').text()}<br><img src="${itemDom.find('h3').attr('src')}">`,
|
||||
link: 'https://www.producthunt.com' + itemDom.find('a').attr('href'),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user