Lines 80-86
sub _get_biblio_from_xisbn {
Link Here
|
80 |
|
80 |
|
81 |
sub get_xisbns { |
81 |
sub get_xisbns { |
82 |
my ( $isbn ) = @_; |
82 |
my ( $isbn ) = @_; |
83 |
my ($response,$thing_response,$xisbn_response,$syndetics_response,$errors); |
83 |
my ($response,$thing_response,$syndetics_response,$errors); |
84 |
# THINGISBN |
84 |
# THINGISBN |
85 |
if ( C4::Context->preference('ThingISBN') ) { |
85 |
if ( C4::Context->preference('ThingISBN') ) { |
86 |
my $url = "http://www.librarything.com/api/thingISBN/".$isbn; |
86 |
my $url = "http://www.librarything.com/api/thingISBN/".$isbn; |
Lines 96-116
sub get_xisbns {
Link Here
|
96 |
$syndetics_response = {isbn => \@syndetics_response}; |
96 |
$syndetics_response = {isbn => \@syndetics_response}; |
97 |
} |
97 |
} |
98 |
|
98 |
|
99 |
# XISBN |
99 |
$response->{isbn} = [ @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ]; |
100 |
if ( C4::Context->preference('XISBN') ) { |
|
|
101 |
my $affiliate_id=C4::Context->preference('OCLCAffiliateID'); |
102 |
my $limit = C4::Context->preference('XISBNDailyLimit') || 999; |
103 |
my $reached_limit = _service_throttle('xisbn',$limit); |
104 |
my $url = "http://xisbn.worldcat.org/webservices/xid/isbn/".$isbn."?method=getEditions&format=xml&fl=form,year,lang,ed"; |
105 |
$url.="&ai=".$affiliate_id if $affiliate_id; |
106 |
unless ($reached_limit) { |
107 |
$xisbn_response = _get_url($url,'xisbn'); |
108 |
} |
109 |
$errors->{xisbn} = $xisbn_response->{ stat } |
110 |
if $xisbn_response->{ stat } ne 'ok'; |
111 |
} |
112 |
|
113 |
$response->{isbn} = [ @{ $xisbn_response->{isbn} or [] }, @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ]; |
114 |
my @xisbns; |
100 |
my @xisbns; |
115 |
my $unique_xisbns; # a hashref |
101 |
my $unique_xisbns; # a hashref |
116 |
|
102 |
|