forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some SCNU RSS support (DIYgod#401)
- Loading branch information
Showing
6 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const axios = require('../../../utils/axios'); | ||
const cheerio = require('cheerio'); | ||
const config = require('../../../config'); | ||
|
||
module.exports = async (ctx) => { | ||
const res = await axios({ | ||
method: 'get', | ||
url: 'https://cs.scnu.edu.cn/xueshenggongzuo/chengchangfazhan/kejichuangxin/', | ||
header: { | ||
'User-Agent': config.ua, | ||
Referer: 'https://cs.scnu.edu.cn', | ||
}, | ||
}); | ||
const data = res.data; | ||
const $ = cheerio.load(data); | ||
const list = $('.listshow').find('li'); | ||
|
||
ctx.state.data = { | ||
title: $('title').text(), | ||
link: 'https://cs.scnu.edu.cn/xueshenggongzuo/chengchangfazhan/kejichuangxin/', | ||
description: '华南师范大学计算机学院 学科竞赛', | ||
item: | ||
list && | ||
list | ||
.map((index, item) => { | ||
item = $(item); | ||
return { | ||
title: item | ||
.find('a') | ||
.text() | ||
.replace(/\d{4}-\d{2}-\d{2}/, ''), | ||
pubDate: new Date(item.find('.r').text()).toUTCString(), | ||
link: item.find('a').attr('href'), | ||
}; | ||
}) | ||
.get(), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const axios = require('../../utils/axios'); | ||
const cheerio = require('cheerio'); | ||
const config = require('../../config'); | ||
|
||
module.exports = async (ctx) => { | ||
const res = await axios({ | ||
method: 'get', | ||
url: 'https://jw.scnu.edu.cn/ann/index.html', | ||
header: { | ||
'User-Agent': config.ua, | ||
Referer: 'https://jw.scnu.edu.cn', | ||
}, | ||
}); | ||
const data = res.data; | ||
const $ = cheerio.load(data); | ||
const list = $('.notice_01').find('li'); | ||
|
||
ctx.state.data = { | ||
title: $('title') | ||
.first() | ||
.text(), | ||
link: 'https://jw.scnu.edu.cn/ann/index.html', | ||
description: '华南师范大学教务处 - 通知公告', | ||
item: | ||
list && | ||
list | ||
.map((index, item) => { | ||
item = $(item); | ||
return { | ||
title: item.find('a').text(), | ||
pubDate: new Date(item.find('.time').text()).toUTCString(), | ||
link: item.find('a').attr('href'), | ||
}; | ||
}) | ||
.get(), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const axios = require('../../utils/axios'); | ||
const cheerio = require('cheerio'); | ||
const config = require('../../config'); | ||
|
||
module.exports = async (ctx) => { | ||
const res = await axios({ | ||
method: 'get', | ||
url: 'https://lib.scnu.edu.cn/news/zuixingonggao', | ||
header: { | ||
'User-Agent': config.ua, | ||
Referer: 'https://lib.scnu.edu.cn', | ||
}, | ||
}); | ||
const data = res.data; | ||
const $ = cheerio.load(data); | ||
const list = $('.article-list').find('li'); | ||
|
||
ctx.state.data = { | ||
title: $('title').text(), | ||
link: 'https://lib.scnu.edu.cn/news/zuixingonggao', | ||
description: '华南师范大学图书馆 - 通知公告', | ||
item: | ||
list && | ||
list | ||
.map((index, item) => { | ||
item = $(item); | ||
return { | ||
title: item.find('a').text(), | ||
pubDate: new Date(item.find('.clock').text()).toUTCString(), | ||
link: item.find('a').attr('href'), | ||
}; | ||
}) | ||
.get(), | ||
}; | ||
}; |