LP#1666987: Include a user-agent to build the relator map
authorDan Scott <dscott@laurentian.ca>
Sun, 13 May 2018 14:59:24 +0000 (10:59 -0400)
committerDan Wells <dbw2@calvin.edu>
Mon, 8 Apr 2019 18:22:42 +0000 (14:22 -0400)
loc.gov started using Cloudflare protection to block HTTP access from default
user agents, so identify ourselves as an Evergreen user agent to restore our
access.

Long term we should evolve to using the linked open data access method
via id.loc.gov but let's get this working first.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Dan Wells <dbw2@calvin.edu>

build/tools/relator_map

index 7423482..dc949b1 100755 (executable)
@@ -4,9 +4,12 @@ use warnings;
 
 use XML::LibXML;
 use XML::LibXML::Reader;
-use LWP::Simple;
+use LWP::Simple qw($ua get);
 use Data::Dumper;
 
+# loc.gov blocks basic user agents now
+$ua->agent('Evergreen/3.1');
+
 my %relator;
 my $code = 0;
 my $fullname = 0;