refactor: optimize code
This commit is contained in:
parent
d4846e52e5
commit
4d3e12a13c
|
|
@ -39,9 +39,6 @@ module.exports = async (ctx) => {
|
|||
try {
|
||||
const response = await got.get(link);
|
||||
const result = utils.parseContent(response.data);
|
||||
if (!result) {
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
rssitem.author = result.author;
|
||||
rssitem.description = result.description;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module.exports = async (ctx) => {
|
|||
item = $(item);
|
||||
return {
|
||||
title: item.find('a').text(),
|
||||
description: item.find('p').text() + ' [...]' || '重科教务处',
|
||||
description: item.find('p').text() + ' [...]',
|
||||
pubDate: new Date(
|
||||
item
|
||||
.find('.shijian')
|
||||
|
|
|
|||
Loading…
Reference in New Issue