fix: appstore-update (#3128)

This commit is contained in:
凉凉
2019-09-23 17:21:54 +08:00
committed by DIYgod
parent 345ae71fda
commit ad128dac29
+1 -5
View File
@@ -9,11 +9,6 @@ module.exports = async (ctx) => {
const res = await got.get(url);
const $ = cheerio.load(res.data);
const data = $('script#shoebox-ember-data-store').html();
const jsonObject = JSON.parse(data);
const versions = jsonObject.data.attributes.versionHistory;
const date = versions[0].releaseDate;
const titleTags = $('h1').attr('class', 'product-header__title');
titleTags.find('span').remove();
const platform = $('.we-localnav__title__product').text();
@@ -26,6 +21,7 @@ module.exports = async (ctx) => {
const version = $('.whats-new__latest__version')
.text()
.split(' ')[1];
const date = $('.whats-new__content time').attr('aria-label');
const item = {};
item.title = `${titleTags.text().trim()} ${version}`;
item.description = $('.whats-new__content .we-truncate').html();