#!/opt/csw/bin/perl -w -I/eprints/eprints3/perl_lib use lib '/eprints/eprints3/'; use EPrints; use SOAP::Lite; use strict; my $session = new EPrints::Session( 1, "liverpool" ); exit( 0 ) unless( defined $session ); my $ds = $session->get_repository->get_dataset( "archive" ); my $search = new EPrints::Search( session=>$session, dataset=>$ds ); $search->add_field( $ds->get_field( "type" ), "article" ); my $list = $search->perform_search; $list->map( \&process_eprint ); sub process_eprint { my( $session, $ds, $eprint ) = @_; return unless $eprint->is_set( "doi" ); my $doi = $eprint->get_value( "doi" ); my $client = $eprint->get_value( "doi" ); $client=~s/\D//g; my $crf = int(rand($client)); my $body = SOAP::Data->name(getCitedByCountReqPayload => \SOAP::Data->value( SOAP::Data->name(dataResponseStyle => "MESSAGE")->type(''), SOAP::Data->name(absMetSource => "all")->type(''), SOAP::Data->name(responseStyle => "wellDefined")->type(''), SOAP::Data->name(inputKey => \SOAP::Data->value( SOAP::Data->name(doi => "$doi")->uri('')->prefix('')->type(''), SOAP::Data->name(clientCRF => "$crf")->uri('')->prefix('')->type(''), )))); my $header = SOAP::Header->name(EASIReq => \SOAP::Header->value( SOAP::Header->name(TransId => " ")->uri('')->type(''), SOAP::Header->name(ReqId => " ")->uri('')->type(''), SOAP::Header->name(Ver => " ")->uri('')->type(''), SOAP::Header->name(Consumer => "ULRA")->uri('')->type(''), SOAP::Header->name(ConsumerClient => " ")->uri('')->type(''), SOAP::Header->name(OpaqueInfo => " ")->uri('')->type(''), SOAP::Header->name(LogLevel => "Default"))) ->uri('http://webservices.elsevier.com/schemas/easi/headers/types/v1')->prefix(''); my $soap = SOAP::Lite->proxy('http://services.elsevier.com/EWSXAbstractsMetadataWebSvc/XAbstractsMetadataServiceV10?wsdl') ->uri('http://webservices.elsevier.com/schemas/metadata/abstracts/types/v10'); my $som = $soap->getCitedByCount($header,$body); my $n = $som->match('//citedByCountList/citedByCount/linkData/citedByCount')->valueof; $eprint->set_value( "scopus_citation_count", $n ); $eprint->commit; my $id = $som->match('//citedByCountList/citedByCount/linkData/scopusID')->valueof; $eprint->set_value( "scopus_id", $id ); $eprint->commit; } $list->dispose(); $session->terminate();