parent
e7f3e25e32
commit
d1a3fc7c26
|
|
@ -35,22 +35,20 @@ module.exports = async (ctx) => {
|
|||
let title;
|
||||
let item = [];
|
||||
|
||||
const iap = apiResponse.relationships['merchandised-in-apps'].data;
|
||||
const iap = apiResponse.relationships['top-in-apps'].data;
|
||||
if (iap) {
|
||||
title = `${country === 'cn' ? '内购限免提醒' : 'IAP price watcher'}: ${titleTemp} for ${platform}`;
|
||||
|
||||
item = iap
|
||||
.filter((e) => e.attributes.isMerchandisedEnabled)
|
||||
.map((e) => {
|
||||
const title = `${e.attributes.name} is now ${e.attributes.offers[0].priceFormatted}`;
|
||||
return {
|
||||
link,
|
||||
guid: e.attributes.url,
|
||||
description: e.attributes.description.standard,
|
||||
title,
|
||||
pubDate: new Date().toUTCString(),
|
||||
};
|
||||
});
|
||||
item = iap.map((e) => {
|
||||
const title = `${e.attributes.name} is now ${e.attributes.offers[0].priceFormatted}`;
|
||||
return {
|
||||
link,
|
||||
guid: e.attributes.url,
|
||||
description: e.attributes.description.standard + `<br><img src=${e.attributes.artwork.url.replace('{w}x{h}{c}.{f}', '320x0w.jpg')}>`,
|
||||
title,
|
||||
pubDate: new Date().toUTCString(),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
ctx.state.data = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue