Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

fatbrain.pl

by ergowolf (Monk)
on Apr 27, 2000 at 17:58 UTC ( #9398=sourcecode: print w/ replies, xml ) Need Help??

Category: web search
Author/Contact Info ergowolf
Description: This program checks for books from fatbrain, but it can be easily be modified to search any site's page.
use strict;
use LWP::UserAgent;

my $VERSION = 1.0;
my %pages = (
                'Firewall 1' => 'http://www1.fatbrain.com/asp/bookinfo
+/bookinfo.asp?theisbn=007134229x',
                'Bay Network Router Configuration' => 'http://www1.fat
+brain.com/asp/bookinfo/bookinfo.asp?theisbn=0070284857',
                'Mastering Algorthims with Perl' => 'http://www1.fatbr
+ain.com/asp/bookinfo/bookinfo.asp?theisbn=1565923987',
                );

foreach (keys %pages) {
my $ua = new LWP::UserAgent;
my $req = new HTTP::Request GET => $pages{$_};
my $string = $ua->request($req)->as_string;
    if ($string =~ m/Not yet published/g) {
    print "$_ is not out yet.\n";
    } else {
    print "$_ has been published.";
    }
}

=head1 NAME

fatbrain - This script takes a list of books and looks to see if they 
+are considered published on fatbrain.

=head1 DESCRIPTION

I am always waiting for books to be published and I am sick of doing a
+ll the work in looking them up.  
I created this script to check if the books I am looking for are publi
+shed.

=head1 README

=head1 PREREQUISITES

This script has a few requirements.  You will need LWP and you will ne
+ed to look up the book the first time
yourself.  Once you have the url cut and paste it into the value field
+  in %pages and put in a description in the key
of the hash.

=head1 COREQUISITES

None

=pod SCRIPT CATEGORIES

Web

=cut

Comment on fatbrain.pl
Download Code
Re: fatbrain.pl Im ashamed at you
by damian1301 (Curate) on Dec 09, 2000 at 05:56 UTC
    Im very very ashamed, I have just found the same code on http://planet-source-code.com and I don't think that ergowolf copied anything -- Because his posts were here 3 months before theirs. For those who want the URL, here it is...
    Here.

    Wanna be perl hacker.
    Dave AKA damian

Back to Code Catacombs

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://9398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2014-07-25 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (174 votes), past polls