You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all: Thank you so much for providing this plugin and keeping it up-to-date!
I have edited this plugin to include a time-relative score ("relevance") in addition to the Google Scholar citation count. The idea is to allow sorting not by absolute citations, but by relevance. I thought this might help other people, though I'm unsure if it's a good idea to include this in the plugin in general. Perhaps you can consider it or some similar alternative.
I based the score on the number of citations since publication (citations / weeksSincePublication) and rounded to two decimals.
The new format in the 'Extra'-column is: GSCC: 2.22 (000020), where 2.22 is the calculated score and 000020 is the absolute citation count.
Code Changes
The changes are made in \chrome\content\gscc.js
buildCiteCountString
/**
* Create the citation string for use on the item record
* @param {number} citeCount
* @param {ZoteroGenericItem} item
* @returns string
*/
buildCiteCountString: function (citeCount, item) {
let data;
if (citeCount < 0) {
data = this.__noData;
} else {
const formattedCiteCount = $__gscc.util.padCountWithZeros(
citeCount.toString(),
this.__citeCountStrLength
);
// Calculate relative importance score
const publicationDate = item.getField('date');
const weeksSincePublication = Math.ceil((new Date() - new Date(publicationDate)) / (1000 * 60 * 60 * 24 * 7));
const citationRatio = citeCount / weeksSincePublication;
let formattedRatio = citationRatio.toFixed(2);
if (isNaN(formattedRatio)) {
formattedRatio = '0.00';
}
data = `${formattedRatio} (${formattedCiteCount})`;
}
return `${this.__extraEntryPrefix}: ${data}`;
},
updateItem:
updateItem: function (item, citeCount) {
const fieldExtra = item.getField('extra');
const buildNewCiteCount = this.buildCiteCountString(citeCount, item);
let revisedExtraField;
const regex = new RegExp(`${this.__extraEntryPrefix}: \\d+\\.\\d{2} \\(\\d{7}\\)`, 'g');
if (regex.test(fieldExtra)) {
revisedExtraField = fieldExtra.replace(
regex,
buildNewCiteCount
);
[...]
The text was updated successfully, but these errors were encountered:
First of all: Thank you so much for providing this plugin and keeping it up-to-date!
I have edited this plugin to include a time-relative score ("relevance") in addition to the Google Scholar citation count. The idea is to allow sorting not by absolute citations, but by relevance. I thought this might help other people, though I'm unsure if it's a good idea to include this in the plugin in general. Perhaps you can consider it or some similar alternative.
I based the score on the number of citations since publication (citations / weeksSincePublication) and rounded to two decimals.
The new format in the 'Extra'-column is:
GSCC: 2.22 (000020)
, where2.22
is the calculated score and000020
is the absolute citation count.Code Changes
The changes are made in
\chrome\content\gscc.js
The text was updated successfully, but these errors were encountered: