Skip to content

Commit

Permalink
fix: fit xuite.net
Browse files Browse the repository at this point in the history
  • Loading branch information
cokemine committed May 13, 2021
1 parent 2c15a17 commit 2da85d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/routes/tongli/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = async (ctx) => {
const _list = $('.news_list ul li')
.map(function () {
let link = $(this).find('.title a').attr('href');
/^https:\/\//.test(link) || (link = baseURL + link);
/^https?:\/\//.test(link) || (link = baseURL + link);
return {
title: $(this).find('.title a').text(),
link,
Expand All @@ -26,8 +26,12 @@ module.exports = async (ctx) => {
const $ = cheerio.load(res.data);
if (/^https:\/\/tonglinv\.pixnet\.net/.test(link)) {
return $('.article-content-inner').html();
} else {
} else if (/^https?:\/\/blog\.xuite\.net\//.test(link)) {
return $('#content_all').html();
} else if (/TNews_View\.aspx/.test(link)) {
return $('#ContentPlaceHolder1_TNewsContent').html();
} else {
return '';
}
});
return Promise.resolve({ title, link, description, pubDate });
Expand Down

0 comments on commit 2da85d0

Please sign in to comment.