From e7cab139fbd3f4bb50b8dc77fea96649ba6089ef Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 3 Sep 2019 02:30:36 +0800 Subject: [PATCH] feat: class for ps trophy --- lib/routes/ps/trophy.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/routes/ps/trophy.js b/lib/routes/ps/trophy.js index bfd80d197..4ecd937f1 100644 --- a/lib/routes/ps/trophy.js +++ b/lib/routes/ps/trophy.js @@ -90,6 +90,12 @@ module.exports = async (ctx) => { const items = list .map((i, item) => { item = $(item); + const classMap = { + Platinum: '白金', + Gold: '金', + Silver: '银', + Bronze: '铜', + }; return { title: item.find('.title').text() + @@ -111,7 +117,15 @@ module.exports = async (ctx) => { return this.nodeType === 3; }) .text() - .trim()}
珍贵度:${item.find('.hover-show .typo-top').text()}`, + .trim()}
等级:${ + classMap[ + item + .find('td') + .eq(5) + .find('img') + .attr('title') + ] + }
珍贵度:${item.find('.hover-show .typo-top').text()}`, link: 'https://psnprofiles.com' + item.find('.title').attr('href'), pubDate: new Date( +new Date(