From 75bcfd92d0341c364fa2822f6c1edd07158e98e0 Mon Sep 17 00:00:00 2001 From: sbilly Date: Thu, 3 Sep 2020 02:50:20 +0800 Subject: [PATCH] feat: add MITRE - All Publication (#5526) --- docs/en/other.md | 6 ++++++ docs/other.md | 6 ++++++ lib/router.js | 3 +++ lib/routes/mitre/publications.js | 27 +++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 lib/routes/mitre/publications.js diff --git a/docs/en/other.md b/docs/en/other.md index 9c318a35ab..114c00747f 100644 --- a/docs/en/other.md +++ b/docs/en/other.md @@ -144,6 +144,12 @@ Official Website: [https://www.ssm.gov.mo/apps1/PreventWuhanInfection/en.aspx](h +## MITRE + +### All Publications + + + ## SANS Institute ### Latest conference materials diff --git a/docs/other.md b/docs/other.md index 320a59b560..f635fb991f 100644 --- a/docs/other.md +++ b/docs/other.md @@ -172,6 +172,12 @@ pageClass: routes +## MITRE + +### 全部出版物 + + + ## SANS Institute ### 最新会议材料 diff --git a/lib/router.js b/lib/router.js index abbb8ddef0..e786ec5715 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2014,6 +2014,9 @@ router.get('/sf/sffq-announce', require('./routes/sf/sffq-announce')); router.get('/queshu/sale', require('./routes/queshu/sale')); router.get('/queshu/book/:bookid', require('./routes/queshu/book')); +// MITRE +router.get('/mitre/publications', require('./routes/mitre/publications')); + // SANS router.get('/sans/summit_archive', require('./routes/sans/summit_archive')); diff --git a/lib/routes/mitre/publications.js b/lib/routes/mitre/publications.js new file mode 100644 index 0000000000..392e48ff90 --- /dev/null +++ b/lib/routes/mitre/publications.js @@ -0,0 +1,27 @@ +// MITRE - All Publications + +// const got = require('@/utils/got'); +// const cheerio = require('cheerio'); +const buildData = require("@/utils/common-config"); + +module.exports = async (ctx) => { + const link = `https://www.mitre.org/publications/all`; + const host = `https://www.mitre.org`; + ctx.state.data = await buildData({ + link, + url: link, + title: `%title%`, + params: { + title: "MITRE: All Publications", + host, + link, + }, + item: { + item: "div.list-item", + title: `$('div.list-item div.list-main a span.title').text()`, + link: `'%host%' + $('div.list-item div.list-main a').attr('href')`, + category: `$('div.list-item div.list-main a span.time').text()`, + description: `$('div.list-item div.list-main a span.teaser').html()`, + }, + }); +}; \ No newline at end of file