# A simple interface to www.scholix.org # Takes a PID, eg a DOI, passes this to the scholix API for a list of related online resources # Renders the results as an HTML list # Designed for easy inclusion in other pages via an ajax call # # Written by: Justin Bradley, EPrints Servies, April 2020 # Updated by: David Newman, EPrints Services, February 2021 use EPrints; use JSON; use LWP::UserAgent; use strict; my $session = EPrints::Session->new(); $session->send_http_header( content_type => "text/html; charset=iso-8859-1" ); my $pid = $session->param( "pid" ); # eg 10.1016/j.quascirev.2019.106103 $pid =~ s/[ ";\\]+//g; my $url = "http://api.scholexplorer.openaire.eu/v1/linksFromPid?pid=$pid"; my $ua = LWP::UserAgent->new; my $response = $ua->get( $url, "accept", "application/json" ); if ( $response->code ne "200" ) { $session->terminate(); exit; } my $json = decode_json( $response->content ); if( !$json || ref($json) ne 'ARRAY' ) { $session->terminate(); exit; } my %seen; my $done_title = 0; # print "
\n\n
\n"; $session->terminate();