NAME
WebService::30Boxes::API::event - Perl accessor interface for the hash returned by WebService::30Boxes::API::call("events.Get)
SYNOPSIS
#$api_key and $auth_token are defined before my $boxes = WebService::30Boxes::API->new(api_key => $api_key);
my $result = $boxes->call('events.Get', {authorizedUserToken => $auth_token}); if($result->{'success'}){ my $events = WebService::30Boxes::API::event->new($result);
print "List start: " . $events->get_listStart . "\n";
print "List end: " . $events->get_listEnd . "\n";
print "User Id: " . $events->get_userId . "\n\n\n";
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 (" . $result->{'error_code'} . ": " .
$result->{'error_msg'} . ")\n";
}
DESCRIPTION
This module is provided for convenience
METHODS
The following methods can be used
new
Create a new WebService::30Boxes::API::event
object.
- result
-
(Mandatory) Result must be the return value of the call('events.Get') function.
get_eventIds
Returns an array of event ids.
You can then use this to call any of the following functions.
get_listEnd
Returns the end date of the list of events - yyyy-mm-dd.
get_listStart
Returns the start date of the list of events - yyyy-mm-dd.
get_userId
Returns the current user id.
get_repeatEndDate
Return the date when the recurring event stops repeating - yyyy-mm-dd. Returns 0000-00-00 if none. If an event spans over multiple days but it is not recurring, the final date will be returned.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_repeatSkipDates
Returns a list of the days that are skipped.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information
get_repeatType
Returns the repeat type for the event. Returns 'no' if none.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_repeatInterval
Returns the repeat interval for the event. This together with get_repeatType tell you all you need to know about how the event repeats.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_reminder
Returns the number of minutes before the event when the reminder will be sent. Returns -1 if no reminder.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_tags
Returns a list of tags.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_startDate
Returns the start date for the event - yyyy-mm-dd.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_startTime
Returns the start time for the event - hh:mm:ss.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_endDate
Returns the end date for the event - yyyy-mm-dd.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_endTime
Returns the end time for the event - hh:mm:ss.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_isAllDayEvent
Returns 1 if it is an all day event, 0 otherwise.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_title
Returns the title for the event. Returns 1 if it is an all day event, 0 otherwise.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_notes
Return the notes for the event in the form of a string. If the notes span over multiple lines, the order in which they are returned is undefined.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
get_privacy
Returns whether the event is shared or private. Return value is a string.
Arguments:
- eventId
-
(Mandatory) The eventId of the event for which you want to retreive the information.
TODO
BUGS
If the notes field for an event contains more than one line, the order of the lines in the returned string is undefined. This is because of the way XML::Simple parses the data returned by the 30Boxes API. There is nothing I can do about this.
Please notify chitoiup@umich.edu of any bugs.
SEE ALSO
http://30boxes.com/, http://30boxes.com/api/
AUTHOR
Robert Chitoiu, <chitoiup@umich.edu<gt>
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Robert Chitoiu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.