my $no_zsi;
+use strict;
+
BEGIN {
$no_zsi = 0;
eval "use LWP::UserAgent";
my $res_return = 5;
my $ua = new LWP::UserAgent;
- $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy"));
+ $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy"));
$ua->timeout(10);
}
my $request = new HTTP::Request('GET', "$searchpath");
- my $response = $ua->request($request);
+ my $response = $ua->request($request);
if (!$response->is_success) {
return "Something failed in connecting to the ZSI web server. Try again later.";
my $content = $response->content;
if ($content =~ /No entries found/im) {
- return "$result No results were found searching ZSI for '$query'.";
+ return "No results were found searching ZSI for '$query'.";
}
my $res_count = 0; #local counter
my @lines = split(/\n/,$content);
my $result = '';
- foreach $line(@lines) {
+ foreach my $line (@lines) {
if (length($line) > 10) {
my ($name, $href, $desc) = split(/\|/,$line);
if ($res_count < $res_return) {
- $result .= "$name ($desc) $href\n";
+ $result .= "$name ($desc) $href : ";
$res_display ++;
}
$res_count ++;
}
if (($query) && ($res_count > $res_display)) {
- $result .= "$res_display of $res_count shown. All at http://killefiz.de/zaurus/search.php?q=$query\n";
+ $result .= "$res_display of $res_count shown. All at http://killefiz.de/zaurus/search.php?q=$query";
}
return $result;
sub query {
my ($args) = @_;
&::performStrictReply(&queryText($args));
- return;
+ return;
}
1;