Skip to content

Commit

Permalink
Merge pull request #94 from chenyangyc/master
Browse files Browse the repository at this point in the history
Fix bugs when parsing the author name in google scholar
  • Loading branch information
WenyanLiu authored Nov 24, 2024
2 parents b2c2f29 + 3dbc488 commit 647ac6e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions js/scholar.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ scholar.observeCitations = function () {
};

scholar.appendRanks = function () {
let elements = $("tr.gsc_a_tr");
elements.each(function (index) {
let node = $(this).find("td.gsc_a_t > a").first();
if (!node.next().hasClass("ccf-rank") && !$(this).hasClass("ccf-ranked")) {
let title = node.text();
let author = $(this)
.find("div.gs_gray")
.text()
.replace(/[\,\…]/g, "")
.split(" ")[1];
let year = $(this).find("td.gsc_a_y").text();
$(this).addClass("ccf-ranked");
setTimeout(function () {
fetchRank(node, title, author, year, scholar);
}, 100 * index);
}
});
let elements = $("tr.gsc_a_tr");
elements.each(function( index ) {
let node = $(this).find("td.gsc_a_t > a").first();
if (!node.next().hasClass("ccf-rank") && !$(this).hasClass("ccf-ranked")) {
let title = node.text();
let author = $(this)
.find("div.gs_gray")[0]
.innerText
.replace(/[\,\…]/g, "")
.split(" ")[1];
let year = $(this).find("td.gsc_a_y").text();
$(this).addClass("ccf-ranked");
setTimeout(function() {
fetchRank(node, title, author, year, scholar);
}, 100 * index );
}
});
};

0 comments on commit 647ac6e

Please sign in to comment.