WWW::NOS::Open - Perl framework for the Open NOS REST API.
This document describes WWW::NOS::Open version 0.100.
use WWW::NOS::Open; my $nos = WWW::NOS::Open->new($API_KEY); @latest_articles = $nos->get_latest_articles('nieuws');
The Dutch public broadcasting foundation NOS provides a REST API to their content. This module provides a wrapper around that API to use data from the Open NOS platform with Perl.
new
Create a new WWW::NOS::Open object.
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.
nieuws
sport
get_latest_videos
Returns the ten most recent videos as an array of WWW::NOS::Open::Video objects.
get_latest_audio_fragments
Returns the ten most recent audio fragments as an array of WWW::NOS::Open::AudioFragment objects.
search
Search the search engine from NOS for keywords. Returns a WWW::NOS::Open::Results object with a maximum of 25 items.
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. The period has an upper limit of 14 days. An NOSOpenExceededRangeException is thrown when this limit is exceeded.
NOSOpenExceededRangeException
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. An NOSOpenExceededRangeException is thrown when this limit is exceeded.
To use this module with the live content of Open NOS you need an API key which can be obtained by registering at Open NOS and then configure your account there with the IP range you'll be accessing the service from.
This module can use the optional environment variable NOSOPEN_SERVER to specify a server URL that is not the default Open NOS live service at http://open.nos.nl.
NOSOPEN_SERVER
The user agent identifier used in the request to the REST API is WWW::NOS::Open/0.100.
WWW::NOS::Open/0.100
perl 5.14
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
None.
Exceptions in the form of an Exception::Class are thrown when the Open NOS service reports an exception:
NOSOpenUnauthorizedException
When a request was made without a valid API key, or from an IP address not configured to be valid for that API key.
When the time period for a guide request exceeds the supported range of 14 days.
NOSOpenInternalServerErrorException
When an internal server error has occurred in the Open NOS service.
NOSOpenBadRequestException
When the Open NOS service reports the request had bad syntax.
Currently this module only uses the XML output of the Open NOS service and has no option to use the JSON or serialized PHP formats. When the API matures the other output options might be added and the content of the raw responses exposed for further processing in an appropriate environment.
Please report any bugs or feature requests at RT for rt.cpan.org.
Roland van Ipenburg, <ipenburg@xs4all.nl>
Copyright 2012 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.14.0 or, at your option, any later version of Perl 5 you may have available.
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.
To install WWW::NOS::Open, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::NOS::Open
CPAN shell
perl -MCPAN -e shell install WWW::NOS::Open
For more information on module installation, please visit the detailed CPAN module installation guide.