diff --git a/lib/v2/gamegene/maintainer.js b/lib/v2/gamegene/maintainer.js new file mode 100644 index 000000000..8c0559d27 --- /dev/null +++ b/lib/v2/gamegene/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/news': ['lone1y-51'], +}; diff --git a/lib/v2/gamegene/news.js b/lib/v2/gamegene/news.js new file mode 100644 index 000000000..a93fe643b --- /dev/null +++ b/lib/v2/gamegene/news.js @@ -0,0 +1,50 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const url = 'https://gamegene.cn/news'; + const { data: response } = await got({ + method: 'get', + url, + }); + const $ = cheerio.load(response); + const list = $('div.mr245') + .toArray() + .map((item) => { + item = $(item); + const aEle = item.find('a').first(); + const href = aEle.attr('href'); + const title = aEle.find('h3').first().text(); + const author = item.find('a.namenode').text(); + const category = item.find('span.r').text(); + return { + title, + link: href, + author, + category, + }; + }); + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: response } = await got({ + method: 'get', + url: item.link, + }); + const $ = cheerio.load(response); + const dateTime = $('div.meta').find('time').first().text(); + item.pubDate = parseDate(dateTime); + item.description = $('div.content').first().html(); + return item; + }) + ) + ); + + ctx.state.data = { + // 在此处输出您的 RSS + item: items, + link: url, + title: '游戏基因 GameGene', + }; +}; diff --git a/lib/v2/gamegene/radar.js b/lib/v2/gamegene/radar.js new file mode 100644 index 000000000..73c228162 --- /dev/null +++ b/lib/v2/gamegene/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'gamegene.cn': { + _name: '游戏基因', + news: [ + { + title: '资讯', + docs: 'https://docs.rsshub.app/routes/game#you-xi-ji-yin', + source: ['/news'], + target: '/gamegene/news', + }, + ], + }, +}; diff --git a/lib/v2/gamegene/router.js b/lib/v2/gamegene/router.js new file mode 100644 index 000000000..69a5972f6 --- /dev/null +++ b/lib/v2/gamegene/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/news', require('./news')); +}; diff --git a/website/docs/routes/game.md b/website/docs/routes/game.md index 968e486ae..474736586 100644 --- a/website/docs/routes/game.md +++ b/website/docs/routes/game.md @@ -76,22 +76,22 @@ Categories Language codes -| Language | Code | -| -------------- | ----- | -| Deutsch | de-de | -| English (US) | en-us | -| English (EU) | en-gb | -| Español (EU) | es-es | -| Español (Latino) | es-mx | -| Français | fr-fr | -| Italiano | it-it | -| Português (Brasil) | pt-br | -| Polski | pl-pl | -| Русский | ru-ru | -| 한국어 | ko-kr | -| ภาษาไทย | th-th | -| 日本語 | ja-jp | -| 繁體中文 | zh-tw | +| Language | Code | +| ------------------ | ----- | +| Deutsch | de-de | +| English (US) | en-us | +| English (EU) | en-gb | +| Español (EU) | es-es | +| Español (Latino) | es-mx | +| Français | fr-fr | +| Italiano | it-it | +| Português (Brasil) | pt-br | +| Polski | pl-pl | +| Русский | ru-ru | +| 한국어 | ko-kr | +| ภาษาไทย | th-th | +| 日本語 | ja-jp | +| 繁體中文 | zh-tw | @@ -143,8 +143,8 @@ Region Category -| all | topics | notices | maintenance | updates | status | developers | -| --- | ------ | ------- | ----------- | ------- | -------- | ---------- | +| all | topics | notices | maintenance | updates | status | developers | +| --- | ------ | ------- | ----------- | ------- | ------ | ---------- | @@ -178,9 +178,9 @@ Category -| Latest News | PC | Playstation | Nintendo | Xbox | Moblie | -| ----------- | -- | ----------- | -------- | ---- | ------ | -| latest-news | pc | playstation | nintendo | xbox | moblie | +| Latest News | PC | Playstation | Nintendo | Xbox | Moblie | +| ----------- | --- | ----------- | -------- | ---- | ------ | +| latest-news | pc | playstation | nintendo | xbox | moblie | Or @@ -303,10 +303,10 @@ So the route is [`/itch/devlogs/teamterrible/the-baby-in-yellow`](https://rsshub | filter | switch | ps4 | ps5 | steam | | ------ | ------ | --- | --- | ----- | | all | ✔ | ✔ | ✔ | ✔ | -| jx | ✔ | ✔ | ❌ | ✔ | +| jx | ✔ | ✔ | ❌ | ✔ | | sd | ✔ | ✔ | ✔ | ✔ | -| dl | ❌ | ✔ | ❌ | ✔ | -| vip | ❌ | ❌ | ✔ | ❌ | +| dl | ❌ | ✔ | ❌ | ✔ | +| vip | ❌ | ❌ | ✔ | ❌ | | 北美 | 欧洲(英语) | 法国 | 德国 | 日本 | | ---- | ------------ | ---- | ---- | ---- | @@ -371,8 +371,8 @@ Sorting types, default to `date`: ### Feed The Beast Modpack Updates {#minecraft-feed-the-beast-modpack-updates} -| param | description | -| ------| ------------ | +| param | description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | modpackEntry | The entry name of modpack, can be found in modpack\'s page link, for `https://www.feed-the-beast.com/modpack/ftb_presents_direwolf20_1_16`, use `ftb_presents_direwolf20_1_16`. | @@ -518,8 +518,8 @@ Due to the regional restrictions, an RSSHub deployment in China Mainland may not Language Code | English (US) | 繁體中文 | 한국어 | 日本語 | -| ----- | ----- | ----- | ----- | -| en_US | zh_TW | ko_KR | ja_JP | +| ------------ | -------- | ------ | ------ | +| en_US | zh_TW | ko_KR | ja_JP | @@ -529,15 +529,15 @@ Language Code Sort Method -| Most Relevant | Most Recent | -| -------------- | ---- | -| default | new | +| Most Relevant | Most Recent | +| ------------- | ----------- | +| default | new | Language Code | English (US) | 繁體中文 | 한국어 | 日本語 | -| ----- | ----- | ----- | ----- | -| en_US | zh_TW | ko_KR | ja_JP | +| ------------ | -------- | ------ | ------ | +| en_US | zh_TW | ko_KR | ja_JP | @@ -625,9 +625,9 @@ The year, month and day provided under UTC time zone are the same as the officia -| 首頁 | PC | TV 掌機 | 手機遊戲 | 動漫畫 | 主題報導 | 活動展覽 | 電競 | -| ---- | -- | ------- | -------- | ------ | -------- | -------- | ---- | -| 缺省 | 1 | 3 | 4 | 5 | 9 | 11 | 13 | +| 首頁 | PC | TV 掌機 | 手機遊戲 | 動漫畫 | 主題報導 | 活動展覽 | 電競 | +| ---- | --- | ------- | -------- | ------ | -------- | -------- | ---- | +| 缺省 | 1 | 3 | 4 | 5 | 9 | 11 | 13 | | Switch | PS5 | PS4 | XboxOne | XboxSX | PC 單機 | PC 線上 | iOS | Android | Web | 漫畫 | 動畫 | | ------ | --- | --- | ------- | ------ | ------- | ------- | --- | ------- | --- | ----- | ----- | @@ -709,11 +709,11 @@ The year, month and day provided under UTC time zone are the same as the officia | 炉石传说 | 万智牌 | 游戏王 | 昆特牌 | 影之诗 | 符文之地传奇 | 阴阳师百闻牌 | | :------: | :----: | :----: | :----: | :----: | :----------: | :----------: | -| 17 | 18 | 16 | 19 | 20 | 329 | 221 | +| 17 | 18 | 16 | 19 | 20 | 329 | 221 | | 英雄联盟 | 电子游戏 | 桌面游戏 | 卡牌游戏 | 玩家杂谈 | 二次元 | | :------: | :------: | :------: | :------: | :------: | :----: | -| 112 | 389 | 24 | 102 | 23 | 117 | +| 112 | 389 | 24 | 102 | 23 | 117 | @@ -751,12 +751,12 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` -| 键 | 含义 | 接受的值 | 默认值 | -| ----------- | ----------------------------------- | ------------------------------------------------------------ | ------------ | -| forumType | 主榜类型(仅原神、大别野有cos主榜) | tongren/cos | tongren | +| 键 | 含义 | 接受的值 | 默认值 | +| ----------- | ----------------------------------- | -------------------------------------------------------------------- | ------------ | +| forumType | 主榜类型(仅原神、大别野有cos主榜) | tongren/cos | tongren | | cateType | 子榜类型(仅崩坏三、原神有子榜) | 崩坏三:illustration/comic/cos;原神:illustration/comic/qute/manual | illustration | -| rankingType | 排行榜类型(崩坏二没有日榜) | daily/weekly/monthly | daily | -| lastId | 当前页id(用于分页) | 数字 | 1 | +| rankingType | 排行榜类型(崩坏二没有日榜) | daily/weekly/monthly | daily | +| lastId | 当前页id(用于分页) | 数字 | 1 | 游戏缩写(目前绝区零还没有同人榜 @@ -774,9 +774,9 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` 崩坏三 子榜 -| 插画 | 漫画 | COS | -| ------------ | ----- | ---- | -| illustration | comic | cos | +| 插画 | 漫画 | COS | +| ------------ | ----- | --- | +| illustration | comic | cos | 原神 子榜 @@ -847,15 +847,15 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` 平台 -| 安卓服 | iOS 服 | B 服 | +| 安卓服 | iOS 服 | B 服 | | :-----: | :----: | :------: | -| Android | IOS | Bilibili | +| Android | IOS | Bilibili | 分组 -| 全部 | 系统公告 | 活动公告 | -| :--: | :------: | :------: | -| ALL | SYSTEM | ACTIVITY | +| 全部 | 系统公告 | 活动公告 | +| :---: | :------: | :------: | +| ALL | SYSTEM | ACTIVITY | @@ -1001,12 +1001,18 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` -| Switch | PS4 | PC | Xbox | -| ------ | --- | -- | ---- | -| 1 | 2 | 3 | 4 | +| Switch | PS4 | PC | Xbox | +| ------ | --- | --- | ---- | +| 1 | 2 | 3 | 4 | +## 游戏基因 {#you-xi-ji-yin} + +### 资讯 {#you-xi-ji-yin-zi-xun} + + + ## 游戏年轮 {#you-xi-nian-lun} ### 分类 {#you-xi-nian-lun-fen-lei} @@ -1124,9 +1130,9 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` -| 新着 | PS5 | Switch | PS4 | ニュース | ゲームニュース | PR TIMES | 動画 | 特集・企画記事 | インタビュー | 取材・リポート | レビュー | インディーゲーム | -| ----------- | --- | ------ | --- | ---- | --------- | -------- | ------ | --------------- | --------- | ------------ | ------ | ---------- | -| new-article | ps5 | switch | ps4 | news | news-game | prtimes | videos | special-article | interview | event-report | review | indie-game | +| 新着 | PS5 | Switch | PS4 | ニュース | ゲームニュース | PR TIMES | 動画 | 特集・企画記事 | インタビュー | 取材・リポート | レビュー | インディーゲーム | +| ----------- | --- | ------ | --- | -------- | -------------- | -------- | ------ | --------------- | ------------ | -------------- | -------- | ---------------- | +| new-article | ps5 | switch | ps4 | news | news-game | prtimes | videos | special-article | interview | event-report | review | indie-game | @@ -1139,4 +1145,3 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` ### 游戏横幅 {#%E3%83%9E%E3%82%AE%E3%82%A2%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89-magia-record-mo-fa-ji-lu-you-xi-heng-fu} -