NAME

WWW::ShopBot - Price comparison agent

SYNOPSIS

use WWW::ShopBot;
$bot = new WWW::ShopBot( merchants => \@merchants );
$bot->query($product);

DESCRIPTION

This module is a shopping agent which can fetch products' data and sort them by the price.

Set up a bot

$bot = new WWW::ShopBot(
  # Specify merchants' descriptions
  # See also WWW::ContentRetrieval
  merchants => \@merchants,
  
  # Or give it a glob reference
  merchants => [ glob("foo/merchant.*>") ],
  
  # Recognized entries in an item's data
  # 'product' and 'price' are the default.
  pick      => [ 'product', 'price', 'desc' ],
  
  # You can use your own sorting function instead of the default one.
  # Sorting by 'price' is the default.
  sortfunc    => \&sort_by_product,

  proxy => 'http://foo.bar:1234/,
  );

Look for product

Query will be sent to the given hosts.

$result = $bot->query('some product');

Or more specifically, you can do this.

  $result = $bot->query(
			product => 'some product',

			# Choose items whose prices are between
			# an interval
			price => [ $lower_bound, $upper_bound ],

			# You can use a self-defined filter to
			# decide whether to take this item or not.
			desc => \&my_desc_filter,
			);

SEE ALSO

WWW::ContenetRetrieval

COPYRIGHT

xern <xern@cpan.org>

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.