-
Notifications
You must be signed in to change notification settings - Fork 0
/
importsubmit.pl
41 lines (31 loc) · 1.11 KB
/
importsubmit.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl
############################################################
# You will need an ExLibris developer's key to make the program
#
# This program submits a metadata import profile based on profile ID
#
##############################################################
use strict;
use warnings;
use LWP::UserAgent;
########################################################################
# initialize a few variables. You'll need a developer's key from OCLC to
# make this work
########################################################################
open my $apikeyfile, '<', "apikey.txt";
my $apikey = <$apikeyfile>;
close $apikeyfile;
my $ua = LWP::UserAgent->new;
$ua->default_header('Authorization' => "apikey $apikey");
my $response = '';
my $url = '';
my $profileid = '1244117490001858';
my $baseurl = 'https://api-na.hosted.exlibrisgroup.com';
my $service = '/almaws/v1/conf/md-import-profiles/' . $profileid . '?op=run';
my $outputfile = 'out.txt';
open (OUTFILE, '>:utf8',$outputfile);
$url = $baseurl . $service;
$response = $ua->post($url);
print $url;
print OUTFILE $response->content;
close (OUTFILE);