Lines 91-97
sub _get_biblio_from_xisbn {
Link Here
|
91 |
|
91 |
|
92 |
sub get_xisbns { |
92 |
sub get_xisbns { |
93 |
my ( $isbn ) = @_; |
93 |
my ( $isbn ) = @_; |
94 |
my ($response,$thing_response,$xisbn_response,$syndetics_response); |
94 |
my ($response,$thing_response,$xisbn_response,$syndetics_response,$errors); |
95 |
# THINGISBN |
95 |
# THINGISBN |
96 |
if ( C4::Context->preference('ThingISBN') ) { |
96 |
if ( C4::Context->preference('ThingISBN') ) { |
97 |
my $url = "http://www.librarything.com/api/thingISBN/".$isbn; |
97 |
my $url = "http://www.librarything.com/api/thingISBN/".$isbn; |
Lines 117-122
sub get_xisbns {
Link Here
|
117 |
unless ($reached_limit) { |
117 |
unless ($reached_limit) { |
118 |
$xisbn_response = _get_url($url,'xisbn'); |
118 |
$xisbn_response = _get_url($url,'xisbn'); |
119 |
} |
119 |
} |
|
|
120 |
$errors->{xisbn} = $xisbn_response->{ stat } |
121 |
if $xisbn_response->{ stat } ne 'ok'; |
120 |
} |
122 |
} |
121 |
|
123 |
|
122 |
$response->{isbn} = [ @{ $xisbn_response->{isbn} or [] }, @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ]; |
124 |
$response->{isbn} = [ @{ $xisbn_response->{isbn} or [] }, @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ]; |
Lines 132-138
sub get_xisbns {
Link Here
|
132 |
my $xbiblio= _get_biblio_from_xisbn($response_data->{content}); |
134 |
my $xbiblio= _get_biblio_from_xisbn($response_data->{content}); |
133 |
push @xisbns, $xbiblio if $xbiblio; |
135 |
push @xisbns, $xbiblio if $xbiblio; |
134 |
} |
136 |
} |
135 |
return \@xisbns; |
137 |
if ( wantarray ) { |
|
|
138 |
return (\@xisbns, $errors); |
139 |
} |
140 |
else { |
141 |
return \@xisbns; |
142 |
} |
136 |
} |
143 |
} |
137 |
|
144 |
|
138 |
sub _get_url { |
145 |
sub _get_url { |