diff --git a/docs/en/study.md b/docs/en/study.md index 103701841..3c63f16b7 100644 --- a/docs/en/study.md +++ b/docs/en/study.md @@ -50,6 +50,44 @@ pageClass: routes +## MindMeister + +### Public Maps + + + +| Categories | parameter | +| -------- | --------------- | +| Featured Map | mind-map-examples | +| Business | business | +| Design | design | +| Education | education | +| Entertainment | entertainment | +| Life | life | +| Marketing | marketing | +| Productivity | productivity | +| Summaries | summaries | +| Technology | technology | +| Other | other | + +| Languages | parameter | +| -------- | --------------- | +| English | en | +| Deutsch | de | +| Français | fr | +| Español | es | +| Português | pt | +| Nederlands | nl | +| Dansk | da | +| Русский | ru | +| 日本語 | ja | +| Italiano | it | +| 简体中文 | zh | +| 한국어 | ko | +| Other | other | + + + ## ORCID ### Works List @@ -60,7 +98,7 @@ pageClass: routes ### News - + ## XMind diff --git a/docs/study.md b/docs/study.md index f63c6278e..8d7ca8cc3 100644 --- a/docs/study.md +++ b/docs/study.md @@ -123,6 +123,44 @@ path="/ctfhub/upcoming/:limit?" +## MindMeister + +### 公开思维导图 + + + +| 分类 | 参数 | +| ------ | ----------------- | +| 精选思维导图 | mind-map-examples | +| 商务 | business | +| 设计 | design | +| 教育 | education | +| 娱乐 | entertainment | +| 生活 | life | +| 营销 | marketing | +| 生产力 | productivity | +| 概要 | summaries | +| 科技 | technology | +| 其他 | other | + +| 语言 | 参数 | +| ---------- | ----- | +| English | en | +| Deutsch | de | +| Français | fr | +| Español | es | +| Português | pt | +| Nederlands | nl | +| Dansk | da | +| Русский | ru | +| 日本語 | ja | +| Italiano | it | +| 简体中文 | zh | +| 한국어 | ko | +| Other | other | + + + ## NEEA 中国教育考试网 ### 国家教育考试 diff --git a/lib/v2/mindmeister/example.js b/lib/v2/mindmeister/example.js new file mode 100644 index 000000000..764ef3f66 --- /dev/null +++ b/lib/v2/mindmeister/example.js @@ -0,0 +1,44 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { art } = require('@/utils/render'); +const path = require('path'); +const baseUrl = 'https://www.mindmeister.com'; + +module.exports = async (ctx) => { + const { category = 'mind-map-examples', language = 'en' } = ctx.params; + const link = `${baseUrl}${language === 'en' || language === 'other' ? '' : `/${language}`}/${category === 'mind-map-examples' ? category : `mind-maps/${category}?language=${language}`}`; + const respsonse = await got(link); + + const $ = cheerio.load(respsonse.data); + + const items = $('#public-listing .map-tile-wrapper') + .toArray() + .map((item) => { + item = $(item); + const imageUrl = new URL( + item + .find('.map-wrapper') + .attr('style') + .match(/url\('(.*)'\);/)[1] + ).href; + + return { + title: item.find('.title').text(), + description: art(path.join(__dirname, 'templates/image.art'), { + src: imageUrl.split('?')[0], + alt: item.find('.title').text().trim(), + }), + link: item.find('.title').attr('href'), + author: item.find('.author').text().trim().replace(/^by/, ''), + category: item.find('.fw-bold').text(), + }; + }); + + ctx.state.data = { + title: $('head title').text(), + description: $('head meta[name=description]').text(), + link, + item: items, + language, + }; +}; diff --git a/lib/v2/mindmeister/maintainer.js b/lib/v2/mindmeister/maintainer.js new file mode 100644 index 000000000..34a84b1ce --- /dev/null +++ b/lib/v2/mindmeister/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:category?/:language?': ['TonyRL'], +}; diff --git a/lib/v2/mindmeister/radar.js b/lib/v2/mindmeister/radar.js new file mode 100644 index 000000000..fdde3009b --- /dev/null +++ b/lib/v2/mindmeister/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'mindmeister.com': { + _name: 'MindMeister', + '.': [ + { + title: '分类', + docs: 'https://docs.rsshub.app/study.html#mindmeister', + source: ['/:language/mind-maps/:category', '/:language/:category', '/:category'], + target: (params) => `/mindmeister/${params.category}${params.language ? `/${params.language}` : ''}`, + }, + ], + }, +}; diff --git a/lib/v2/mindmeister/router.js b/lib/v2/mindmeister/router.js new file mode 100644 index 000000000..b25dfd25c --- /dev/null +++ b/lib/v2/mindmeister/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/:category?/:language?', require('./example')); +}; diff --git a/lib/v2/mindmeister/templates/image.art b/lib/v2/mindmeister/templates/image.art new file mode 100644 index 000000000..40140a947 --- /dev/null +++ b/lib/v2/mindmeister/templates/image.art @@ -0,0 +1 @@ +{{ alt }}