WWW::OReillyMedia::Store - Interface to the OReilly Media Store.
Version 0.06
Objective of this module is to provide an interface to the OReilly online media store.
Fetches books details from OReilly online store realtime. It does so as part of constructor functionality. You DONT really need to do call this explicitly. However it is still there for you to play with it.
Search for a book in the book store. Search can be done by it's id, description, released year,price,ebook and online availability. Each of this can be provided as key to the anonymous hash.
use strict; use warnings; use WWW::OReillyMedia::Store; my ($store, $books); $store = WWW::OReillyMedia::Store->new(); # Search by ID. $books = $store->search_book({id => 9780596005054}); print $books->[0]->as_string(); # Search by Description. $books = $store->search_book({description => '.NET Framework Essentials'}); print $books->[0]->as_string(); # Search by Released year. $books = $store->search_book({released => 'Mar 2003'}); print $books->[0]->as_string(); # Search by price i.e. less than or equal to $10. $books = $store->search_book({price => 10}); print $books->[0]->as_string(); # Search by ebook i.e. return all ebooks. $books = $store->search_book({ebook => 1}); print $books->[0]->as_string(); # Search by online i.e. return all online books. $books = $store->search_book({online => 1}); print $books->[0]->as_string();
Returns the total books count in the OReilly online store.
use strict; use warnings; use WWW::OReillyMedia::Store; my $store = WWW::OReillyMedia::Store->new(); print "Count: [" . $store->book_count() . "]\n"
Returns all the books that have been fetched from the OReilly online store. Data would be in the form of list of objects of class WWW::OReillyMedia::Store::Book.
use strict; use warnings; use WWW::OReillyMedia::Store; my $store = WWW::OReillyMedia::Store->new(); my $books = $store->get_all_books(); print $books->[0]->as_string();
Return all books in human readable format.
use strict; use warnings; use WWW::OReillyMedia::Store; my $store = WWW::OReillyMedia::Store->new(); # Be warned, it is a bit slow and most likely to bring back quite a lot of output. print $store;
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
Please report any bugs or feature requests to bug-www-oreillymedia-store at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-OReillyMedia-Store. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-oreillymedia-store at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WWW::OReillyMedia::Store
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-OReillyMedia-Store
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-OReillyMedia-Store
CPAN Ratings
http://cpanratings.perl.org/d/WWW-OReillyMedia-Store
Search CPAN
http://search.cpan.org/dist/WWW-OReillyMedia-Store/
Copyright 2011 Mohammad S Anwar.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install WWW::OReillyMedia::Store, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::OReillyMedia::Store
CPAN shell
perl -MCPAN -e shell install WWW::OReillyMedia::Store
For more information on module installation, please visit the detailed CPAN module installation guide.