diff --git a/lib/routes/apple/exchange_repair.js b/lib/routes/apple/exchange_repair.js index 2780c47e1..371e07d03 100644 --- a/lib/routes/apple/exchange_repair.js +++ b/lib/routes/apple/exchange_repair.js @@ -21,6 +21,10 @@ module.exports = async (ctx) => { .map((i, e) => $(e).attr('href')) .get(); + const titlelist = $('tr td a') + .map((i, e) => $(e).text()) + .get(); + const datelist = $('tr td p') .map((i, e) => $(e) @@ -39,14 +43,17 @@ module.exports = async (ctx) => { const response = await axios.get(itemUrl); const $ = cheerio.load(response.data); + const description = $('#welcome').html() + ? $('#welcome') + .html() + .replace(/src="\//g, `src="${url.resolve(host, '.')}`) + : null; const single = { - title: $('h1').text(), + title: titlelist[index], link: itemUrl, author: 'Apple Inc.', - description: $('#welcome') - .html() - .replace(/src="\//g, `src="${url.resolve(host, '.')}`), + description: description, pubDate: new Date(datelist[index].replace(/(\d+) 年 (\d+) 月 (\d+) 日/, '$1-$2-$3')).toISOString(), };