diff --git a/docs/anime.md b/docs/anime.md index 957f27137b3836..c90672e28fe449 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -831,3 +831,9 @@ Sources ### 當季新番 + +## 偶像荣耀 + +### 新闻推送 + + diff --git a/docs/en/anime.md b/docs/en/anime.md index 765d0f51eead55..3ee667a9df592c 100644 --- a/docs/en/anime.md +++ b/docs/en/anime.md @@ -275,3 +275,9 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv ### Origins Search + +## IDOLY PRIDE + +### News + + diff --git a/lib/v2/idolypride/maintainer.js b/lib/v2/idolypride/maintainer.js new file mode 100644 index 00000000000000..14d9cf4db6a044 --- /dev/null +++ b/lib/v2/idolypride/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/news': ['Mingxia1'], +}; \ No newline at end of file diff --git a/lib/v2/idolypride/news.js b/lib/v2/idolypride/news.js new file mode 100644 index 00000000000000..ab41ec532b302f --- /dev/null +++ b/lib/v2/idolypride/news.js @@ -0,0 +1,32 @@ +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); + +module.exports = async (ctx) => { + + const response = await got({ + method: 'get', + url: 'https://idolypride.jp/wp-json/wp/v2/news', + }); + const list = response.data; + + ctx.state.data = { + title: '偶像荣耀-新闻', + link: 'https://idolypride.jp/news', + item: + list + .map((item) => { + const title = item.title.rendered; + const link = item.link; + const pubDate = timezone(parseDate(item.date_gmt), 0); + const rendered = item.content.rendered; + + return { + title, + link, + pubDate, + description: rendered, + }; + }), + }; +}; \ No newline at end of file diff --git a/lib/v2/idolypride/radar.js b/lib/v2/idolypride/radar.js new file mode 100644 index 00000000000000..6275c6b8e43bdf --- /dev/null +++ b/lib/v2/idolypride/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'idolypride.jp': { + _name: '偶像荣耀', + '.': [ + { + title: '新闻', + docs: 'https://docs.rsshub.app/anime.html#ou-xiang-rong-yao', + source: '/news', + target: '/idolypride/news' + } + ] + } +}; \ No newline at end of file diff --git a/lib/v2/idolypride/router.js b/lib/v2/idolypride/router.js new file mode 100644 index 00000000000000..d1acb959aeab8d --- /dev/null +++ b/lib/v2/idolypride/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/news', require('./news')); +}; \ No newline at end of file