diff --git a/docs/README.md b/docs/README.md index 942feeb49..bcd92f094 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2564,4 +2564,8 @@ board 和 build 可在[这里](http://api.ineal.me/tss/status)查看 ### 扇贝 - + + +### 36kr + + diff --git a/router.js b/router.js index bf056eb87..f6854dca0 100644 --- a/router.js +++ b/router.js @@ -914,4 +914,7 @@ router.get('/facebook/page/:id', require('./routes/facebook/page')); // 停电通知 router.get('/tingdiantz/95598/:orgNo/:provinceNo/:outageStartTime/:outageEndTime/:scope?', require('./routes/tingdiantz/95598')); +// 36kr +router.get('/36kr/search/article/:keyword', require('./routes/36kr/search/article')); + module.exports = router; diff --git a/routes/36kr/search/article.js b/routes/36kr/search/article.js new file mode 100644 index 000000000..04be8739a --- /dev/null +++ b/routes/36kr/search/article.js @@ -0,0 +1,35 @@ +const axios = require('../../../utils/axios'); + +module.exports = async (ctx) => { + const { keyword = '' } = ctx.params; + const response = await axios({ + method: 'get', + url: `https://36kr.com/pp/api/search/entity-search?page=1&per_page=20&sort=date&entity_type=post&keyword=${encodeURIComponent(keyword)}`, + }); + + const load = async (link) => { + const response = await axios.get(link); + const data = JSON.parse(response.data.match(/