Skip to content

Instantly share code, notes, and snippets.

@aschweer
Created October 1, 2013 01:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aschweer/6772579 to your computer and use it in GitHub Desktop.
Save aschweer/6772579 to your computer and use it in GitHub Desktop.
Scopus citation counts in DSpace xmlui
document.write('<script type="text/javascript" src="http://api.elsevier.com/javascript/scopussearch.jsp"> </' + 'script>');
callbackCitedbycount = function(){
if (sciverse.areSearchResultsValid()) {
var resultObj = sciverse.getSearchResults();
if (resultObj.returnedResults >0) {
citedbycount = resultObj.results[0].citedbycount;
eid = resultObj.results[0].eid;
if (citedbycount > 0) {
citeHtml = '<span class="bold">Scopus times cited</span>:</span> ';
if (eid != null) {
citeHtml += '<a href="http://www.scopus.com/scopus/search/submit/citedby.url?src=s&origin=recordpage&eid=';
citeHtml += eid;
citeHtml += '" class="citing-link" target="_new" title="View citing articles in Scopus">';
citeHtml += citedbycount;
citeHtml += '</a>';
}
articleLink = resultObj.results[0].inwardurl;
if (articleLink != null) {
citeHtml += ' <small>(<a href="';
citeHtml += articleLink;
citeHtml += '" class="article-link" target="_new" title="View record in Scopus" >';
citeHtml += 'View record in Scopus';
citeHtml += '</a>)</small>';
}
$("#citecounts-scopus").html(citeHtml);
$("#citecounts-scopus").removeClass('hidden');
$("#citecounts-scopus").show('blind');
$("#citecounts-scopus a.citing-link").click(function(){
if (_gaq != null) {
_gaq.push(['_trackEvent', 'Citecount links', 'Scopus citing items', 'http://hdl.handle.net/10289/6747']);
}
});
$("#citecounts-scopus a.article-link").click(function(){
if (_gaq) {
_gaq.push(['_trackEvent', 'Citecount links', 'Scopus article', 'http://hdl.handle.net/10289/6747']);
}
});
}
}
}
};
runSearch = function() {
//setting defaults
sciverse.setApiKey("[your-api-key-here]");
sciverse.setCallback(callbackCitedbycount);
//setting search query
var strQuery = "DOI(10.1002/rra.2609)";
var varSearchObj = new searchObj();
varSearchObj.setSearch(strQuery);
varSearchObj.setNumResults('1');
//launching search
try {
sciverse.runSearch(varSearchObj);
} catch(err) { }
};
runAfterJSImports.add(runSearch);
var strQuery = "DOI(</xsl:text><xsl:value-of select="dim:field[@element='identifier' and @qualifier='doi']"/><xsl:text disable-output-escaping="yes">)";
@eulereadgbe
Copy link

Hi Andrea, I would like to ask if you have the updated code for this to work in the new Mirage2 theme? Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment