NAME

WWW::NOS::Open - Perl framework for the Open NOS REST API.

VERSION

This document describes WWW::NOS::Open version 0.01

SYNOPSIS

    use WWW::NOS::Open;
    my $nos = WWW::NOS::Open->new($API_KEY);
    @latest_articles = $nos->get_latest_articles('nieuws');

DESCRIPTION

Wrapper around the REST API to get data from Open NOS into Perl.

SUBROUTINES/METHODS

new

Create a new WWW::NOS::Open object.

1. The API key to use in the connection to the Open NOS service. You need to register at Open NOS to get an API key.

get_version

Gets the version of the REST API as a WWW::NOS::Open::Version object.

get_latest_articles

Returns the ten most recent articles as an array of WWW::NOS::Open::Article objects.

1. The optional category of the requested articles, nieuws or sport. Defaults to the category nieuws.

get_latest_videos

Returns the ten most recent videos as an array of WWW::NOS::Open::Video objects.

1. The optional category of the requested videos, nieuws or sport. Defaults to the category nieuws.

get_latest_audio_fragments

Returns the ten most recent audio fragments as an array of WWW::NOS::Open::AudioFragment objects.

1. The optional category of the requested audio fragments, nieuws or sport. Defaults to the category nieuws.

Search the searchengine from NOS for keywords. Returns a WWW::NOS::Open::Results object with a maximum of 25 items.

1. The keyword or a combination of keywords, for example cricket, cricket AND engeland, cricket OR curling.

get_tv_broadcasts

Gets a collection of television broadcasts between two optional dates. Returns an array of WWW::NOS::Open::DayGuide objects. The period defaults to starting yesterday and ending tomorrow.

1. Start date in the format YYYY-MM-DD
2. End date in the format YYYY-MM-DD

get_radio_broadcasts

Gets a collection of radio broadcasts between two optional dates. Returns an array of WWW::NOS::Open::DayGuide objects. The period defaults to starting yesterday and ending tomorrow. The period has an upper limit of 14 days.

1. Start date in the format YYYY-MM-DD
2. End date in the format YYYY-MM-DD

CONFIGURATION AND ENVIRONMENT

This module uses the environment variable NOSOPEN_SERVER to specify a server that is not the default Open NOS live server at http://open.nos.nl.

The useragent identifier used in the request to the REST API is WWW::NOS::Open/0.01.

DEPENDENCIES

Date::Calc Date::Format HTTP::Headers HTTP::Request HTTP::Status JSON LWP::UserAgent Log::Log4perl Moose Moose::Util::TypeConstraints Readonly URI URI::Escape WWW::NOS::Open::Article WWW::NOS::Open::AudioFragment WWW::NOS::Open::Broadcast WWW::NOS::Open::DayGuide WWW::NOS::Open::Document WWW::NOS::Open::Exceptions WWW::NOS::Open::Result WWW::NOS::Open::TypeDef WWW::NOS::Open::Version WWW::NOS::Open::Video XML::Simple namespace::autoclean

INCOMPATIBILITIES

DIAGNOSTICS

This module uses Log::Log4perl.

BUGS AND LIMITATIONS

Currently the interface only uses the XML output of the service, which might not give the best performance.

Please report any bugs or feature requests at RT for rt.cpan.org.

AUTHOR

Roland van Ipenburg <ipenburg@xs4all.nl>

LICENSE AND COPYRIGHT

Copyright 2011 by Roland van Ipenburg

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.2 or, at your option, any later version of Perl 5 you may have available.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.