David Wright

NAME

WWW::TasteKidResult - An object encapsulating a reponse from the TasteKid API

VERSION

Version 0.1.2

SYNOPSIS

    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
    }

DESCRIPTION

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;

OVERVIEW

See: WWW::TasteKid or (if installed) perldoc WWW::TasteKid;

USAGE

See Synopsis

SUBROUTINES/METHODS

An object of this class represents an TasteKid API results object

new

my $taste_kid = WWW::TasteKidResults->new;

Create a new WWW::TasteKidResults Object;

Takes no arguments

name

     the name of a query

     mandatory, no object without this

type

     the type of a query

     optional, if set will return one of: music, movie, book

wteaser

     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

     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

     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

     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

inspect_result_object

    '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).

DIAGNOSTICS

None currently known

CONFIGURATION AND ENVIRONMENT

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

DEPENDENCIES

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.

INCOMPATIBILITIES

none known of

SEE ALSO

http://www.tastekid.com/

AUTHOR

David Wright, <david_v_wright at yahoo.com>

BUGS AND LIMITATIONS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WWW::TasteKid

You can also look for information at:

ACKNOWLEDGEMENTS

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

LICENSE AND COPYRIGHT

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.