
WWW::Scroogle - Perl Extension for Scroogle

Please note that using Scroogle.org - which this module is using (may) be a violation of Google's "Terms of Service", of which scroogle.org has been reminded. You can find the TOS at http://www.google.com/terms_of_service.html
Scroogle.org does violate the "No Automated Query" section.
The Author has searched for some easy way to get google results, he stumbled across the Google SOAP Api to which turned out to be useless because google will not give away keys to it anymore, later he found out about Googles Ajax api which turns out to be useless as you can only get the first 20results for a searchterm, now there was only one possibility left: parsing the html output of google webquerys; but while thinking about that the author realized scroogle.org, those guys have already done that job and do provide nice, clean html output which is much easier to parse than google.
To come to an end: WWW::Scroogle does one job - it provides you with usable scroogle.org search results.

use WWW::Scroogle;
# create a new WWW::Scroogle object
my $scroogle = WWW::Scroogle->new;
# set searchstring
$scroogle->searchstring('foobar');
# get search_results
my $results = $scroogle->get_results;
# print rank of the first website whose url matches 'wikipedia'
print $results->position(qr{wikipedia}).'\n';
# get all results
my @results = $results->get_results;
# iterate over all results
for (@results){
print $_->url."\n";
}

WWW::Scroogle uses LWP to fetch the search results from scroogle and parses the returned html output.

Returns a new WWW::Scroogle object.
returns the current searchstring
sets $searchstring as the current searchstring
returns the current Language - defaults to all
sets $language as the current language
Returns a list of avaible languages.
Returns the current number of search results - defaults to 100
sets the number of results
performs search and stores result. expects that a searchstring was set.
returns number of results or false if no results are avaible
returns true if there are stored results and false if there are no results avaible
deletes all saved results
returns list of WWW::Scroogle::Result objects. or a list of all wanted results if list was provided
returns a list of result-objects whose url is matching the given string or regexp
returns the requested result
returns the position (counting from 1) of the first result whose url matches the given string or regexp
returns a list of the positions (counting from 1) of all results whose url's are matching the given string or regexp

Tina Müller
Moritz Lenz

Written by Lars Hartmann, <lars (at) chaotika (dot) org>.

Copyright (C) 2008 by Lars Hartmann, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.