mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
feat: replace iTunes link (#2448)
* feat: replace iTunes link * fix: handle apps with empty update logs
This commit is contained in:
@@ -175,15 +175,15 @@ If no matching results were found, the server returns only a HTTP status code `2
|
||||
|
||||
#### App Update
|
||||
|
||||
<RouteEn author="cielpy" example="/appstore/update/us/id697846300" path="/appstore/update/:country/:id" :paramsDesc="['App Store Country, obtain from the app URL `https://itunes.apple.com/us/app/reeder-3/id697846300?mt=8`, in this case, `us`', 'App Store app id, obtain from the app URL `https://itunes.apple.com/us/app/reeder-3/id697846300?mt=8`, in this case, `id697846300`']" />
|
||||
<RouteEn author="cielpy" example="/appstore/update/us/id697846300" path="/appstore/update/:country/:id" :paramsDesc="['App Store Country, obtain from the app URL `https://apps.apple.com/us/app/reeder-3/id697846300?mt=8`, in this case, `us`', 'App Store app id, obtain from the app URL `https://apps.apple.com/us/app/reeder-3/id697846300?mt=8`, in this case, `id697846300`']" />
|
||||
|
||||
#### Price Drop
|
||||
|
||||
<RouteEn author="HenryQW" example="/appstore/price/us/mac/id1152443474" path="/appstore/price/:country/:type/:id" :paramsDesc="['App Store Country, obtain from the app URL https://itunes.apple.com/us/app/id1152443474, in this case, `us`', 'App type,either `iOS` or `mac`', 'App Store app id, obtain from the app URL https://itunes.apple.com/us/app/id1152443474, in this case, `id1152443474`']" />
|
||||
<RouteEn author="HenryQW" example="/appstore/price/us/mac/id1152443474" path="/appstore/price/:country/:type/:id" :paramsDesc="['App Store Country, obtain from the app URL https://apps.apple.com/us/app/id1152443474, in this case, `us`', 'App type,either `iOS` or `mac`', 'App Store app id, obtain from the app URL https://apps.apple.com/us/app/id1152443474, in this case, `id1152443474`']" />
|
||||
|
||||
#### In-App-Purchase Price Drop Alert
|
||||
|
||||
<RouteEn author="HenryQW" example="/appstore/iap/us/id953286746" path="/appstore/iap/:country/:id" :paramsDesc="['App Store Country, obtain from the app URL https://itunes.apple.com/us/app/id953286746, in this case, `us`', 'App Store app id, obtain from the app URL https://itunes.apple.com/us/app/id953286746, in this case, `id953286746`']" />
|
||||
<RouteEn author="HenryQW" example="/appstore/iap/us/id953286746" path="/appstore/iap/:country/:id" :paramsDesc="['App Store Country, obtain from the app URL https://apps.apple.com/us/app/id953286746, in this case, `us`', 'App Store app id, obtain from the app URL https://apps.apple.com/us/app/id953286746, in this case, `id953286746`']" />
|
||||
|
||||
### F-Droid
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ pageClass: routes
|
||||
|
||||
### 应用更新
|
||||
|
||||
<Route author="HenryQW" example="/appstore/update/cn/id444934666" path="/appstore/update/:country/:id" :paramsDesc="['App Store 国家, 如 QQ 的链接为 https://itunes.apple.com/cn/app/qq/id444934666?mt=8, 则 country 为 `cn`', 'App Store app id, 如 QQ 的链接为 https://itunes.apple.com/cn/app/qq/id444934666?mt=8, 则 id 为 `id444934666`']"/>
|
||||
<Route author="HenryQW" example="/appstore/update/cn/id444934666" path="/appstore/update/:country/:id" :paramsDesc="['App Store 国家, 如 QQ 的链接为 https://apps.apple.com/cn/app/qq/id444934666?mt=8, 则 country 为 `cn`', 'App Store app id, 如 QQ 的链接为 https://apps.apple.com/cn/app/qq/id444934666?mt=8, 则 id 为 `id444934666`']"/>
|
||||
|
||||
### 价格更新(限免)
|
||||
|
||||
<Route author="HenryQW" example="/appstore/price/cn/mac/id1152443474" path="/appstore/price/:country/:type/:id" :paramsDesc="['App Store 国家, 如 Squash 的链接为 https://itunes.apple.com/cn/app/id1152443474, 则 country 为 `cn`', 'App 类型, `iOS` 或 `mac`', 'App Store app id, 必选, 如 Squash 的链接为 https://itunes.apple.com/cn/app/id1152443474, 则 id 为 `id115244347`']"/>
|
||||
<Route author="HenryQW" example="/appstore/price/cn/mac/id1152443474" path="/appstore/price/:country/:type/:id" :paramsDesc="['App Store 国家, 如 Squash 的链接为 https://apps.apple.com/cn/app/id1152443474, 则 country 为 `cn`', 'App 类型, `iOS` 或 `mac`', 'App Store app id, 必选, 如 Squash 的链接为 https://apps.apple.com/cn/app/id1152443474, 则 id 为 `id115244347`']"/>
|
||||
|
||||
### 内购价格更新(限免)
|
||||
|
||||
<Route author="HenryQW" example="/appstore/iap/cn/id953286746" path="/appstore/iap/:country/:id" :paramsDesc="['App Store 国家, 必选, 如 Darkroom – Photo Editor 的链接为 https://itunes.apple.com/cn/app/id953286746, 则 country 为 `cn`', 'App Store app id, 必选, 如 Darkroom – Photo Editor 的链接为 https://itunes.apple.com/cn/app/id953286746, 则 id 为 `id953286746`']"/>
|
||||
<Route author="HenryQW" example="/appstore/iap/cn/id953286746" path="/appstore/iap/:country/:id" :paramsDesc="['App Store 国家, 必选, 如 Darkroom – Photo Editor 的链接为 https://apps.apple.com/cn/app/id953286746, 则 country 为 `cn`', 'App Store app id, 必选, 如 Darkroom – Photo Editor 的链接为 https://apps.apple.com/cn/app/id953286746, 则 id 为 `id953286746`']"/>
|
||||
|
||||
### 每日精品限免 / 促销应用(鲜面连线 by AppSo)
|
||||
|
||||
|
||||
@@ -468,11 +468,11 @@ router.get('/pigtails', require('./routes/pigtails'));
|
||||
router.get('/imuseum/:city/:type?', require('./routes/imuseum'));
|
||||
|
||||
// AppStore
|
||||
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'));
|
||||
router.get('/appstore/gofans', require('./routes/appstore/gofans'));
|
||||
router.get('/appstore/update/:country/:id', require('./routes/apple/appstore/update'));
|
||||
router.get('/appstore/price/:country/:type/:id', require('./routes/apple/appstore/price'));
|
||||
router.get('/appstore/iap/:country/:id', require('./routes/apple/appstore/in-app-purchase'));
|
||||
router.get('/appstore/xianmian', require('./routes/apple/appstore/xianmian'));
|
||||
router.get('/appstore/gofans', require('./routes/apple/appstore/gofans'));
|
||||
|
||||
// Hopper
|
||||
router.get('/hopper/:lowestOnly/:from/:to?', require('./routes/hopper/index'));
|
||||
|
||||
@@ -5,7 +5,7 @@ const cheerio = require('cheerio');
|
||||
module.exports = async (ctx) => {
|
||||
const country = ctx.params.country;
|
||||
const id = ctx.params.id;
|
||||
const link = `https://itunes.apple.com/${country}/app/${id}`;
|
||||
const link = `https://apps.apple.com/${country}/app/${id}`;
|
||||
const target = url.resolve(link, '?mt=8#see-all/in-app-purchases');
|
||||
|
||||
const res = await got.get(target);
|
||||
@@ -33,7 +33,7 @@ module.exports = async (ctx) => {
|
||||
|
||||
const title = `${country === 'cn' ? '限免提醒' : 'Price watcher'}: ${result.title} for ${type === 'macapps' ? 'macOS' : 'iOS'}`;
|
||||
|
||||
const link = `https://itunes.apple.com/${country}/app/id${id}`;
|
||||
const link = `https://apps.apple.com/${country}/app/id${id}`;
|
||||
|
||||
if (result.priceDropIndicator === -1) {
|
||||
const single = {
|
||||
@@ -4,7 +4,7 @@ const cheerio = require('cheerio');
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
const country = ctx.params.country;
|
||||
const url = `https://itunes.apple.com/${country}/app/${id}`;
|
||||
const url = `https://apps.apple.com/${country}/app/${id}`;
|
||||
|
||||
const res = await got.get(url);
|
||||
const $ = cheerio.load(res.data);
|
||||
@@ -15,20 +15,24 @@ module.exports = async (ctx) => {
|
||||
|
||||
const title = `${titleTags.text().trim()} for ${platform === 'App Store' ? 'iOS' : 'macOS'} ${country === 'cn' ? '更新' : 'Update'}`;
|
||||
|
||||
const item = {};
|
||||
const items = [];
|
||||
if ($('.whats-new').length > 0) {
|
||||
$('.whats-new').each(function() {
|
||||
const version = $('.whats-new__latest__version')
|
||||
.text()
|
||||
.split(' ')[1];
|
||||
const item = {};
|
||||
item.title = `${titleTags.text().trim()} ${version}`;
|
||||
item.description = $('.whats-new__content .we-truncate').html();
|
||||
item.link = url;
|
||||
item.guid = id + version;
|
||||
items.push(item);
|
||||
});
|
||||
}
|
||||
|
||||
ctx.state.data = {
|
||||
title,
|
||||
link: url,
|
||||
item: [item],
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user