Skip to content

Instantly share code, notes, and snippets.

@eulereadgbe
Last active July 27, 2016 07:16
Show Gist options
  • Select an option

  • Save eulereadgbe/1dc8b601a5da9d127f0a46653328f1f0 to your computer and use it in GitHub Desktop.

Select an option

Save eulereadgbe/1dc8b601a5da9d127f0a46653328f1f0 to your computer and use it in GitHub Desktop.
Scopus citation counts in DSpace xmlui modified from https://gist.github.com/aschweer/6772579
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
callbackCitedbycount = function(){
if (sciverse.areSearchResultsValid()) {
var resultObj = sciverse.getSearchResults();
if (resultObj.returnedResults > 0) {
citedbycount = resultObj.results[0].citedbycount;
scp = resultObj.results[0].scp;
if (citedbycount > 0) {
citeHtml = '<small>Cited ';
if (scp != null) {
citeHtml += '<a href="http://www.scopus.com/inward/citedby.uri?';
citeHtml += 'scp=';
citeHtml += scp;
citeHtml += '&amp;origin=inward';
citeHtml += '&amp;partnerID=HzOxMe3b';
citeHtml += '" class="citing-link" target="_new" title="View citing articles in Scopus">';
citeHtml += '</small><span class="bold">'
citeHtml += citedbycount;
citeHtml += '</span></a><small>&#160;times in </small>';
}
//articleLink = resultObj.results[0].inwardurl;
if (scp != null) {
citeHtml += '<small><a href="http://www.scopus.com/inward/record.uri?';
citeHtml += 'scp=';
citeHtml += scp;
citeHtml += '&amp;origin=inward';
citeHtml += '&amp;partnerID=HzOxMe3b';
citeHtml += '" class="article-link" target="_new" title="View record in Scopus" >';
citeHtml += 'Scopus';
citeHtml += '</a></small>';
}
var citecountsScopus = $("#citecounts-scopus");
citecountsScopus.html(citeHtml);
citecountsScopus.removeClass('hidden');
citecountsScopus.show('blind');
}
}
}
};
runSearch = function() {
//setting defaults
sciverse.setApiKey("YOUR-API-KEY");
sciverse.setCallback(callbackCitedbycount);
//setting search query
var DOI = $("meta[name='citation_doi']").attr('content');
var strQuery = "DOI(" + DOI + ")";
var varSearchObj = new searchObj();
varSearchObj.setSearch(strQuery);
varSearchObj.setNumResults('1');
//launching search
try {
sciverse.runSearch(varSearchObj);
} catch(err) { }
};
$(document).ready(runSearch);
<xsl:template name="impact-scopus">
<script type="text/javascript">
document.write('&lt;script type="text/javascript" src="http://api.elsevier.com/javascript/scopussearch.jsp"&gt; &lt;/' + 'script&gt;');
</script>
<script src="{$theme-path}scripts/scopus-citecounts.js" defer="defer">&#160;</script>
<div id="citecounts-scopus" class="simple-item-view-other citecounts hidden">&#160;</div>
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment