NAME
WWW::StreamAPI - Perl interface
for
the HTTP StreamAPI API
SYNOPSIS
use
WWW::StreamAPI;
my
$streamapi
= WWW::StreamAPI->new(
secret_key
=>
'YOUR_SECRET_KEY_HERE'
,
api_key
=>
'YOUR_API_KEY_HERE'
,
debug
=> 1,
);
# Fetch a list of live sessions using the simple request method.
my
$live_session_list
=
$streamapi
->request(
'/session/live/list'
);
Dumper \
$live_session_list
;
# Using the live_sessions helper method.
my
@live_sessions
=
$streamapi
->live_sessions;
Dumper \
@live_sessions
;
# Request a list of all recordings.
my
$recordings
=
$streamapi
->request(
'/video/list'
);
Dumper \
$recordings
;
DESCRIPTION
A minimal Perl interface to the HTTP API for StreamAPI. http://streamapi.com
Methods
request
The first parameter is the HTTP path to call, so
'/video/list'
becomes http://api.streamapi.com/service/video/list.
The second parameter is a hashref of arguments to
send
along
with
the required parametes (rid, sig, api key).
The third parameter sets the HTTP request method. The
default
method is GET.
Examples:
my
$request
=
$streamapi
->request(
'/video/list'
);
my
$request
=
$stickam
->request(
'/path/to/call'
, {
arg1
=>
'val1'
});
my
$request
=
$stickam
->request(
'/path/to/call'
, {
arg1
=>
'val1'
},
'POST'
);
The
return
value is always the datastructure returned by XML::Simple::XMLin.
live_sessions
my
@live_sesions
=
$streamapi
->live_sessions;
create_session
my
(
$private_hostid
,
$public_hostid
) =
$streamapi
->create_session;
or
my
(
$private_hostid
,
$public_hostid
) =
$streamapi
->create_session(
username
=>
'Peter'
);
COPYRIGHT
Copyright 2008, 2009 by Stickam.com <support@stickam.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
AUTHOR
Jake Gold <jake@stickam.com>