WWW-Search-Googlism-0.02/0040755000076400007640000000000007606262754013644 5ustar xernxernWWW-Search-Googlism-0.02/MANIFEST0100644000076400007640000000011007606261437014757 0ustar xernxernbin/googlism.pl Changes Googlism.pm Makefile.PL MANIFEST README test.pl WWW-Search-Googlism-0.02/test.pl0100644000076400007640000000067307606262607015160 0ustar xernxernuse Test; $|++; BEGIN { plan tests => 2 }; use WWW::Search::Googlism; ok(1); print "Are you connected to internet [Y/n]?"; chomp($ans = ); if($ans =~ /n/i){ ok(1); } else{ $query = "googlism"; $search = new WWW::Search('Googlism'); $search->native_query(WWW::Search::escape_query($query), { type => 'who' }); while (my $result = $search->next_result()) { $text .= "$result\n"; } ok(($text ? 1 : 0), 1); } WWW-Search-Googlism-0.02/Changes0100644000076400007640000000026207572322603015124 0ustar xernxernRevision history for Perl extension WWW::Search::Googlism. 0.01 Sun Dec 1 13:51:17 2002 - original version; created by h2xs 1.21 with options -XA -n WWW::Search::Googlism WWW-Search-Googlism-0.02/Googlism.pm0100644000076400007640000000550607606261350015754 0ustar xernxernpackage WWW::Search::Googlism; use 5.006; use strict; use warnings; require Exporter; our @ISA = qw(WWW::Search Exporter); our $VERSION = '0.02'; use Carp; use WWW::Search qw/generic_option/; require WWW::SearchResult; my $MAINTAINER = 'xern '; sub native_setup_search { my($self, $native_query, $native_options_ref) = @_; $self->{_debug} = $native_options_ref->{'search_debug'}; $self->{_debug} = 0 if (!defined($self->{_debug})); $self->{agent_e_mail} = 'xern@cpan.org'; $self->user_agent('WWW::Search::Googlism Agent'); $self->{_next_to_retrieve} = 1; $self->{'_num_hits'} = 0; if (!defined($self->{_options})) { $self->{'search_base_url'} = 'http://www.googlism.com/'; $self->{_options} = { 'search_url' => 'http://www.googlism.com/index.htm', 'ism' => $native_query, }; } my $options_ref = $self->{_options}; if (defined($native_options_ref)){ foreach (keys %$native_options_ref) { $options_ref->{$_} = $native_options_ref->{$_}; } } my($options) = ''; foreach (sort keys %$options_ref) { next if (generic_option($_)); croak("Unknown option") unless $_ eq 'ism' || $_ eq 'type'; my %dict = qw/who 1 what 2 where 3 when 4/; if( $_ eq 'type' ){ croak("Invalid type") unless $dict{$options_ref->{'type'}}; $options_ref->{'type'} = $dict{$options_ref->{'type'}}; } $options .= $_ . '=' . $options_ref->{$_} . '&'; } chop $options; $self->{_next_url} = $self->{_options}{'search_url'}.'?'.$options; # print $self->{_next_url}; } sub native_retrieve_some { my ($self) = @_; return unless $self->{_next_url}; my($response) = $self->http_request('GET', $self->{_next_url}); $self->{response} = $response; $response->{_content} =~ m!

Googlism for: .+?


(.+)
\n!s; for my $r (split /
\n/, $1){ $self->{_num_hits}++; push @{$self->{cache}}, $r; } undef $self->{_next_url}; } 1; __END__ # Below is stub documentation for your module. You better edit it! =head1 NAME WWW::Search::Googlism - Searching Googlism =head1 SYNOPSIS use WWW::Search::Googlism; $query = "googlism"; $search = new WWW::Search('Googlism'); $search->native_query(WWW::Search::escape_query($query), { type => 'who' }); while (my $result = $search->next_result()) { print "$result\n"; } =head1 DESCRIPTION WWW::Search::Googlism is a subclass of WWW::Search. Users can use this module to search http://www.googlism.com/. See also L distributed with this module. =head1 TYPES Four types of searching Googlism are "who is", "what is", "where is", and "when is". Specify it with parameter 'type'. =head1 AUTHOR xern =head1 LICENSE Released under The Artistic License =head1 SEE ALSO L, L =cut WWW-Search-Googlism-0.02/bin/0040755000076400007640000000000007606262754014414 5ustar xernxernWWW-Search-Googlism-0.02/bin/googlism.pl0100755000076400007640000000141307606261735016566 0ustar xernxern#!/usr/local/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; $VERSION = '0.01'; =head1 NAME googlism.pl - Search Googlism.com =head1 SYNOPSIS B query [ type ] =head1 DESCRIPTION A utility to search http://googlism.com/. Type C is assumed if it is not specified. =head1 SEE ALSO L, L =head1 AUTHOR xern =head1 LICENSE Released under The Artistic License =cut use WWW::Search::Googlism; $query = $ARGV[0] ? $ARGV[0] : die; $search = new WWW::Search('Googlism'); $search->http_proxy(''); $search->native_query( WWW::Search::escape_query($query), { type => ( $ARGV[1] ? $ARGV[1] : 'who') } ); while (my $result = $search->next_result()) { print "$result\n"; } WWW-Search-Googlism-0.02/README0100644000076400007640000000061707606262031014511 0ustar xernxernWWW/Search/Googlism version 0.01 ================================ WWW::Search::Googlism is a subclass of WWW::Search. Users can use this module to search http://www.googlism.com/. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install COPYRIGHT AND LICENCE Copyright (C) 2002 xern , released under The Artistic License WWW-Search-Googlism-0.02/Makefile.PL0100644000076400007640000000066307606262140015605 0ustar xernxernuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'WWW::Search::Googlism', 'VERSION_FROM' => 'Googlism.pm', 'PREREQ_PM' => { 'WWW::Search' => 0 }, 'EXE_FILES' => [ ], ($] >= 5.005 ? (ABSTRACT_FROM => 'Googlism.pm', AUTHOR => 'xern ') : ()), );