mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 15:47:48 +08:00
feat:增加ITSlide订阅源 (#3477)
This commit is contained in:
@@ -790,6 +790,18 @@
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'itslide.com': {
|
||||||
|
_name: 'ITSlide',
|
||||||
|
www: [
|
||||||
|
{
|
||||||
|
title: '最新',
|
||||||
|
docs: 'https://docs.rsshub.app/programming.html#itslide',
|
||||||
|
source: '/*',
|
||||||
|
target: '/itslide/new',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
'leboncoin.fr': {
|
'leboncoin.fr': {
|
||||||
_name: 'leboncoin',
|
_name: 'leboncoin',
|
||||||
www: [
|
www: [
|
||||||
|
|||||||
@@ -154,6 +154,12 @@ GitHub 官方也提供了一些 RSS:
|
|||||||
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
## ITSlide
|
||||||
|
|
||||||
|
### 最新
|
||||||
|
|
||||||
|
<Route author="Yangshuqing" example="/itslide/new" path="/itslide/new" radar="1"/>
|
||||||
|
|
||||||
## kaggle
|
## kaggle
|
||||||
|
|
||||||
### Discussion
|
### Discussion
|
||||||
|
|||||||
@@ -1989,6 +1989,9 @@ router.get('/fanfou/favorites/:uid', require('./routes/fanfou/favorites'));
|
|||||||
router.get('/fanfou/trends', require('./routes/fanfou/trends'));
|
router.get('/fanfou/trends', require('./routes/fanfou/trends'));
|
||||||
router.get('/fanfou/public_timeline/:keyword', require('./routes/fanfou/public_timeline'));
|
router.get('/fanfou/public_timeline/:keyword', require('./routes/fanfou/public_timeline'));
|
||||||
|
|
||||||
|
// ITSlide
|
||||||
|
router.get('/itslide/new', require('./routes/itslide/new'));
|
||||||
|
|
||||||
// Remote Work
|
// Remote Work
|
||||||
router.get('/remote-work/:caty?', require('./routes/remote-work/index'));
|
router.get('/remote-work/:caty?', require('./routes/remote-work/index'));
|
||||||
|
|
||||||
|
|||||||
54
lib/routes/itslide/new.js
Normal file
54
lib/routes/itslide/new.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
const baseUrl = 'https://www.itslide.com';
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: baseUrl + '/new',
|
||||||
|
referer: baseUrl,
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const posts = $('.mod-post');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
link: baseUrl,
|
||||||
|
title: 'ITSlide - 专注于PPT幻灯片的分享平台',
|
||||||
|
item: posts
|
||||||
|
.map((_, item) => {
|
||||||
|
const title = $(item)
|
||||||
|
.find('a')
|
||||||
|
.attr('title');
|
||||||
|
const link =
|
||||||
|
baseUrl +
|
||||||
|
$(item)
|
||||||
|
.find('a')
|
||||||
|
.attr('href')
|
||||||
|
.slice(1);
|
||||||
|
const upTime = $(item)
|
||||||
|
.find('.mod-post-tip .pr')
|
||||||
|
.text();
|
||||||
|
const views = $(item)
|
||||||
|
.find('.mod-post-tip .pl')
|
||||||
|
.text();
|
||||||
|
const imgSrc = $(item)
|
||||||
|
.find('img')
|
||||||
|
.attr('src');
|
||||||
|
|
||||||
|
return {
|
||||||
|
link: link,
|
||||||
|
title: title,
|
||||||
|
description: `描述: ${title}<br>
|
||||||
|
时间:${upTime}<br>
|
||||||
|
浏览:${views}<br>
|
||||||
|
预览:<img src = ${imgSrc}'>`,
|
||||||
|
pubDate: $(item)
|
||||||
|
.find('.mod-post-tip .pr')
|
||||||
|
.text(),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user