OurNet::Query - Perform scriptable queries via LWP
use OurNet::Query; # Set query parameters my ($query, $hits) = ('autrijus', 10); my @sites = ('Altavista', 'InfoSeek', 'Yahoo', 'Excite'); my %found; # Generate a new Query object my $bot = OurNet::Query->new($query, $hits, @sites); # Perform a query my $found = $bot->begin(\&callback, 30); # Timeout after 30 seconds print '*** ' . ($found ? $found : 'No') . ' match(es) found.'; sub callback { my %entry = @_; my $entry = \%entry; unless ($found{$entry{'url'}}) { print "*** [$entry->{'title'}]" . " ($entry->{'score'})" . " - [$entry->{'id'}]\n" . " URL: [$entry->{'url'}]\n"; } $found{$entry{'url'}}++; }
OurNet::Query provides an easy interface to perform multiple queries to internet services, and "wrap" them into your own format at once. The results are processed on-the-fly and are returned via callback functions.
OurNet::Site
Autrijus Tang <autrijus@autrijus.org>
Copyright 2001 by Autrijus Tang <autrijus@autrijus.org>.
All rights reserved. You can redistribute and/or modify this module under the same terms as Perl itself.
To install OurNet::Site, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OurNet::Site
CPAN shell
perl -MCPAN -e shell install OurNet::Site
For more information on module installation, please visit the detailed CPAN module installation guide.