mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
feat: add Polimi News (#2339)
This commit is contained in:
@@ -18,6 +18,12 @@ pageClass: routes
|
|||||||
|
|
||||||
<Route author="LogicJake" example="/mit/graduateadmissions/category/beyond-the-lab" path="/universities/mit/graduateadmissions/category/:name" :paramsDesc="['category name which can be found in url']"/>
|
<Route author="LogicJake" example="/mit/graduateadmissions/category/beyond-the-lab" path="/universities/mit/graduateadmissions/category/:name" :paramsDesc="['category name which can be found in url']"/>
|
||||||
|
|
||||||
|
## Polimi
|
||||||
|
|
||||||
|
### News
|
||||||
|
|
||||||
|
<Route author="exuanbo" example="/polimi/news" path="/polimi/news/:language?" :paramsDesc="['English language code en']" />
|
||||||
|
|
||||||
## 北京大学
|
## 北京大学
|
||||||
|
|
||||||
### 信科公告通知
|
### 信科公告通知
|
||||||
|
|||||||
@@ -1389,4 +1389,7 @@ router.get('/monsterhunter/update', require('./routes/monsterhunter/update'));
|
|||||||
// 005.tv
|
// 005.tv
|
||||||
router.get('/005tv/zx/latest', require('./routes/005tv/zx'));
|
router.get('/005tv/zx/latest', require('./routes/005tv/zx'));
|
||||||
|
|
||||||
|
// Polimi News
|
||||||
|
router.get('/polimi/news/:language?', require('./routes/polimi/news'));
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
22
lib/routes/polimi/news.js
Normal file
22
lib/routes/polimi/news.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const buildData = require('@/utils/common-config');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
let link = `https://www.polimi.it/tutte-le-news/`;
|
||||||
|
if (ctx.params.language === 'en') {
|
||||||
|
link = `https://www.polimi.it/en/all-news/`;
|
||||||
|
}
|
||||||
|
ctx.state.data = await buildData({
|
||||||
|
link,
|
||||||
|
url: link,
|
||||||
|
title: `Polimi News`,
|
||||||
|
params: {
|
||||||
|
homeLink: 'https://www.polimi.it',
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
item: '.container .no',
|
||||||
|
title: `$('h3').text()`,
|
||||||
|
link: `'%homeLink%' + $('p span a').attr('href')`,
|
||||||
|
description: `$('p').text() + '<p></p>' + '<a href="' + '%homeLink%' + $('p span a').attr('href') + '">Full Article</a'`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user