WebService::30Boxes::API - Perl interface to the 30 Boxes API
use WebService::30Boxes::API; #$api_key and $auth_token are defined before my $boxes = WebService::30Boxes::API->new(api_key => $api_key); my $events = $boxes->call('events.Get', {authorizedUserToken => $auth_token}); #my $todos = $boxes->call('todos.Get', {authorizedUserToken => $auth_token}); if($events->{'success'}){ print "List start: " . $events->get_listStart . "\n"; print "List end: " . $events->get_listEnd . "\n"; print "User Id: " . $events->get_userId . "\n\n\n"; #while ($events->nextEventId){ - if you use this, you don't need to specify #$_ as an argument #foreach (@{$events->get_ref_eventIds}){ foreach ($events->get_eventIds){ print "Event id: $_\n"; print "Title: " . $events->get_title($_) . "\n"; print "Repeat end date: " . $events->get_repeatEndDate($_) . "\n"; print "Repeat skip dates: "; foreach ($events->get_repeatSkipDates($_)){print "$_\n";} print "Repeat type: " . $events->get_repeatType($_) . "\n"; print "Repeat interval: " . $events->get_repeatInterval($_) . "\n"; print "Reminder: " . $events->get_reminder($_) . "\n"; print "Tags: "; foreach ($events->get_tags($_)){print "$_\n";} print "Start date: " . $events->get_startDate($_) . "\n"; print "Start time: " . $events->get_startTime($_) . "\n"; print "End date: " . $events->get_endDate($_) . "\n"; print "End time: " . $events->get_endTime($_) . "\n"; print "Is all day event: " . $events->get_isAllDayEvent($_) . "\n"; print "Notes: "; foreach ($events->get_notes($_)){print "$_\n";} print "Privacy: " . $events->get_privacy($_) . "\n\n"; } } else{ print "An error occured (" . $events->{'error_code'} . ": " . $events->{'error_msg'} . ")\n"; }
WebService::30Boxes::API
The following methods can be used
new create a new WebService::30Boxes::API object
new
The API key is required and this module will croak if you do not set one here. A fresh key can be obtained at http://30boxes.com/api/api.php?method=getKeyForUser
With this method, you can call one of the available methods as described on http://30boxes.com/api/.
call accepts a method name followed by a hashref with the values to pass on to 30Boxes. object.
call
It returns an object of type WebService::30Boxes::API::Event or WebService::30Boxes::API::Todo (depending which API method was called), which the user can then use to get the desired information.
Some API methods require authentication (permission by the user). This is done by sending the user to a specific URL where permission can be granted or denied. This method accepts a hashref with these three values:
(Mandatory) applicationName sets the well, application name you want to show to the user.
(Mandatory) The URI to your logo.
(Optional) This is where you want the user to return too after permission is granted.
http://30boxes.com/, http://30boxes.com/api/
WebService::30Boxes::API::Response
WebService::30Boxes::API::Event
WebService::30Boxes::API::Todo
30boxes.pl - this is a Perl script you can find on CPAN under Web that can be run in the terminal and it will display the events for a given period of time along with the Todo list. It takes command line arguments that specify how many days/weeks worth of events and how many todos will be displayed. I use it to display events and todos when I open my terminal. Send me an email with bugs or feature requests.
Add more error checking. Compact the code and make it more efficient. Please email me for feature requests.
Please email chitoiup@umich.edu with any bugs.
M. Blom (main functionality), <blom@cpan.org>, http://menno.b10m.net/perl/
Robert Chitoiu (integration with Event and Todo) <chitoiup@umich.edu>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install WebService::30Boxes::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::30Boxes::API
CPAN shell
perl -MCPAN -e shell install WebService::30Boxes::API
For more information on module installation, please visit the detailed CPAN module installation guide.