feat: Adding UMASS Amherst ECE seminar (#6809)

* Adding UMASS Amherst ECE seminar

* Update eceseminar.js

Fix: Change url from 'http://ece.umass.edu/seminars/archive' to ''http://ece.umass.edu/seminars''

* Remove + at the beginning of description

* Changed name back

* Adding notes about why feeds may sometimes be empty.
This commit is contained in:
Steven Tang 2021-01-31 17:09:16 -05:00 committed by GitHub
parent b753bcaf14
commit 29550da458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 2 deletions

View File

@ -2165,6 +2165,12 @@
source: '/news',
target: '/umass/amherst/ecenews',
},
{
title: 'ECE Seminar',
docs: 'http://docs.rsshub.app/en/university.html#umass-amherst',
source: '/seminars',
target: '/umass/amherst/eceseminar',
},
],
'www.cics': [
{

View File

@ -30,10 +30,18 @@ pageClass: routes
## UMASS Amherst
### College of Electrical and Computer Engineering News
### College of Electrical and Computer Engineering
#### News
<RouteEn author="gammapi" example="/umass/amherst/ecenews" path="/umass/amherst/ecenews" radar="1" rssbud="1"/>
#### Seminar
<RouteEn author="gammapi" example="/umass/amherst/eceseminar" path="/umass/amherst/eceseminar" radar="1" rssbud="1"/>
Note[Source website](https://ece.umass.edu/seminar) may be empty when there's no upcoming seminars. This is normal and will cause rsshub fail to fetch this feed.
### College of Information & Computer Sciences News
<RouteEn author="gammapi" example="/umass/amherst/csnews" path="/umass/amherst/csnews" radar="1" rssbud="1"/>

View File

@ -980,10 +980,18 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
## 马萨诸塞大学 阿默斯特分校 (UMASS Amherst)
### 电子与计算机工程系新闻
### 电子与计算机工程系
#### 新闻
<Route author="gammapi" example="/umass/amherst/ecenews" path="/umass/amherst/ecenews" radar="1" rssbud="1"/>
#### 研讨会
<Route author="gammapi" example="/umass/amherst/eceseminar" path="/umass/amherst/eceseminar" radar="1" rssbud="1"/>
注:[源站](https://ece.umass.edu/seminar)在未公布研讨会计划时会清空页面导致 Rsshub 抓取不到内容,此属正常现象。
### 信息与计算机科学系新闻
<Route author="gammapi" example="/umass/amherst/csnews" path="/umass/amherst/csnews" radar="1" rssbud="1"/>

View File

@ -2908,6 +2908,7 @@ router.get('/rf/article', require('./routes/rf/article'));
// University of Massachusetts Amherst
router.get('/umass/amherst/ecenews', require('./routes/umass/amherst/ecenews'));
router.get('/umass/amherst/eceseminar', require('./routes/umass/amherst/eceseminar'));
router.get('/umass/amherst/csnews', require('./routes/umass/amherst/csnews'));
router.get('/umass/amherst/ipoevents', require('./routes/umass/amherst/ipoevents'));
router.get('/umass/amherst/ipostories', require('./routes/umass/amherst/ipostories'));

View File

@ -0,0 +1,40 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'http://ece.umass.edu/seminars',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.view-seminar-events .views-row');
ctx.state.data = {
title: 'UMAmherst-ECESeminar',
link: 'https://ece.umass.edu/seminars',
item:
list &&
list
.map((index, item) => {
item = $(item);
const eventDate = item.find('.views-field-field-datetime .date-display-single').first().attr('content');
return {
title: item.find('.views-field-title').first().text() + ' | ' + item.find('.views-field-field-title2').first().text(),
description:
'<br/>Presenter: ' +
item.find('.views-field-field-presenter').first().text() +
'<br/>Date:' +
item.find('.views-field-field-datetime').first().text() +
'<br/>Location:' +
item.find('.views-field-field-location').first().text(),
link: item.find('.views-field-title a').attr('href'),
pubDate: new Date(Date.parse(eventDate)).toUTCString(),
};
})
.get(),
};
};