From 87980a9e5b0ffb4b6f34168bbbfef21b98e30e77 Mon Sep 17 00:00:00 2001
From: MisteryMonster <40703811+MisteryMonster@users.noreply.github.com>
Date: Sun, 27 Jun 2021 08:08:56 +0800
Subject: [PATCH] chore(route): Remove steam news (#7764)
---
assets/radar-rules.js | 6 ------
docs/en/game.md | 10 +++------
docs/game.md | 14 +++++++------
lib/router.js | 1 -
lib/routes/steam/news.js | 45 ----------------------------------------
5 files changed, 11 insertions(+), 65 deletions(-)
delete mode 100644 lib/routes/steam/news.js
diff --git a/assets/radar-rules.js b/assets/radar-rules.js
index e48d2f00d1..5a6d0d3a72 100644
--- a/assets/radar-rules.js
+++ b/assets/radar-rules.js
@@ -1144,12 +1144,6 @@
source: '/search/',
target: (params, url) => `/steam/search/${new URL(url).searchParams}`,
},
- {
- title: 'news',
- docs: 'https://docs.rsshub.app/game.html#steam',
- source: '/news/',
- target: (params, url) => `/steam/news/${new URL(url).searchParams.get('appids')}`,
- },
],
},
'baijingapp.com': {
diff --git a/docs/en/game.md b/docs/en/game.md
index e60cbd6d56..f2fd36bbe6 100755
--- a/docs/en/game.md
+++ b/docs/en/game.md
@@ -172,17 +172,13 @@ For instance, in `https://store.steampowered.com/search/?specials=1&term=atelier
### Steam news
-
-
-
::: tip
Steam provides some official RSS feeds:
-- Game News: https://store.steampowered.com/feeds/news/app/412830/
-- Curator/Group/Publisher/Developer News: https://store.steampowered.com/feeds/news/group/35143931/
-
-Game News use the AppID while the rest are only available in the Steam News UI, it seems.
+- News home page: [https://store.steampowered.com/feeds/news/?l=english](https://store.steampowered.com/feeds/news/?l=english) the parameter `l=english` specifiy the language.
+- Game news rss can get from the rss buttom in page like this: [https://store.steampowered.com/news/app/648800/](https://store.steampowered.com/news/app/648800/) , rss link will looks like: [https://store.steampowered.com/feeds/news/app/648800/?cc=US&l=english](https://store.steampowered.com/feeds/news/app/648800/?cc=US&l=english)
+- Steam group can add `/rss` behind Steam community URL to subscribe: [https://steamcommunity.com/groups/SteamLabs/rss](https://steamcommunity.com/groups/SteamLabs/rss) or add the `/feeds` in Steam News : [https://store.steampowered.com/feeds/news/group/35143931/](https://store.steampowered.com/feeds/news/group/35143931/)
:::
diff --git a/docs/game.md b/docs/game.md
index a56555e6cc..c10b428cec 100644
--- a/docs/game.md
+++ b/docs/game.md
@@ -342,15 +342,17 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
-### Steam news
+### Steam 新闻中心
-
+::: tip
-| 语言 (Language) | 简体中文 (Simplified Chinese) | 繁體中文 (Traditional Chinese) | 日本語 (Japanese) | 한국어 (Korean) | Български (Bulgarian) | Čeština (Czech) | Dansk (Danish) | Deutsch (German) | Español - España (Spanish - Spain) | Español - Latinoamérica (Spanish - Latin America), | Ελληνικά (Greek) | Français (French) | Italiano (Italian) | Magyar (Hungarian) | Nederlands (Dutch) | Norsk (Norwegian) | Polski (Polish) | Português (Portuguese) | Português - Brasil (Portuguese - Brazil) | Română (Romanian) | Русский (Russian) | Suomi (Finnish) | Svenska (Swedish) | Türkçe (Turkish) | Tiếng Việt (Vietnamese) | Українська (Ukrainian) |
-| --------------- | ----------------------------- | ------------------------------ | ----------------- | --------------- | --------------------- | --------------- | -------------- | ---------------- | ---------------------------------- | -------------------------------------------------- | ---------------- | ----------------- | ------------------ | ------------------ | ------------------ | ----------------- | --------------- | ---------------------- | ---------------------------------------- | ----------------- | ----------------- | --------------- | ----------------- | ---------------- | ----------------------- | ---------------------- |
-| | schinese | tchinese | japanese | koreana | bulgarian | czech | danish | german | spanish | latam | greek | french | italian | hungarian | dutch | norwegian | polish | portuguese | brazilian | romanian | russian | finnish | swedish | turkish | vietnamese | ukrainian |
+Steam 新闻中心支持官方的 RSS 订阅:
-
+- 新闻中心首页订阅地址为:[https://store.steampowered.com/feeds/news/?l=schinese](https://store.steampowered.com/feeds/news/?l=schinese) 其中参数 `l=english` 指定语言,`l=schinese` 为简体中文。
+- Steam 游戏新闻可以在该游戏的 RSS 按钮订阅: [https://store.steampowered.com/news/app/648800/](https://store.steampowered.com/news/app/648800/) ,获取的订阅链接类似为: [https://store.steampowered.com/feeds/news/app/648800/?cc=US&l=english](https://store.steampowered.com/feeds/news/app/648800/?cc=US&l=english)
+- STEAM 组可以在 Steam 社区链接尾部添加 `/rss` 订阅: [https://steamcommunity.com/groups/SteamLabs/rss](https://steamcommunity.com/groups/SteamLabs/rss) 或者在 Steam 新闻中心的 URL 里添加 `/feeds` 订阅 [https://store.steampowered.com/feeds/news/group/35143931/](https://store.steampowered.com/feeds/news/group/35143931/)
+
+:::
## SteamGifts
diff --git a/lib/router.js b/lib/router.js
index 625cd8cc50..81c757eacc 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -1242,7 +1242,6 @@ router.get('/huxiu/collection/:id', require('./routes/huxiu/collection'));
// Steam
router.get('/steam/search/:params', require('./routes/steam/search'));
-router.get('/steam/news/:appid/:language?', require('./routes/steam/news'));
// Steamgifts
router.get('/steamgifts/discussions/:category?', require('./routes/steam/steamgifts/discussions'));
diff --git a/lib/routes/steam/news.js b/lib/routes/steam/news.js
deleted file mode 100644
index 9c33b88f9d..0000000000
--- a/lib/routes/steam/news.js
+++ /dev/null
@@ -1,45 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-
-module.exports = async (ctx) => {
- const { appid, language = 'schinese' } = ctx.params;
- const response = await got.get(`https://store.steampowered.com/news/app/${appid}`, {
- headers: {
- cookie: `Steam_Language=${language}`,
- },
- });
- const $ = cheerio.load(response.data);
- const { events } = JSON.parse($('#application_config').attr('data-initialevents'));
-
- const item = events.map((event) => {
- event.announcement_body.body = event.announcement_body.body
- .replace(/\[img]\{STEAM_CLAN_IMAGE}/g, '
')
- .replace(/\[h1]/g, '
')
- .replace(/\[\/h1]/g, '
')
- .replace(/\[h2]/g, '')
- .replace(/\[\/h2]/g, '
')
- .replace(/\[b]/g, '')
- .replace(/\[\/b]/g, '')
- .replace(/\[i]/g, '')
- .replace(/\[\/i]/g, '')
- .replace(/\[url=\s?(http.*?)]/g, '')
- .replace(/\[\/url]/g, '')
- .replace(/\[list]/g, '')
- .replace(/\[\/list]/g, '
')
- .replace(/\[\*]/g, '');
-
- return {
- title: event.event_name,
- link: `https://store.steampowered.com/news/app/${appid}/view/${event.gid}`,
- pubDate: new Date(event.announcement_body.posttime * 1000),
- description: event.announcement_body.body,
- };
- });
-
- ctx.state.data = {
- title: $('head title').text(),
- link: `https://store.steampowered.com/news/app/${appid}`,
- item,
- };
-};