use Modern::Perl;
use LWP::UserAgent;
-use XML::Simple qw(XMLin);
+use XML::Simple qw( XMLin );
use C4::Context;
use base qw(Koha::SuggestionEngine::Base);
sub get_suggestions {
my ($self, $query) = @_;
my $key = C4::Context->preference('LibrisKey');
-
+ my $base = C4::Context->preference('LibrisURL');
my $search = $query->{'search'};
- my $response = LWP::UserAgent->new->get("http://api.libris.kb.se/bibspell/spell?query={$search}&key=$key");
+ my $response = LWP::UserAgent->new->get($base."spell?query={$search}&key=$key");
my $xml = XMLin($response->content, NoAttr => 1, ForceArray => qr/term/);
my @terms;
=over
+=item NAME
+
+my $name = $plugin->NAME;
+
+=back
+
+=over
+
=item get_suggestions(query)
Sends in the search query and gets an XML with a suggestion
+my $suggestions = $plugin->get_suggestions(\%query);
+
=back
=cut