diff --git a/docs/game.md b/docs/game.md index b2c477824..70a84c48d 100755 --- a/docs/game.md +++ b/docs/game.md @@ -214,16 +214,6 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 -## SteamDB - -### 免费游戏 - - - -| 全部 | 周末 | 永久 | -| ---- | ------- | ---- | -| 留空 | weekend | keep | - ## SteamGifts ### Discussions diff --git a/lib/router.js b/lib/router.js index 3395dd8d6..42228f7d3 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1120,9 +1120,6 @@ router.get('/steam/news/:appids', require('./routes/steam/news')); // Steamgifts router.get('/steamgifts/discussions/:category?', require('./routes/steam/steamgifts/discussions')); -// SteamDB -router.get('/steamdb/free/:type?', require('./routes/steam/steamdb/free')); - // 扇贝 router.get('/shanbay/checkin/:id', require('./routes/shanbay/checkin')); router.get('/shanbay/footprints/:category?', require('./routes/shanbay/footprints')); diff --git a/lib/routes/steam/steamdb/free.js b/lib/routes/steam/steamdb/free.js deleted file mode 100644 index 445f2d587..000000000 --- a/lib/routes/steam/steamdb/free.js +++ /dev/null @@ -1,65 +0,0 @@ -const got = require('hooman'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const { type } = ctx.params; - const url = 'https://steamdb.info/upcoming/free'; - const html = (await got.get(url)).body; - const $ = cheerio.load(html); - - const $trs = $('.container table.table-products:first-of-type tbody tr'); - const getItems = $trs - .toArray() - .reverse() - .map(async (el) => { - const $el = $(el); - const $tds = $el.children('td'); - - // link & logo - 0 - const linkEl = $($tds.get(0)).find('a').get(0); - const link = (linkEl && linkEl.attribs.href) || ''; - - // appid - const found = /app\/(\d+)/.exec(link); - const appid = found ? found[1] : ''; - - // title - 1 - const title = $($tds.get(1)).text().trim(); - - // promotion type - 3 - const promoType = $($tds.get(3)).text().trim(); - - // startDate - 4 - const startDate = $tds.get(4).attribs.title; - - // endDate - 5 - // const endDate = $tds.get(5).attribs.title; - - // ignore items without appid or not matched the type - if (!appid || (type && type.toLowerCase() !== promoType.toLocaleLowerCase())) { - return null; - } - - const hoverLink = `https://steamdb.info/api/RenderAppHover/?appid=${appid}`; - const description = await ctx.cache.tryGet(hoverLink, async () => { - const description = (await got.get(hoverLink)).body; - return description; - }); - - return { - title: `[${promoType}] ${title}`, - link, - pubDate: new Date(startDate).toUTCString(), - description, - }; - }); - - const item = await Promise.all(getItems); - - ctx.state.data = { - title: 'Steam 免费游戏 [SteamDB]', - link: url, - item: item.filter((itm) => !!itm), - allowEmpty: true, - }; -};