NAME
WWW::ShopBot - Price comparison agent
SYNOPSIS
use WWW::ShopBot;
$bot = new WWW::ShopBot( drivers => \@drivers );
$bot->query($product);
DESCRIPTION
This module is a shopping agent which can fetch products' data and sort them by the price. Users can also write drivers to extend its functionality.
Set up a bot
$bot = new WWW::ShopBot(
# Load drivers for merchants
# It will scan through directories for drivers
drivers => \@drivers,
# Recognized entries in an item's data
# 'product' and 'price' are the default.
pick => [ 'product', 'price', 'desc' ],
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,
);
Then, it will returns a list of products' data.
List drivers
This module also exports a tool for listing existent merchant drivers in computer.
print join $/, list_drivers;
COPYRIGHT
xern <xern@cpan.org>
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.