diff --git a/docs/new-media.md b/docs/new-media.md index 00cdb1e64b..9a6558b6a0 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -666,6 +666,16 @@ Supported sub-sites: +## 北屋 + + + +| 首页 | 最新资讯和灾难信息 | 生存主义 survival | 运动户外 | 玩物尚志 | 分享下载 | 知行生活 | 商务服务 | +| ---- | ------------------ | ----------------- | -------- | -------- | -------- | -------- | -------- | +| | 最新资讯和灾难信息 | 生存主义 survival | 运动户外 | 玩物尚志 | 分享下载 | 知行生活 | 商务服务 | + + + ## 本地宝 ### 焦点资讯 diff --git a/lib/router.js b/lib/router.js index 36447f863d..f4927d6567 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3733,4 +3733,7 @@ router.get('/dayone/blog', require('./routes/dayone/blog')); // 滴答清单 router.get('/dida365/habit/checkins', require('./routes/dida365/habit-checkins')); +// 北屋 +router.get('/northhouse/:category?', require('./routes/northhouse/index')); + module.exports = router; diff --git a/lib/routes/northhouse/index.js b/lib/routes/northhouse/index.js new file mode 100644 index 0000000000..e6d55b2b5f --- /dev/null +++ b/lib/routes/northhouse/index.js @@ -0,0 +1,55 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const category = ctx.params.category || ''; + + const rootUrl = 'http://www.northhouse.cc'; + const currentUrl = `${rootUrl}${category === '' ? '' : `/category/${category}`}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data.replace(/
<\/div>/g, '