${item.summary}
${item.summary}
`; + // date + const date = $('div.story-calendar').text(); + // desc + const desc = `${$(author_block)}${$('div.story-content').html()}`; + + return { + title: h1, + description: desc, + pubDate: new Date(`${date}T09:00:00+0800`).toUTCString(), + link: line, + }; + }) + ); + // 執行一個切片 (20 個文章 URL) 的任務並將結果資料推至 rss 値 + return await Promise.all(now); +} + +module.exports = async (ctx) => { + const range = ctx.params.range || 'latest'; + const category = ctx.params.category || 'all'; + + // for range validation + const num = /^[1-9][0-9]{3}$/; + const current_year = new Date().getFullYear(); + // placeholders + let title = '傳媒透視'; + let rss = [ + { + description: '${s_author}
Invalid :range input.
所輸入:range參數有誤。
所输入:range参数有误。