diff --git a/docs/other.md b/docs/other.md
index 27567f2fb6..fa87b28e54 100644
--- a/docs/other.md
+++ b/docs/other.md
@@ -1257,6 +1257,12 @@ type 为 all 时,category 参数不支持 cost 和 free
`; // 图片链接
const author = content.data.author.name; // 作者
- const description = content.data.description + '
' + imgUrl + '
' + itemUrl; // 拼接出描述
+ const description = content.data.description + '
' + imgUrl + '
' + itemUrl; // 拼接出详情,包括文字描述、封面图、视频链接
- const cache = await ctx.cache.get(itemUrl); // 得到全局中的缓存信息
- // 判断缓存是否存在,如果存在即跳过此次获取的信息
+ const cache = await ctx.cache.get(itemUrl); // ### 得到全局中的缓存信息
+ // ### 判断缓存是否存在,如果存在即跳过此次获取的信息
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
- // 设置 RSS feed item
+ // ### 设置 RSS feed item
const single = {
title: title,
- link: itemUrl,
+ link: videoUrl,
author: author,
description: description,
pubDate: new Date(date).toUTCString(),
};
- // 设置缓存
+ // ### 设置缓存
ctx.cache.set(itemUrl, JSON.stringify(single));
return Promise.resolve(single);
}
diff --git a/lib/routes/universities/nciae/news.js b/lib/routes/universities/nciae/news.js
new file mode 100644
index 0000000000..124fc6e9c0
--- /dev/null
+++ b/lib/routes/universities/nciae/news.js
@@ -0,0 +1,58 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = `http://nciae.edu.cn/index/xw2.htm`;
+ const response = await got({
+ method: 'get',
+ url: url,
+ });
+ const $ = cheerio.load(response.data);
+ // ## 获取列表
+ const list = $('#container > ul > li > a').get();
+ // ## 定义输出的item
+ const out = await Promise.all(
+ // ### 遍历列表,筛选出自己想要的内容
+ list.map(async (item) => {
+ const itemSingle = cheerio.load(item);
+ const title = itemSingle.text();
+ const re = /]*href=['"]([^"]*)['"][^>]*>(.*?)<\/a>/g;
+ let singleUrl = '';
+ if (re.exec(itemSingle.html()) !== null) {
+ singleUrl = RegExp.$1;
+ }
+ singleUrl = singleUrl.replace('..', 'http://nciae.edu.cn');
+ const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息
+ // ### 判断缓存是否存在,如果存在即跳过此次获取的信息
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+ // 获取详情页面的介绍
+ const detail_response = await got({
+ method: 'get',
+ url: singleUrl,
+ });
+ const $ = cheerio.load(detail_response.data);
+ const detail_content = $('#content > form').html();
+ // ### 设置 RSS feed item
+ const single = {
+ title: title,
+ link: singleUrl,
+ // author: author,
+ description: detail_content,
+ // pubDate: updateDate,
+ };
+ // // ### 设置缓存
+ ctx.cache.set(singleUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ // }
+ })
+ );
+
+ ctx.state.data = {
+ title: `新闻 - 北华航天工业学院`,
+ link: 'http://nciae.edu.cn/index/xw2.htm',
+ description: `新闻 - 北华航天工业学院`,
+ item: out,
+ };
+};
diff --git a/lib/routes/universities/nciae/tzgg.js b/lib/routes/universities/nciae/tzgg.js
new file mode 100644
index 0000000000..467e38133d
--- /dev/null
+++ b/lib/routes/universities/nciae/tzgg.js
@@ -0,0 +1,58 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = `http://nciae.edu.cn/index/tzgg.htm`;
+ const response = await got({
+ method: 'get',
+ url: url,
+ });
+ const $ = cheerio.load(response.data);
+ // ## 获取列表
+ const list = $('#container > ul > li > a').get();
+ // ## 定义输出的item
+ const out = await Promise.all(
+ // ### 遍历列表,筛选出自己想要的内容
+ list.map(async (item) => {
+ const itemSingle = cheerio.load(item);
+ const title = itemSingle.text();
+ const re = /]*href=['"]([^"]*)['"][^>]*>(.*?)<\/a>/g;
+ let singleUrl = '';
+ if (re.exec(itemSingle.html()) !== null) {
+ singleUrl = RegExp.$1;
+ }
+ singleUrl = singleUrl.replace('..', 'http://nciae.edu.cn');
+ const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息
+ // ### 判断缓存是否存在,如果存在即跳过此次获取的信息
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+ // 获取详情页面的介绍
+ const detail_response = await got({
+ method: 'get',
+ url: singleUrl,
+ });
+ const $ = cheerio.load(detail_response.data);
+ const detail_content = $('#content > form').html();
+ // ### 设置 RSS feed item
+ const single = {
+ title: title,
+ link: singleUrl,
+ // author: author,
+ description: detail_content,
+ // pubDate: updateDate,
+ };
+ // // ### 设置缓存
+ ctx.cache.set(singleUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ // }
+ })
+ );
+
+ ctx.state.data = {
+ title: `通知公告 - 北华航天工业学院`,
+ link: 'http://nciae.edu.cn/index/xw2.htm',
+ description: `通知公告 - 北华航天工业学院`,
+ item: out,
+ };
+};
diff --git a/lib/routes/universities/nciae/xsxx.js b/lib/routes/universities/nciae/xsxx.js
new file mode 100644
index 0000000000..d5d4c36210
--- /dev/null
+++ b/lib/routes/universities/nciae/xsxx.js
@@ -0,0 +1,58 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = `http://nciae.edu.cn/index/xsxx.htm`;
+ const response = await got({
+ method: 'get',
+ url: url,
+ });
+ const $ = cheerio.load(response.data);
+ // ## 获取列表
+ const list = $('#container > ul > li > a').get();
+ // ## 定义输出的item
+ const out = await Promise.all(
+ // ### 遍历列表,筛选出自己想要的内容
+ list.map(async (item) => {
+ const itemSingle = cheerio.load(item);
+ const title = itemSingle.text();
+ const re = /]*href=['"]([^"]*)['"][^>]*>(.*?)<\/a>/g;
+ let singleUrl = '';
+ if (re.exec(itemSingle.html()) !== null) {
+ singleUrl = RegExp.$1;
+ }
+ singleUrl = singleUrl.replace('..', 'http://nciae.edu.cn');
+ const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息
+ // ### 判断缓存是否存在,如果存在即跳过此次获取的信息
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+ // 获取详情页面的介绍
+ const detail_response = await got({
+ method: 'get',
+ url: singleUrl,
+ });
+ const $ = cheerio.load(detail_response.data);
+ const detail_content = $('#content > form').html();
+ // ### 设置 RSS feed item
+ const single = {
+ title: title,
+ link: singleUrl,
+ // author: author,
+ description: detail_content,
+ // pubDate: updateDate,
+ };
+ // // ### 设置缓存
+ ctx.cache.set(singleUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ // }
+ })
+ );
+
+ ctx.state.data = {
+ title: `学术信息 - 北华航天工业学院`,
+ link: 'http://nciae.edu.cn/index/xw2.htm',
+ description: `学术信息 - 北华航天工业学院`,
+ item: out,
+ };
+};
diff --git a/lib/routes/zhilian/index.js b/lib/routes/zhilian/index.js
new file mode 100644
index 0000000000..4509a63df1
--- /dev/null
+++ b/lib/routes/zhilian/index.js
@@ -0,0 +1,80 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const city = ctx.params.city;
+ const keyword = ctx.params.keyword;
+ const city_api_url = `https://fe-api.zhaopin.com/c/i/city-page/user-city?ipCity=${encodeURI(city)}`;
+
+ const city_response = await got({
+ method: 'get',
+ url: city_api_url,
+ });
+ const city_response_data = city_response.data.data;
+ if (city_response_data.name === undefined) {
+ console.log('No This City');
+ } else {
+ const job_api_url = `https://fe-api.zhaopin.com/c/i/sou?pageSize=20&cityId=${city_response_data.code}&workExperience=-1&education=5&companyType=-1&employmentType=-1&jobWelfareTag=-1&kw=${encodeURI(keyword)}&kt=3`;
+ const job_response = await got({
+ method: 'get',
+ url: job_api_url,
+ });
+
+ // ## 获取列表
+ const list = job_response.data.data.results;
+ // ## 定义输出的item
+ const out = await Promise.all(
+ // ### 遍历列表,筛选出自己想要的内容
+ list.map(async (item) => {
+ const jobName = item.jobName;
+ const companyName = item.company.name;
+ const companyType = item.company.type.name;
+ const companySize = item.company.size.name;
+ const companyUrl = item.company.url;
+ const companyLogo = item.companyLogo; // logo
+ const salary = item.salary;
+ const jobType = item.jobType.items[0].name;
+ const positionURL = item.positionURL; // 原网页链接
+ const updateDate = item.updateDate; // 更新时间
+
+ // 获取详情页面的介绍
+ const detail_response = await got({
+ method: 'get',
+ url: positionURL,
+ });
+ const $ = cheerio.load(detail_response.data);
+ const detail_content = $('.describtion').html();
+ // # 拼接相关信息
+ // ## 拼接标题
+ const title = `${jobName}[${salary}]-${jobType}`;
+ // ## 公司信息
+ const companyDes = `${companyName}
${companyType}[${companySize}]
点击查看公司详情`;
+ const cache_information = positionURL + updateDate; // 确保唯一性
+ const cache = await ctx.cache.get(cache_information); // ### 得到全局中的缓存信息
+ // ### 判断缓存是否存在,如果存在即跳过此次获取的信息
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+ // ### 设置 RSS feed item
+ const single = {
+ title: title,
+ link: positionURL,
+ // author: author,
+ description: `如需申请此工作,建议打开原网页进行操作。