diff --git a/docs/multimedia.md b/docs/multimedia.md index 42b341e32..4b65dc518 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -206,6 +206,12 @@ pageClass: routes +## 故事 FM + +### 首页 + + + ## 开眼 ### 每日精选 diff --git a/docs/other.md b/docs/other.md index 54d50b878..4bd8f02e8 100644 --- a/docs/other.md +++ b/docs/other.md @@ -284,7 +284,7 @@ type 为 all 时,category 参数不支持 cost 和 free ### 分类目录 - + 顶级目录分类可在目录分类页[查看](https://zh.wikihow.com/Special:CategoryListing), 支持二级目录 @@ -313,9 +313,9 @@ type 为 all 时,category 参数不支持 cost 和 free 分类 -| 最新 | 推荐 | 最热 | -| ---- | ---- | ---- | -| new | rec | hot | +| 推荐 | 最热 | +| ---- | ---- | +| rec | hot | 目录类型 @@ -1091,7 +1091,7 @@ type 为 all 时,category 参数不支持 cost 和 free ### 全屋记 - + 类型 @@ -1100,6 +1100,7 @@ type 为 all 时,category 参数不支持 cost 和 free | default | hot | new | + ## 油价 ### 今日油价 diff --git a/docs/traditional-media.md b/docs/traditional-media.md index d77ab8741..8548e3d12 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -376,3 +376,17 @@ category 对应的关键词有 | 资讯 | 风景 | 体验 | 交通 | + +## 中国日报 + +### 英语点津 + + + +目录分类 + +| 最新 | 双语 | 热词 | 口语 | 译词 | 视频 | 听力 | 专栏 | 文件 | 考试 | +| --------- | -------------- | ------------- | --------------- | ------------- | ----------- | -------- | --------- | ------------------------ | ------------ | +| thelatest | news_bilingual | news_hotwords | practice_tongue | trans_collect | video_links | audio_cd | columnist | 5af95d44a3103f6866ee845c | englishexams | + + diff --git a/lib/router.js b/lib/router.js index 1a990b295..eb04507cf 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1597,6 +1597,12 @@ router.get('/aliyun/database_month', require('./routes/aliyun/database_month')); // 礼物说 router.get('/liwushuo/index', require('./routes/liwushuo/index.js')); +// 故事fm +router.get('/storyfm/index', require('./routes/storyfm/index.js')); + +// 中国日报 +router.get('/chinadaily/english/:category', require('./routes/chinadaily/english.js')); + // leboncoin router.get('/leboncoin/ad/:query', require('./routes/leboncoin/ad.js')); diff --git a/lib/routes/afdian/explore.js b/lib/routes/afdian/explore.js index 6088acbb1..beb680e29 100644 --- a/lib/routes/afdian/explore.js +++ b/lib/routes/afdian/explore.js @@ -24,7 +24,6 @@ const categoryMap = { const typeToLabel = { rec: '推荐', hot: '人气', - new: '新入驻', }; module.exports = async (ctx) => { diff --git a/lib/routes/chinadaily/english.js b/lib/routes/chinadaily/english.js new file mode 100644 index 000000000..890a9927f --- /dev/null +++ b/lib/routes/chinadaily/english.js @@ -0,0 +1,35 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const { category } = ctx.params; + const baseUrl = 'https://language.chinadaily.com.cn'; + const url = `${baseUrl}/${category}`; + const response = await got(url); + const $ = cheerio.load(response.data); + + const categoryName = $('.CT_title') + .first() + .text(); + const items = $('.gy_box') + .map((_, ele) => { + const $item = cheerio.load(ele); + const link = $item('.gy_box_img').attr('href'); + const imgUrl = $item('.gy_box_img img').attr('src'); + const realImgUrl = imgUrl.includes('http') ? imgUrl : `https:${imgUrl}`; + const title = $item('.gy_box_txt2').text(); + const desc = $item('.gy_box_txt3').text(); + return { + title, + link, + description: [``, desc].join('
'), + }; + }) + .get(); + ctx.state.data = { + title: `中国日报 - ${categoryName}`, + description: `中国日报 - ${categoryName}`, + link: url, + item: items, + }; +}; diff --git a/lib/routes/storyfm/index.js b/lib/routes/storyfm/index.js new file mode 100644 index 000000000..af98998d6 --- /dev/null +++ b/lib/routes/storyfm/index.js @@ -0,0 +1,44 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const url = 'http://storyfm.cn'; + const response = await got(url); + const $ = cheerio.load(response.data); + const cnMonth = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二']; + const items = $('.isotope > .isotope-item') + .map((_, ele) => { + const $item = cheerio.load(ele); + const img = $item('.isotope-img-container img').attr('src'); + const infoNode = $item('.isotope-index-text').first(); + const title = infoNode.find('.soundbyte-podcast-progression-title'); + const link = infoNode.find('a.soundbyte-podcast-play-progression').attr('href'); + const time = infoNode.find('.fa-clock-o').text(); + const date = infoNode.find('.soundbyte-podcast-date-progression').text(); + const [month, day, year] = date + .replace(',', '') + .split(' ') + .map((value) => { + if (value.includes('月')) { + const enMongth = cnMonth.findIndex((cnMonthStr) => value.includes(cnMonthStr)); + value = enMongth + 1; + } + return value; + }); + + const pubDate = new Date(`${year}-${month}-${day} ${time}`).toUTCString(); + return { + title, + description: [``, title].join('
'), + link, + pubDate, + }; + }) + .get(); + ctx.state.data = { + title: '故事说FM', + description: '故事说FM', + link: url, + item: items, + }; +};