OCT24_Updated_NJUST_Readme.m_Any.js (#966)
1. 更新 Readme.m 格式 2. 更新 gs.js 的标题: title: map.get(type).title 3. 删除 NJUST 文件夹下的 jwc.js
This commit is contained in:
parent
6b02cc338a
commit
d9ebc64fc2
|
|
@ -1223,11 +1223,29 @@ category 列表:
|
|||
|
||||
### 南京理工大学
|
||||
|
||||
<route name="教务处" author="MilkShakeYoung" example="/njust/jwc/1" path="/universities/njust/jwc/:type" :paramsDesc="['1 为教师通知, 2 为学生通知, 3 为新闻,4 为学院动态']"/>
|
||||
<route name="南京理工大学教务处" author="MilkShakeYoung" example="/njust/jwc/1" path="/universities/njust/jwc/:type" :paramsDesc="['1 为教师通知, 2 为学生通知, 3 为新闻,4 为学院动态']"/>
|
||||
|
||||
<route name="财务处" author="MilkShakeYoung" example="/njust/cwc/1" path="/universities/njust/cwc/:type" :paramsDesc="['1 新闻及通知, 2 办事指南']"/>
|
||||
| 教师通知 | 学生通知 | 新闻 | 学院动态 |
|
||||
| -------- | -------- | ---- | -------- |
|
||||
| 1 | 2 | 3 | 4 |
|
||||
|
||||
<route name="研究生院" author="MilkShakeYoung" example="/njust/gs/2" path="/universities/njust/gs/:type" :paramsDesc="['1 博闻讲堂, 2 学术公告']"/>
|
||||
</route>
|
||||
|
||||
<route name="南京理工大学财务处" author="MilkShakeYoung" example="/njust/cwc/1" path="/universities/njust/cwc/:type" :paramsDesc="['1 为新闻及通知, 2 为办事指南']"/>
|
||||
|
||||
| 新闻及通知 | 办事指南 |
|
||||
| ---------- | -------- |
|
||||
| 1 | 2 |
|
||||
|
||||
</route>
|
||||
|
||||
<route name="南京理工大学研究生院" author="MilkShakeYoung" example="/njust/gs/1" path="/universities/njust/gs/:type" :paramsDesc="['1 为通知公告, 2 为学术公告']"/>
|
||||
|
||||
| 通知公告 | 学术公告 |
|
||||
| -------- | -------- |
|
||||
| 1 | 2 |
|
||||
|
||||
</route>
|
||||
|
||||
### 四川旅游学院
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const axios = require('../../../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const map = new Map([[1, { title: '南京理工大学研究生院 -- 博闻讲堂', id: '/sytzgg_4568' }], [2, { title: '南京理工大学研究生院 -- 学术公告', id: '/xshdggl' }]]);
|
||||
const map = new Map([[1, { title: '南京理工大学研究生院 -- 通知公告', id: '/sytzgg_4568' }], [2, { title: '南京理工大学研究生院 -- 学术公告', id: '/xshdggl' }]]);
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = Number.parseInt(ctx.params.type);
|
||||
|
|
@ -19,7 +19,7 @@ module.exports = async (ctx) => {
|
|||
const list = $('.wp_article_list li');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '南京理工大学研究生网站',
|
||||
title: map.get(type).title,
|
||||
link: 'https://gs.njust.edu.cn',
|
||||
// description: '',
|
||||
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
const axios = require('../../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const baseURL = 'http://jwc.njust.edu.cn';
|
||||
const res = await axios({
|
||||
method: 'get',
|
||||
url: 'http://jwc.njust.edu.cn/1216/list.htm',
|
||||
headers: {
|
||||
Referer: 'https://jwc.njust.edu.cn',
|
||||
},
|
||||
});
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('tr', 'table#newslist');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '南京理工大学教务处',
|
||||
link: 'http://jwc.njust.edu.cn/1216/list.htm',
|
||||
description: '教师通知',
|
||||
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
|
||||
return {
|
||||
title: item.find('a').text(),
|
||||
link: `${baseURL + $(item.find('a')).attr('href')}`,
|
||||
pubDate: new Date(item.find('td[width="14%"]').text()).toUTCString(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue