feat(routers/t66y): add author (#1155)

This commit is contained in:
cnzgray
2018-11-16 00:43:44 +08:00
committed by DIYgod
parent 02238f9fb1
commit e693b9019b
2 changed files with 6 additions and 5 deletions
+3
View File
@@ -55,6 +55,7 @@ module.exports = async (ctx) => {
time = regRes === null ? new Date() : new Date(regRes[0]);
time.setTime(time.getTime() + (sourceTimezoneOffset - time.getTimezoneOffset() / 60) * 60 * 60 * 1000);
const author = $('#main > div:nth-child(4) > table > tbody > tr.tr1.do_not_catch > th.r_two > b').text();
const content = $('#main > div:nth-child(4) > table > tbody > tr.tr1.do_not_catch > th:nth-child(2) > table > tbody > tr > td > div.tpc_content.do_not_catch').html();
// Change the image tag to display image in rss reader
@@ -94,6 +95,7 @@ module.exports = async (ctx) => {
}
return {
author: author,
description: $('body').html(),
pubDate: time.toUTCString(),
};
@@ -152,6 +154,7 @@ module.exports = async (ctx) => {
return Promise.resolve('');
}
single.author = result.author;
single.description = result.description;
single.pubDate = result.pubDate;
} catch (err) {
+3 -5
View File
@@ -39,6 +39,7 @@ function parseContent(htmlString) {
time = regRes === null ? new Date() : new Date(regRes[0]);
time.setTime(time.getTime() + (sourceTimezoneOffset - time.getTimezoneOffset() / 60) * 60 * 60 * 1000);
const author = $('th.r_two > b').text();
const content = $('.tpc_content').html();
// Change the image tag to display image in rss reader
@@ -78,6 +79,7 @@ function parseContent(htmlString) {
}
return {
author: author,
description: $('body').html(),
pubDate: time.toUTCString(),
};
@@ -154,11 +156,7 @@ module.exports = async (ctx) => {
// 如果没有读到内容,则读取下一页。
return load(page + 1);
} else {
return {
title: title,
link: url.resolve(base, `/read.php?tid=${tid}`),
item: items,
};
return { title: title, link: url.resolve(base, `/read.php?tid=${tid}`), item: items };
}
};