fix(route): github trending css selector changed (#7279)

This commit is contained in:
Queensferry
2021-05-25 09:16:53 -04:00
committed by GitHub
parent 39db632846
commit ec35396bf1
+3 -3
View File
@@ -25,15 +25,15 @@ module.exports = async (ctx) => {
item:
list &&
list
.map((index, item) => {
.map((_, item) => {
item = $(item);
return {
title: item.find('h1').text(),
author: item.find('h1').text().split('/')[0].trim(),
description: `${item.find('.pr-4').text()}<br>
<br>Language: ${item.find('span[itemprop="programmingLanguage"]').text() || 'unknown'}
<br>Star: ${item.find('.muted-link').eq(0).text()}
<br>Fork: ${item.find('.muted-link').eq(1).text()}`,
<br>Star: ${item.find('.Link--muted').eq(0).text().trim()}
<br>Fork: ${item.find('.Link--muted').eq(1).text().trim()}`,
link: `https://github.com${item.find('h1 a').attr('href')}`,
};
})