diff --git a/lib/v2/onehu/common.js b/lib/v2/onehu/common.js index 21cdb2709..705184a3d 100644 --- a/lib/v2/onehu/common.js +++ b/lib/v2/onehu/common.js @@ -8,20 +8,21 @@ module.exports = async (ctx) => { const response = await got(link); const data = response.data; const $ = cheerio.load(data); - const list = $('#board article').toArray().map((item) => { - item = $(item); - return { - title: item.find('.index-header').text(), - link: item.find('.index-header').children('a').attr('href'), - description: item.find('.index-excerpt.index-excerpt__noimg').children('div').text(), - pubDate: timezone(parseDate(item.find('.post-meta.mr-3').children('time').attr('datetime'), 'YYYY年MM月DD日 HH:mm'), +8), - }; - }); + const list = $('#board article') + .toArray() + .map((item) => { + item = $(item); + return { + title: item.find('.index-header').text(), + link: item.find('.index-header').children('a').attr('href'), + description: item.find('.index-excerpt.index-excerpt__noimg').children('div').text(), + pubDate: timezone(parseDate(item.find('.post-meta.mr-3').children('time').attr('datetime'), 'YYYY年MM月DD日 HH:mm'), +8), + }; + }); ctx.state.data = { title: $('title').text(), link, item: list, }; - }; diff --git a/website/docs/routes/new-media.mdx b/website/docs/routes/new-media.mdx index b0a09c6a5..12e4f7b7d 100644 --- a/website/docs/routes/new-media.mdx +++ b/website/docs/routes/new-media.mdx @@ -4594,6 +4594,12 @@ 根据维基新闻的[sitemap](https://zh.wikinews.org/wiki/Special:%E6%96%B0%E9%97%BB%E8%AE%A2%E9%98%85)获取新闻全文。目前仅支持中文维基新闻。 +## 我不是盐神 {#wo-bu-shi-yan-shen} + +### 首页 {#wo-bu-shi-yan-shen-shou-ye} + + + ## 乌有之乡 {#wu-you-zhi-xiang} ### 栏目 {#wu-you-zhi-xiang-lan-mu} @@ -5288,9 +5294,3 @@ ### 公众号 {#zi-you-wei-xin-gong-zhong-hao} - -## 我不是盐神 {#wo-bu-shi-yan-shen} - -### 首页 {#wo-bu-shi-yan-shen-shou-ye} - -