#!/usr/local/bin/perl -w
###########################################
# woot-scraper 
# 2009, Mike Schilli <cpan@perlmeister.com>
###########################################
use strict;
use warnings;
use Getopt::Std;
use Pod::Usage;
use LWP::UserAgent;
use Bot::WootOff;
use Log::Log4perl qw(:easy);

getopts("v", \my %opts);

Log::Log4perl->easy_init( $opts{v} ? $ERROR : $DEBUG );

my $bot = Bot::WootOff->new(spawn => 0);

my ($item, $price) = $bot->scraper_test();

if(!defined $price) {
    die $bot->error();
}

__END__

=head1 NAME

    woot-scraper - Check if Bot::WootOff can still scrape woot.com

=head1 SYNOPSIS

    woot-scraper

=head1 OPTIONS

=over 8

=item B<-v>

Verbose output.

=back

=head1 DESCRIPTION

woot-scraper fetches the woot.com front page and tries to scrape the
current product and its price from it.

If it fails, woot.com has changed their HTML and the scraper needs to 
be adapted. Please contact the author in this case or fix it yourself
on http://github.com/mschilli/bot-wootoff and send a pull request.

=head1 EXAMPLES

  $ woot-scraper

=head1 LEGALESE

Copyright 2009 by Mike Schilli, all rights reserved.
This program is free software, you can redistribute it and/or
modify it under the same terms as Perl itself.

=head1 AUTHOR

2009, Mike Schilli <cpan@perlmeister.com>
