Important alert: (current site time 7/15/2013 9:28:12 PM EDT)
 

VB icon

Check FatBrain for books

Email
Submitted on: 7/30/2000 12:21:51 AM
By: Found on the World Wide Web 
Level: Intermediate
User Rating: By 2 Users
Compatibility: 5.0 (all versions), 4.0 (all versions), 3.0 (all versions), Pre 3.0
Views: 12529
 
     This script takes a list of books and looks to see if they are considered published on fatbrain.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
=**************************************
= Name: Check FatBrain for books
= Description:This script takes a list of books and looks to see if they are considered published on fatbrain.
= By: Found on the World Wide Web
=**************************************

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.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0070284857',
				'Mastering Algorthims with Perl' => 'http://www1.fatbrain.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 all the work in looking them up. 
I created this script to check if the books I am looking for are published.
=head1 README
=head1 PREREQUISITES
This script has a few requirements. You will need LWP and you will need 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


Other 100 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.