Business-YQL

 view release on metacpan or  search on metacpan

lib/Business/YQL.pm  view on Meta::CPAN

    my $data = $yql->q('show tables');

    $data = $yql->query("insert into yahoo.y.ahoo.it (url) values ('http://google.com')");

=head1 DESCRIPTION

This module provides a simple Perl interface (via JSON) to perform YQL queries.  You can test queries in Yahoo's developer console here: L<http://developer.yahoo.com/yql/console|http://developer.yahoo.com/yql/console>.

=head1 METHODS

=head2 new

Instantiates a new Business::YQL client object.  All parameters are optional.

    my $yql = Business::YQL->new(
        scheme => 'http',
        domain => 'query.yahooapis.com',
        version => 'v1',
        timeout => 10,
        retries => 3,
    );

B<Parameters>

=over 4

=item - C<scheme>

I<Optional>E<10> E<8>

The valid HTTP scheme for the URI builder.  Defaults to C<http>.

=item - C<domain>

I<Optional>E<10> E<8>

The Yahoo API top-level domain to make API calls against.  Defaults to L<query.yahooapis.com|http:/query.yahooapis.com>.

=item - C<version>

I<Optional>E<10> E<8>

The Yahoo API version to use.  Defaults to C<v1>.

=item - C<timeout>

I<Optional>E<10> E<8>

The maximum number of seconds to wait after submitting an HTTP request before timing out the response.  Defaults to C<10> seconds.

=item - C<retries>

I<Optional>E<10> E<8>

The number of times to retry requests in cases when Yahoo returns a 5xx response.  Defaults to C<3> attempts.

=back

=head2 q

Submits the YQL query, this method simply takes a string to send to Y! API, and returns the decoded JSON response n the form of a Perl object if the request was valid.

    q("SELECT * from geo.places WHERE text='SFO'")

=head1 AUTHOR

Ali Anari <ali@anari.me>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Ali Anari.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 1.187 second using v1.01-cache-2.11-cpan-bbb979687b5 )