diff --git a/assets/radar-rules.js b/assets/radar-rules.js index aa23064a10..d50fba6347 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -790,6 +790,18 @@ ], }, + 'itslide.com': { + _name: 'ITSlide', + www: [ + { + title: '最新', + docs: 'https://docs.rsshub.app/programming.html#itslide', + source: '/*', + target: '/itslide/new', + }, + ], + }, + 'leboncoin.fr': { _name: 'leboncoin', www: [ diff --git a/docs/programming.md b/docs/programming.md index 491d4bcab7..513eca674a 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -154,6 +154,12 @@ GitHub 官方也提供了一些 RSS: +## ITSlide + +### 最新 + + + ## kaggle ### Discussion diff --git a/lib/router.js b/lib/router.js index 7630efe07a..b630f3f96b 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1989,6 +1989,9 @@ router.get('/fanfou/favorites/:uid', require('./routes/fanfou/favorites')); router.get('/fanfou/trends', require('./routes/fanfou/trends')); router.get('/fanfou/public_timeline/:keyword', require('./routes/fanfou/public_timeline')); +// ITSlide +router.get('/itslide/new', require('./routes/itslide/new')); + // Remote Work router.get('/remote-work/:caty?', require('./routes/remote-work/index')); diff --git a/lib/routes/itslide/new.js b/lib/routes/itslide/new.js new file mode 100644 index 0000000000..c65b185d63 --- /dev/null +++ b/lib/routes/itslide/new.js @@ -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}
+ 时间:${upTime}
+ 浏览:${views}
+ 预览:`, + pubDate: $(item) + .find('.mod-post-tip .pr') + .text(), + }; + }) + .get(), + }; +};