parent
f7add90bee
commit
c64b62a85e
|
|
@ -18,6 +18,12 @@ pageClass: routes
|
|||
|
||||
</RouteEn>
|
||||
|
||||
## Chinese Social Science Net
|
||||
|
||||
### Institute of Law
|
||||
|
||||
<RouteEn author="HankChow" example="/cssn/iolaw/zxzp" path="/cssn/iolaw/:section?" :paramsDesc="['Section ID, can be found in the URL. For example, the Section ID of URL `http://iolaw.cssn.cn/zxzp/` is `zxzp`. The default value is `zxzp`']"/>
|
||||
|
||||
## gradCafe
|
||||
|
||||
### gradCafe result
|
||||
|
|
|
|||
|
|
@ -721,6 +721,12 @@ path="/ctfhub/upcoming/:limit?"
|
|||
|
||||
<Route author="nczitzk" example="/cpta/notice" path="/cpta/notice" />
|
||||
|
||||
## 中国社会科学网
|
||||
|
||||
### 中国法学网
|
||||
|
||||
<Route author="HankChow" example="/cssn/iolaw/zxzp" path="/cssn/iolaw/:section?" :paramsDesc="['板块 ID,可在 URL 找到。例如页面 URL 为 `http://iolaw.cssn.cn/zxzp/`,则板块 ID 为 `zxzp`。若不填该参数,默认为 `zxzp`']"/>
|
||||
|
||||
## 中国研究生招生信息网
|
||||
|
||||
### 考研热点新闻
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const section = ctx.params.section ?? 'zxzp';
|
||||
const domain = 'iolaw.cssn.cn';
|
||||
const response = await got(`http://${domain}/${section}/`);
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('div.notice_right ul li')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
const url = `http://${domain}` + item.find('a').attr('href').substr(1);
|
||||
const title = item.find('a div.title').text();
|
||||
const publish_time = parseDate(item.find('a p').text());
|
||||
return {
|
||||
title,
|
||||
link: url,
|
||||
author: '中国法学网',
|
||||
pubtime: publish_time,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '中国法学网',
|
||||
url: `http://${domain}/${section}/`,
|
||||
description: '中国法学网',
|
||||
item: list.map((item) => ({
|
||||
title: item.title,
|
||||
pubDate: item.pubtime,
|
||||
link: item.link,
|
||||
author: item.author,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/iolaw/:section?': ['HankChow'],
|
||||
};
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
module.exports = {
|
||||
'cssn.cn': {
|
||||
_name: '中国社会科学网',
|
||||
iolaw: [
|
||||
{
|
||||
title: '中国法学网',
|
||||
docs: 'https://docs.rsshub.app/study.html#zhong-guo-she-hui-ke-xue-wang',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/iolaw/:section?', require('./iolaw'));
|
||||
};
|
||||
Loading…
Reference in New Issue