refactor: optimize code
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user