EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #05727
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Thomson Reuters API/PHP
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Thomson Reuters API/PHP
- From: Andy Reid <Andy.REID@lshtm.ac.uk>
- Date: Mon, 23 May 2016 10:51:04 +0000
Hi Andrew, I got this working a few yesrs ago in Perl cgi, with a PHP wrapper to fetch the records 50 at a time from our DB, and write the results back to the DB. I won’t post it all here, but the core of it is below,
and I can send you the rest privately if you want, to spare myself the embarrassment of exposing my quick-and-dirty code to ridicule. This is the core of it, fetchLAMR function, that takes any of UT, PMID, or DOI, and returns the XML from the Web service. You’ll need to change the email address and app-id string in the src parameter of the
XML, obviously. Hope it helps Andy Andy Reid Research Information Manager Executive Office, Room G43 London School of Hygiene and Tropical Medicine Keppel St, LONDON, WC1E 7HT 0207-927-2618 (Internal x2618)
USAGE:
http://myserver.ac.uk/cgi-bin/testLAMR.pl?DOI=10.1234/123abc789xyz (and/or &PMID= and/or &UT =) ========================== testLAMR.pl ####################################################################################### # MAIN ####################################################################################### use CGI; use CGI::Carp qw(fatalsToBrowser); use LAMR; ########### LAMR.pm perl module below ############ my $query=new CGI; ########################### takes any or all of the following in the query string $UT = $query->param('UT'); $PMID= $query->param('PMID'); $DOI= $query->param('DOI'); ############$backref=$query->param('back'); ### used by wrapper to redirect back to calling page ######## OUTPUT ###################### print $query->header('text/xml'); #print $query->start_html("LAMR citation details"); $XML .= &fetch_LAMR($UT,$PMID,$DOI); { $XML =~ m{<val name=\"timesCited\">(\d*)<\/val>}; ### find the bit of the response that you want by crude Regexp print “$DOI :times cited= “. $timesCited=$1; } ### ################################################################################################################################## ========================== LAMR.pm ========================== package LAMR; require Exporter; our @ISA= qw(Exporter); our @EXPORT = qw(fetch_LAMR); our @EXPORT_OK=qw(); our $VERSION = 1.00; sub fetch_LAMR{ my ($UT,$PMID,$DOI) = @_; use LWP::UserAgent; use HTTP::Request::Common; my $ua = new LWP::UserAgent; ################################################################################################ ################## XML CONTENT #################################################################### ############################################################################################### $XMLrequest = qq#<?xml version="1.0" encoding="UTF-8" ?>
<request xmlns="http://www.isinet.com/xrpc41"
src="" >
<fn name="LinksAMR.retrieve"> <list> <!-- WHO'S REQUESTING --> <map> </map> <!-- WHAT'S REQUESTED --> <map> <list name="WOS"> <val>timesCited</val> <val>ut</val> <val>pmid</val> <val>doi</val> <val>sourceURL</val> <val>citingArticlesURL</val>
<val>relatedRecordsURL</val>
</list> </map> <!--end "return_data" -->
<!-- LOOKUP DATA --> <map> <!-- QUERY "cite_id1" --> <map name="cite_id"> <val name="ut">$UT</val>
<val name="pmid">$PMID</val>
<val name="doi">$DOI</val>
</map> <!-- end of cite_id-->
</map> <!-- end of citations -->
</list> </fn> </request> #; #################################################################################### #################################################################################### my $response =$ua->request(POST 'http://ws.isiknowledge.com/cps/xrpc',
Content_Type => 'text/html', Content => $XMLrequest); my $content = $response->content;
# $content =~ m/<val name=\"pmid\">(\d*)<\/val>/; #return $1; # return grep( /pmid|ut|doi|message/, split(/^/,$content)); return $content; } 1; From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Andrew Beeken Hi all, Don’t know if this is the ideal forum for this but I’ve been banging my head against a brick wall for the last week trying to get this working. We have access to the full Thomson Reuters WoS Web Services API through our InCites subscription
and I’m trying to build a PHP script to dive in and grab citation counts for records based on DOI. I’m struggling a bit, however; the API uses SOAP which I’m really not familiar with and trying to use the (somewhat confusing) TR documentation to hack things
together, extrapolating from online examples, is leading to multiple dead ends with tech support from TR being unable to provide any language specific assistance. Has anyone successfully integrated this through PHP or have any experience using SOAP that could
give me a few pointers? Talk soon! Andrew Beeken Research Information Systems Developer University of Lincoln
|
- References:
- [EP-tech] Thomson Reuters API/PHP
- From: Andrew Beeken <anbeeken@lincoln.ac.uk>
- [EP-tech] Thomson Reuters API/PHP
- Prev by Date: [EP-tech] Event Queue 'Bug' ?
- Next by Date: Re: [EP-tech] xsd for eprints xml export import format
- Previous by thread: Re: [EP-tech] Thomson Reuters API/PHP
- Next by thread: [EP-tech] xsd for eprints xml export import format
- Index(es):