Dear All, I have successfully implemented the scopus citation counts using the url http://api.elsevier.com/content/search/scopus?query=DOI({doi})&field=citedby-count&httpAccept=application/json&apiKey=API_KEY as QUERY_URL. Just replace the entry ["citation-count-response"]["document"]["citation-count"] with ["search-results"]["entry"][0]["citedby-count"] and ["citation-count-response"]["document"]["link"] with ["search-results"]["entry"][0]["link"]. I modified Àlex's gist to use the QUERY_URL I mentioned above which can be found here: https://gist.github.com/eulereadgbe/a8c59923df640914e94b5b8dec195b2d. Hope this will be of help to someone. Many thanks to Àlex's, helix84 and Karthick for the help.
Best regards, euler On Thursday, July 27, 2017 at 11:18:49 AM UTC+8, euler wrote: > > Hi Karthick, > > Thank you for sharing your code modifications. By the way, did you also > change > https://gist.github.com/rivaldi8/7a9f2483d5648e570d4c#file-impactservlet-py-L219-L229 > in > ImpactServlet.py? I ask because the returned json based on your modified > QUERY_URL does not > contain ["citation-count-response"]["document"]["citation-count"]. Even if > I changed that to ["search-results"]["entry"]["0"]["citedby-count"], I am > not able to get the citation counts from Scopus. The error is "citationCount > = serviceResponseObject["search-results"] \ TypeError: list indices must > be integers" > > Thanks in advance and regards, > euler > > On Wednesday, July 26, 2017 at 3:16:24 PM UTC+8, Karthick Babu wrote: >> >> Hi Euler, >> >> I have done small modification on helix ImpactServlet.py and Impact.js >> script, i am able to get the Scopus citation from scopus database. >> >> Please change the following lines to effect the script. >> >> In ImpactServlet.py >> >> *class Scopus(ImpactService):* >> * QUERY_URL = >> "https://api.elsevier.com/content/search/scopus?query=doi( >> <https://api.elsevier.com/content/search/scopus?query=doi(>" + '{1}' + >> ")&apiKey={0}&httpAccept=application/json"* >> >> In Impact.js >> >> *.done(function(data) {* >> * if (data["search-results"]["entry"]["0"]["@_fa"] === >> "not_true")* >> * return;* >> >> * var citations = >> data["search-results"]["entry"]["0"]["citedby-count"];* >> * var linkBack = getScopusLinkBack(data);* >> >> * if (citations > 0) {* >> * $("#scopus a").attr("href", linkBack);* >> * $("#scopus .citedby-count").html(citations);* >> * $("#scopus").removeClass("hidden");* >> * }* >> * })* >> * .fail(function(jqxhr, textStatus, error) {* >> * console.log("Error retrieving Scopus citation count: " + >> error);* >> * });* >> *}* >> >> *function getScopusLinkBack(data) {* >> * var linkList = data["search-results"]["entry"]["0"]["link"];* >> * var linkBackObject = $.grep(linkList, function(linkObject) {* >> * return linkObject["@ref"] === "scopus-citedby";* >> * })[0];* >> >> * return linkBackObject["@href"];* >> *}* >> >> and finally in item-view.xsl >> >> *<span class="citedby-count"></span> * >> >> Regards, >> >> *Karthick Babu* >> >> On Friday, 21 July 2017 15:20:16 UTC+5:30, euler wrote: >>> >>> Hello Àlex, >>> >>> I figured out the reason why I'm having the "KeyError: >>> 'citation-count-response'" error message. Using my api key in the >>> QUERY_URL ie >>> http://api.elsevier.com/content/abstract/citation-count?httpAccept=application/json&apiKey={0}&doi={1} >>> >>> returned >>> {"service-error":{"status":{"statusCode":"AUTHENTICATION_ERROR","statusText":"Requestor >>> >>> configuration settings insufficient for access to this resource."}}} >>> even though the registered api key that I used is associated with the >>> website url of my repository. When I replaced it with the api key that they >>> used here: https://dev.elsevier.com/interactive.html, it worked. >>> However, with regards to the url query to dev.elsevier.com, if I use >>> the request url found here: >>> https://dev.elsevier.com/tecdoc_cited_by_in_scopus.html ie >>> http://api.elsevier.com/content/search/scopus?query=DOI({doi})&field=citedby-count&httpAccept=application/json&apiKey=API_KEY, >>> >>> using my own api key, I did not encounter the service-error I mentioned >>> above. I wonder if anyone used the 2nd url query I mentioned to show the >>> citation count from Scopus? >>> >>> Thanks again regards, >>> euler >>> >>> On Monday, August 29, 2016 at 5:51:20 PM UTC+8, Àlex Magaz Graça wrote: >>>> >>>> El 26/07/16 a las 16:45, euler escribió: >>>> > Hi Àlex and helix84, >>>> > >>>> > I tried to implement the Scopus citations from your gist, but I am >>>> > having this error in my Tomcat logs: >>>> > >>>> > Traceback (most recent call last): >>>> > File "C:\DSpace\webapps\jython\ImpactServlet.py", line 36, in doGet >>>> > self.doPost(request, response) >>>> > File "C:\DSpace\webapps\jython\ImpactServlet.py", line 47, in >>>> doPost >>>> > response.getWriter().println(impactService.query()) >>>> > File "C:\DSpace\webapps\jython\ImpactServlet.py", line 155, in >>>> query >>>> > responseData = self._impactService.query() >>>> > File "C:\DSpace\webapps\jython\ImpactServlet.py", line 93, in query >>>> > return self._buildResponseToClient(serviceResponse) >>>> > File "C:\DSpace\webapps\jython\ImpactServlet.py", line 221, in >>>> _buildResponseToClient >>>> > citationCount = serviceResponseObject["citation-count-response"]\ >>>> > KeyError: 'citation-count-response' >>>> > >>>> > org.python.core.Py.KeyError(Py.java:249) >>>> > org.python.core.PyObject.__getitem__(PyObject.java:738) >>>> > >>>> org.python.pycode._pyx2._buildResponseToClient$22(C:\DSpace\webapps\jython\ImpactServlet.py:224) >>>> >>>> >>>> > >>>> org.python.pycode._pyx2.call_function(C:\DSpace\webapps\jython\ImpactServlet.py) >>>> >>>> >>>> > org.python.core.PyTableCode.call(PyTableCode.java:167) >>>> > org.python.core.PyBaseCode.call(PyBaseCode.java:153) >>>> > org.python.core.PyFunction.__call__(PyFunction.java:423) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:141) >>>> > >>>> org.python.pycode._pyx2.query$8(C:\DSpace\webapps\jython\ImpactServlet.py:93) >>>> >>>> >>>> > >>>> org.python.pycode._pyx2.call_function(C:\DSpace\webapps\jython\ImpactServlet.py) >>>> >>>> >>>> > org.python.core.PyTableCode.call(PyTableCode.java:167) >>>> > org.python.core.PyBaseCode.call(PyBaseCode.java:138) >>>> > org.python.core.PyFunction.__call__(PyFunction.java:413) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:126) >>>> > >>>> org.python.pycode._pyx2.query$14(C:\DSpace\webapps\jython\ImpactServlet.py:164) >>>> >>>> >>>> > >>>> org.python.pycode._pyx2.call_function(C:\DSpace\webapps\jython\ImpactServlet.py) >>>> >>>> >>>> > org.python.core.PyTableCode.call(PyTableCode.java:167) >>>> > org.python.core.PyBaseCode.call(PyBaseCode.java:138) >>>> > org.python.core.PyFunction.__call__(PyFunction.java:413) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:126) >>>> > >>>> org.python.pycode._pyx2.doPost$4(C:\DSpace\webapps\jython\ImpactServlet.py:47) >>>> >>>> >>>> > >>>> org.python.pycode._pyx2.call_function(C:\DSpace\webapps\jython\ImpactServlet.py) >>>> >>>> >>>> > org.python.core.PyTableCode.call(PyTableCode.java:167) >>>> > org.python.core.PyBaseCode.call(PyBaseCode.java:170) >>>> > org.python.core.PyFunction.__call__(PyFunction.java:434) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:156) >>>> > >>>> org.python.pycode._pyx2.doGet$3(C:\DSpace\webapps\jython\ImpactServlet.py:36) >>>> >>>> >>>> > >>>> org.python.pycode._pyx2.call_function(C:\DSpace\webapps\jython\ImpactServlet.py) >>>> >>>> >>>> > org.python.core.PyTableCode.call(PyTableCode.java:167) >>>> > org.python.core.PyBaseCode.call(PyBaseCode.java:307) >>>> > org.python.core.PyBaseCode.call(PyBaseCode.java:198) >>>> > org.python.core.PyFunction.__call__(PyFunction.java:482) >>>> > >>>> org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:228) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:218) >>>> > org.python.core.PyMethod.__call__(PyMethod.java:213) >>>> > org.python.core.PyObject._jcallexc(PyObject.java:3626) >>>> > org.python.proxies.__main__$ImpactServlet$6.doGet(Unknown Source) >>>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:624) >>>> > org.python.proxies.__main__$ImpactServlet$6.service(Unknown >>>> Source) >>>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:731) >>>> > org.python.util.PyServlet.service(PyServlet.java:155) >>>> > >>>> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) >>>> > >>>> > >>>> > >>>> > Can you please comment on what could be the cause of this error and >>>> how >>>> > to resolve this? >>>> > >>>> > Thanks in advance and best regards, >>>> > euler >>>> > >>>> > On Friday, December 18, 2015 at 8:40:01 PM UTC+8, Àlex Magaz Graça >>>> wrote: >>>> > >>>> > El 06/11/15 a las 13:27, helix84 escribió: >>>> > > 1) Register for Thomson's AMR. >>>> > > >>>> > > 2) Follow steps 1-4 from here: >>>> > > >>>> https://wiki.duraspace.org/display/DSPACE/Jython+webapp+for+DSpace >>>> > < >>>> https://wiki.duraspace.org/display/DSPACE/Jython+webapp+for+DSpace> >>>> > > >>>> > > 3) Copy the attached file into the webapp. >>>> > > >>>> > > 4) Get the data like this: >>>> > > http://example.com/webapp/wok_servlet.py?ut=000361215400001 >>>> > <http://example.com/webapp/wok_servlet.py?ut=000361215400001> >>>> > > >>>> > > 5) Use either XSLT or JavaScript to parse the xml response and >>>> > display >>>> > > the data. I recommend the later (XMLHttpRequest). >>>> > > >>>> > > >>>> > > Regards, >>>> > > ~~helix84 >>>> > > >>>> > > Compulsory reading: DSpace Mailing List Etiquette >>>> > > >>>> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette >>>> > <https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette> >>>> >>>> > > >>>> > > -- >>>> > > You received this message because you are subscribed to the >>>> Google >>>> > > Groups "DSpace Technical Support" group. >>>> > > To unsubscribe from this group and stop receiving emails from >>>> it, >>>> > send >>>> > > an email to [email protected] <javascript:> >>>> > > <mailto:[email protected] >>>> <javascript:>>. >>>> > > To post to this group, send email to [email protected] >>>> > <javascript:> >>>> > > <mailto:[email protected] <javascript:>>. >>>> > > Visit this group at http://groups.google.com/group/dspace-tech >>>> > <http://groups.google.com/group/dspace-tech>. >>>> > > For more options, visit https://groups.google.com/d/optout >>>> > <https://groups.google.com/d/optout>. >>>> > Hi, >>>> > >>>> > I've made some adaptations to the script and added Scopus >>>> citations >>>> > too. In case someone finds it useful, I'm sharing it, along with >>>> the >>>> > UI code, in a gist: >>>> > >>>> > https://gist.github.com/rivaldi8/7a9f2483d5648e570d4c >>>> > <https://gist.github.com/rivaldi8/7a9f2483d5648e570d4c> >>>> > >>>> > Cheers, >>>> > Àlex >>>> > >>>> > -- >>>> > You received this message because you are subscribed to the Google >>>> > Groups "DSpace Technical Support" group. >>>> > To unsubscribe from this group and stop receiving emails from it, >>>> send >>>> > an email to [email protected] >>>> > <mailto:[email protected]>. >>>> > To post to this group, send email to [email protected] >>>> > <mailto:[email protected]>. >>>> > Visit this group at https://groups.google.com/group/dspace-tech. >>>> > For more options, visit https://groups.google.com/d/optout. >>>> Hi euler, >>>> >>>> Sorry for the late response, I've been on holidays. >>>> >>>> I also have these errors logged by Tomcat. If apart from these errors, >>>> you are getting proper citation counts in item pages, don't worry. It's >>>> just lack of error control. Ideally the code should check no error has >>>> been >>>> received from the server, whether the DOI has been found or not, etc. To >>>> keep it simple, I decided that if anything failed, the client JavaScript >>>> would just skip the rendering of the citation count. >>>> >>>> Apart from the errors logged, I haven't noticed any problem, so I >>>> didn't think it worth spending more time on it. Please, let me know If >>>> you've had any problem caused by it or think it might be problematic. >>>> >>>> Cheers, >>>> Àlex >>>> >>> -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
