From d6f81ff635754a57bc55d7f3d2a146ff7c1cd5ea Mon Sep 17 00:00:00 2001 From: Andie Date: Mon, 17 Sep 2018 11:15:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E7=B2=BE=E5=93=81=E9=99=90?= =?UTF-8?q?=E5=85=8D=20/=20=E4=BF=83=E9=94=80=E5=BA=94=E7=94=A8=20(#717)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/DIYgod/RSSHub/issues/709 --- docs/README.md | 2 ++ router.js | 1 + routes/appstore/xianmian.js | 27 +++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 routes/appstore/xianmian.js diff --git a/docs/README.md b/docs/README.md index b36ba54e7..c39a2f6a2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -863,6 +863,8 @@ GitHub 官方也提供了一些 RSS: + + ### Greasy Fork diff --git a/router.js b/router.js index 64074602c..43153e039 100644 --- a/router.js +++ b/router.js @@ -429,6 +429,7 @@ router.get('/imuseum/:city/:type', require('./routes/imuseum')); router.get('/appstore/update/:country/:id', require('./routes/appstore/update')); router.get('/appstore/price/:country/:type/:id', require('./routes/appstore/price')); router.get('/appstore/iap/:country/:id', require('./routes/appstore/in-app-purchase')); +router.get('/appstore/xianmian', require('./routes/appstore/xianmian')); // Hopper router.get('/hopper/:lowestOnly/:from/:to?', require('./routes/hopper/index')); diff --git a/routes/appstore/xianmian.js b/routes/appstore/xianmian.js new file mode 100644 index 000000000..bd67da9c8 --- /dev/null +++ b/routes/appstore/xianmian.js @@ -0,0 +1,27 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const { + data: { objects: data }, + } = await axios.get('http://app.so/api/v5/appso/discount/?platform=web&limit=20'); + + ctx.state.data = { + title: '每日精品限免 / 促销应用', + link: 'http://app.so/xianmian/', + description: '鲜面连线 by AppSo:每日精品限免 / 促销应用', + item: data.map((item) => ({ + title: item.app.name, + description: ` + +
+ 原价:${item.discount_info[0].discounted_price} -> 现售:${item.discount_info[0].original_price} +
+ 平台:${item.app.download_link[0].device} +
+ ${item.content} + `, + pubDate: new Date(item.updated_at).toUTCString(), + link: item.app.download_link[0].link, + })), + }; +};