WWW::TasteKidResult - An object encapsulating a reponse from the TasteKid API
Version 0.1.2
my $tc = WWW::TasteKid->new; $tc->query({ type => 'music', name => 'bach' }); $tc->query({ type => 'movie', name => 'amadeus' }); $tc->query({ type => 'book', name => 'star trek' }); $tc->ask; my $info = $tc->info_resource; # returns a array ref of WWW::TasteKidResult objects # i.e. # [ # bless( do{\(my $o = undef)}, 'WWW::TasteKidResult' ), # bless( do{\(my $o = undef)}, 'WWW::TasteKidResult' ), # bless( do{\(my $o = undef)}, 'WWW::TasteKidResult' ) # ]; which you iterate over, calling the accessors for the fields you desire foreach my $tkr (@{$info}) { print $tkr->name, $tkr->type; #accessors for a WWW::TasteKidResult object }
This module useless standalone, it's only used to hold responses as objects from WWW::TasteKid;
See: WWW::TasteKid or (if installed) perldoc WWW::TasteKid;
See Synopsis
An object of this class represents an TasteKid API results object
my $taste_kid = WWW::TasteKidResults->new;
Create a new WWW::TasteKidResults Object;
Takes no arguments
the name of a query mandatory, no object without this
the type of a query optional, if set will return one of: music, movie, book
wteaser - a brief description, if found (wikipedia) part of the 'rich data' output, only set if the 'verbose' parameter is passed to the 'ask' method
wurl - url where the brief description was found (wikipedia) part of the 'rich data' output, only set if the 'verbose' parameter is passed to the 'ask' method
ytitle - video title, if video found (youtube) part of the 'rich data' output, only set if the 'verbose' parameter is passed to the 'ask' method
yurl - video url, if video found (youtube) part of the 'rich data' output, only set if the 'verbose' parameter is passed to the 'ask' method
'dump' our internal data structure for manual inspection, used for debugging only. (Data::Dumper does not work on this object since it's an inside out object).
None currently known
if you are running perl > 5.8.1 and have access to install cpan modules, you should have no problem install this module
no special configuration used
WWW::TasteKidResult uses the following modules:
Carp
Data::Dumper
criticism(pragma - enforce Perl::Critic if installed)
version (pragma - version numbers)
Test::More
Scalar::Util
Class::InsideOut
there shouldn't be any restrictions on versions of the above modules, as long as you have a relativly new perl > 5.0008 most of these are in the standard Perl distribution, otherwise they are common enough to be pre packaged for your operating systems package system or easilly downloaded and installed from the CPAN.
none known of
http://www.tastekid.com/
David Wright, <david_v_wright at yahoo.com>
<david_v_wright at yahoo.com>
Please report any bugs or feature requests to bug-www-tastekid at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-TasteKid. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-tastekid at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WWW::TasteKid
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-TasteKid
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-TasteKid
CPAN Ratings
http://cpanratings.perl.org/d/WWW-TasteKid
Search CPAN
http://search.cpan.org/dist/WWW-TasteKid
Some common acronems went into the making of this module:
PBP
TDD
OOP
vim
this module was created with module-starter
module-starter --module=WWW::TasteKid \ --author="David Wright" --email=david_v_wright@yahoo.com
Copyright 2009 David Wright, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::TasteKid, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::TasteKid
CPAN shell
perl -MCPAN -e shell install WWW::TasteKid
For more information on module installation, please visit the detailed CPAN module installation guide.