feat: Add Umass Amherst CICS/news and ECE/news (#4740)
This commit is contained in:
@@ -1879,6 +1879,25 @@
|
||||
},
|
||||
],
|
||||
},
|
||||
'umass.edu': {
|
||||
_name: 'UMASS Amherst',
|
||||
ece: [
|
||||
{
|
||||
title: 'ECE News',
|
||||
docs: 'http://docs.rsshub.app/en/university.html#umass-amherst',
|
||||
source: '/news',
|
||||
target: '/umass/amherst/ecenews',
|
||||
},
|
||||
],
|
||||
'www.cics': [
|
||||
{
|
||||
title: 'CICS News',
|
||||
docs: 'http://docs.rsshub.app/en/university.html#umass-amherst',
|
||||
source: '/news',
|
||||
target: '/umass/amherst/csnews',
|
||||
},
|
||||
],
|
||||
},
|
||||
'lofter.com': {
|
||||
_name: 'Lofter',
|
||||
www: [
|
||||
|
||||
@@ -23,3 +23,13 @@ pageClass: routes
|
||||
### News
|
||||
|
||||
<RouteEn author="exuanbo" example="/polimi/news" path="/polimi/news/:language?" :paramsDesc="['English language code en']" />
|
||||
|
||||
## UMASS Amherst
|
||||
|
||||
### College of Electrical and Computer Engineering News
|
||||
|
||||
<Route author="gammapi" example="/umass/amherst/ecenews" path="/umass/amherst/ecenews" radar="1"/>
|
||||
|
||||
### College of Information & Computer Sciences News
|
||||
|
||||
<Route author="gammapi" example="/umass/amherst/csnews" path="/umass/amherst/csnews" radar="1"/>
|
||||
|
||||
@@ -750,6 +750,16 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
|
||||
|
||||
</Route>
|
||||
|
||||
## 马萨诸塞大学 阿默斯特分校 (UMASS Amherst)
|
||||
|
||||
### 电子与计算机工程系新闻
|
||||
|
||||
<Route author="gammapi" example="/umass/amherst/ecenews" path="/umass/amherst/ecenews" radar="1"/>
|
||||
|
||||
### 信息与计算机科学系新闻
|
||||
|
||||
<Route author="gammapi" example="/umass/amherst/csnews" path="/umass/amherst/csnews" radar="1"/>
|
||||
|
||||
## 南昌航空大学
|
||||
|
||||
### 教务处公告与新闻
|
||||
|
||||
@@ -2665,6 +2665,10 @@ router.get('/qingting/channel/:id', require('./routes/qingting/channel'));
|
||||
// 金色财经
|
||||
router.get('/jinse/lives', require('./routes/jinse/lives'));
|
||||
|
||||
// University of Massachusetts Amherst
|
||||
router.get('/umass/amherst/ecenews', require('./routes/umass/amherst/ecenews'));
|
||||
router.get('/umass/amherst/csnews', require('./routes/umass/amherst/csnews'));
|
||||
|
||||
// 飘花电影网
|
||||
router.get('/piaohua/hot', require('./routes/piaohua/hot'));
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://www.cics.umass.edu/news',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('.view-mt-latest-news .views-row');
|
||||
let itemPicUrl;
|
||||
ctx.state.data = {
|
||||
title: 'UMAmherst-CSNews',
|
||||
link: 'https://www.cics.umass.edu/news',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
itemPicUrl = item.find('.views-field-field-image img').attr('src');
|
||||
return {
|
||||
title: item.find('.views-field-title a').first().text(),
|
||||
description: `<img src="${itemPicUrl}"><br>` + item.find('.views-field-body .field-content').first().text(),
|
||||
link: item.find('.views-more-link').attr('href'),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://ece.umass.edu/news',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('.view-news .views-row');
|
||||
let itemPicUrl;
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'UMAmherst-ECENews',
|
||||
link: 'https://ece.umass.edu/news',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
itemPicUrl = item.find('.image-style-thumbnail').attr('src');
|
||||
return {
|
||||
title: item.find('.views-field-title a').first().text(),
|
||||
description: `<img src="${itemPicUrl}"><br>` + item.find('div.field-content').last().text(),
|
||||
link: item.find('.views-field-title a').attr('href'),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user