fix Apple Exchange and Repair Extension Programs returns 404 (#1996)
* update bug report template * fix Apple Exchange and Repair Extension Programs returns 404
This commit is contained in:
@@ -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(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user