feat(route): add 西北农林科技大学 (#7966)

This commit is contained in:
Ding Yuxiao 2021-08-12 16:33:28 +08:00 committed by GitHub
parent 1c9c4ccfc8
commit d0beccbf43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 301 additions and 0 deletions

View File

@ -1958,6 +1958,44 @@ type 列表:
</Route>
## 西北农林科技大学
### 校园要闻
<Route author="dingyx99" example="/nwafu/news" path="/nwafu/news" />
### 教务公告
<Route author="dingyx99" example="/nwafu/jiaowu" path="/nwafu/jiaowu" />
### 后勤公告
<Route author="dingyx99" example="/nwafu/gs" path="/nwafu/gs" />
### 图书馆公告
<Route author="dingyx99" example="/nwafu/lib" path="/nwafu/lib" />
### 网教中心公告
<Route author="dingyx99" example="/nwafu/nic" path="/nwafu/nic" />
### 团委公告
<Route author="dingyx99" example="/nwafu/54youth" path="/nwafu/54youth" />
### 计财处公告
<Route author="dingyx99" example="/nwafu/jcc" path="/nwafu/jcc" />
### 研究生院公告
<Route author="dingyx99" example="/nwafu/yjshy" path="/nwafu/yjshy" />
### 信息工程学院公告
<Route author="dingyx99" example="/nwafu/cie" path="/nwafu/cie" />
## 西南财经大学
### 经济信息工程学院

View File

@ -807,6 +807,17 @@ router.get('/uestc/cqe/:type?', require('./routes/universities/uestc/cqe'));
router.get('/uestc/gr', require('./routes/universities/uestc/gr'));
router.get('/uestc/sice', require('./routes/universities/uestc/sice'));
// 西北农林科技大学
router.get('/nwafu/news', require('./routes/universities/nwafu/news'));
router.get('/nwafu/jiaowu', require('./routes/universities/nwafu/jiaowu'));
router.get('/nwafu/gs', require('./routes/universities/nwafu/gs'));
router.get('/nwafu/lib', require('./routes/universities/nwafu/lib'));
router.get('/nwafu/nic', require('./routes/universities/nwafu/nic'));
router.get('/nwafu/54youth', require('./routes/universities/nwafu/54youth'));
router.get('/nwafu/jcc', require('./routes/universities/nwafu/jcc'));
router.get('/nwafu/yjshy', require('./routes/universities/nwafu/yjshy'));
router.get('/nwafu/cie', require('./routes/universities/nwafu/cie'));
// 云南大学
router.get('/ynu/grs/zytz', require('./routes/universities/ynu/grs/zytz'));
router.get('/ynu/grs/qttz/:category', require('./routes/universities/ynu/grs/qttz'));

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://54youth.nwsuaf.edu.cn/wjtz/tzgg/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.news-list > li');
ctx.state.data = {
title: '西北农林科技大学 - 团委公告',
link: 'https://54youth.nwsuaf.edu.cn/wjtz/tzgg/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://cie.nwafu.edu.cn/dtytz/tzgg/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('#sort > dd > ul > li');
ctx.state.data = {
title: '西北农林科技大学 - 信工学院公告',
link: 'https://cie.nwafu.edu.cn/dtytz/tzgg/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://gs.nwsuaf.edu.cn/tzggB/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('#sort > dd > .list > li');
ctx.state.data = {
title: '西北农林科技大学 - 后勤公告',
link: 'https://gs.nwsuaf.edu.cn/tzggB/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://jcc.nwafu.edu.cn/tzgg/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('#sort > dd > .list > li');
ctx.state.data = {
title: '西北农林科技大学 - 计财处公告',
link: 'https://jcc.nwafu.edu.cn/tzgg/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://jiaowu.nwafu.edu.cn/tzggB/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.list-i > ul > li');
ctx.state.data = {
title: '西北农林科技大学 - 教务公告',
link: 'https://jiaowu.nwafu.edu.cn/tzggB/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://lib.nwafu.edu.cn/gg/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.articleList2.articleList > ul > li');
ctx.state.data = {
title: '西北农林科技大学 - 图书馆公告',
link: 'https://lib.nwafu.edu.cn/gg/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text().slice(1, -1), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://news.nwafu.edu.cn/xnxw/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.list01 > li');
ctx.state.data = {
title: '西北农林科技大学 - 校园新闻',
link: 'https://news.nwafu.edu.cn/xnxw/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://nic.nwafu.edu.cn/tzgg1/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('#sort > dd > .list > li');
ctx.state.data = {
title: '西北农林科技大学 - 网教中心公告',
link: 'https://nic.nwafu.edu.cn/tzgg1/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text(), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};

View File

@ -0,0 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://yjshy.nwafu.edu.cn/tzgg/index.htm',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.sort_rightcont > ul > li');
ctx.state.data = {
title: '西北农林科技大学 - 研究生院公告',
link: 'https://yjshy.nwafu.edu.cn/tzgg/index.htm',
item:
list &&
list
.map((index, item) => {
item = $(item);
return { title: item.find('li a').text(), description: item.find('li a').text(), pubDate: parseDate(item.find('span').text().slice(1, -1), 'YYYY/MM/DD'), link: item.find('li a').attr('href') };
})
.get(),
};
};