mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
add /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'http://jiaowc.lsnu.edu.cn/tzgg.htm',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('tr[id^="line_u5_"]').get();
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map(async (item) => {
|
||||
const $ = cheerio.load(item);
|
||||
const title = $('a').attr('title');
|
||||
const link = 'http://jiaowc.lsnu.edu.cn/' + $('a').attr('href');
|
||||
const date = $('td[width="80"]').text();
|
||||
|
||||
const cache = await ctx.cache.get(link);
|
||||
if (cache) {
|
||||
return JSON.parse(cache);
|
||||
}
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: link,
|
||||
});
|
||||
|
||||
const articleData = response.data;
|
||||
const article$ = cheerio.load(articleData);
|
||||
const description = article$('.v_news_content').html();
|
||||
|
||||
const single = {
|
||||
title,
|
||||
link,
|
||||
description,
|
||||
pubDate: new Date(date).toUTCString(),
|
||||
};
|
||||
|
||||
ctx.cache.set(link, JSON.stringify(single));
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: '乐山师范学院教学部通知公告',
|
||||
link: 'http://jiaowc.lsnu.edu.cn/tzgg.htm',
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/lsnu/jiaowc': ['nyaShine'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'jiaowc.lsnu.edu.cn': {
|
||||
_name: '乐山师范学院教学部',
|
||||
'.': [
|
||||
{
|
||||
title: '通知公告',
|
||||
docs: 'https://docs.rsshub.app/',
|
||||
source: ['/'],
|
||||
target: '/lsnu/jiaowc/tzgg',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = (router) => {
|
||||
router.get('/jiaowc/tzgg', require('./jiaowc/tzgg'));
|
||||
};
|
||||
@@ -2009,6 +2009,12 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
|
||||
|
||||
<Route author="geekrainy" example="/kmust/job/jobfairs" path="/kmust/job/jobfairs" />
|
||||
|
||||
## 乐山师范学院 {#le-shan-shi-fan-xue-yuan}
|
||||
|
||||
### 教学部通知公告 {#le-shan-shi-fan-xue-yuan-jiao-xue-bu-tong-zhi-gong-gao}
|
||||
|
||||
<Route author="nyaShine" example="/lsnu/jiaowc/tzgg" path="/lsnu/jiaowc/tzgg" radar="1" />
|
||||
|
||||
## 辽宁工程技术大学 {#liao-ning-gong-cheng-ji-shu-da-xue}
|
||||
|
||||
### 教务公告 {#liao-ning-gong-cheng-ji-shu-da-xue-jiao-wu-gong-gao}
|
||||
|
||||
Reference in New Issue
Block a user