diff --git a/docs/README.md b/docs/README.md index 4f08a974d3..d51eb08b19 100755 --- a/docs/README.md +++ b/docs/README.md @@ -3136,6 +3136,10 @@ type 为 all 时,category 参数不支持 cost 和 free +### 播客 IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ + + + ### 博客: 敬维 diff --git a/lib/router.js b/lib/router.js index 85388e1e8a..fa0bd2fba4 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1125,6 +1125,9 @@ router.get('/luogu/daily/:id?', require('./routes/luogu/daily')); // 决胜网 router.get('/juesheng', require('./routes/juesheng')); +// 播客IBCラジオ イヤーマイッタマイッタ +router.get('/maitta', require('./routes/maitta')); + // 一些博客 // 敬维-以认真的态度做完美的事情: https://jingwei.link/ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); diff --git a/lib/routes/maitta/index.js b/lib/routes/maitta/index.js new file mode 100644 index 0000000000..c1c5299b56 --- /dev/null +++ b/lib/routes/maitta/index.js @@ -0,0 +1,50 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); +const url = 'https://www.ibc.co.jp/radio/maitta/audio/'; + +module.exports = async (ctx) => { + const res = await axios.get(url); + const $ = cheerio.load(res.data); + const items = $('.broadcast').get(); + ctx.state.data = { + title: 'IBCラジオ イヤーマイッタマイッタ|IBC岩手放送', + link: 'http://www.ibc.co.jp/radio/maitta/audio', + description: $('meta[name=description]').attr('content'), + itunes_author: '水越アナと大塚アナ', + image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/og.png', + language: 'ja', + item: items.map((item) => { + item = $(item); + return { + title: item.find('h3').text(), + description: item + .find('.linecontent') + .text() + .trim(), + link: `https:${ + item + .find('a') + .first() + .attr('href') + .split('?')[0] + }`, + pubDate: new Date( + item + .find('.onairdate') + .text() + .split('日')[0] + .replace(/年|月/g, '-') + ).toUTCString(), + itunes_item_image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/og.png', + enclosure_url: `https:${ + item + .find('a') + .first() + .attr('href') + .split('?')[0] + }`, // 音频链接 + enclosure_type: 'audio/mpeg', + }; + }), + }; +};