diff --git a/docs/en/study.md b/docs/en/study.md index 65f2236bb..2683466cc 100644 --- a/docs/en/study.md +++ b/docs/en/study.md @@ -18,6 +18,12 @@ pageClass: routes +## Chinese Social Science Net + +### Institute of Law + + + ## gradCafe ### gradCafe result diff --git a/docs/study.md b/docs/study.md index 0694a2052..839961413 100644 --- a/docs/study.md +++ b/docs/study.md @@ -721,6 +721,12 @@ path="/ctfhub/upcoming/:limit?" +## 中国社会科学网 + +### 中国法学网 + + + ## 中国研究生招生信息网 ### 考研热点新闻 diff --git a/lib/v2/cssn/iolaw.js b/lib/v2/cssn/iolaw.js new file mode 100644 index 000000000..e013b4e92 --- /dev/null +++ b/lib/v2/cssn/iolaw.js @@ -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, + })), + }; +}; diff --git a/lib/v2/cssn/maintainer.js b/lib/v2/cssn/maintainer.js new file mode 100644 index 000000000..56ab62b77 --- /dev/null +++ b/lib/v2/cssn/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/iolaw/:section?': ['HankChow'], +}; diff --git a/lib/v2/cssn/radar.js b/lib/v2/cssn/radar.js new file mode 100644 index 000000000..8dcf140ce --- /dev/null +++ b/lib/v2/cssn/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/cssn/router.js b/lib/v2/cssn/router.js new file mode 100644 index 000000000..6748ded48 --- /dev/null +++ b/lib/v2/cssn/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/iolaw/:section?', require('./iolaw')); +};