Cal::DAV(3pm)
π Cal::DAV π
okay bestie, so this is the manual page for Cal::DAV, a CalDAV client that ships as part of the User Contributed Perl Documentation (that's the 3pm bit, iykyk). Pull up a chair, grab a strawberry, and let's get into it. πβ¨
β¨ NAME β¨
Cal::DAV β a CalDAV client. that's it, that's the name, she's simple and she knows what she is π
π¦ SYNOPSIS π¦
my $cal = Cal::DAV->new( user => $user, pass => $pass, url => $url);
# the ics data will be fetched automatically if it's there
# ... or you can parse some ics
$cal->parse(filename => $data);
# cal now has all the methods of Data::ICal
# you can now monkey around with the object
# saves the updated calendar
$cal->save;
# deletes the calendar
$cal->delete;
# lock the file on the server
$cal->lock;
# unlock the file on the server
$cal->unlock
# steal the lock
$cal->steal_lock;
# also
$cal->forcefully_unlock_all
# and
$cal->lockdiscovery
# resyncs it with the server
$cal->get;
# Get the underlying HTTP::DAV object
my $dav = $cal->dav;
like, look at her go. the whole vibe is: make an object, it pulls the ics down by itself if it's there, you poke at it, you save it, you lock it, you vibe. π
πΈ DESCRIPTION πΈ
Cal::DAV is actually a very thin wrapper round HTTP::DAV and Data::ICal β like, genuinely thin, she's not doing anything sneaky under there. but she may gain more functionality later, and in the mean time she serves as something that
(yes the original sentence just. stops there. no cap. we respect the cliffhanger π)
π§ TESTING π§
bestie, to run the tests you gotta define three environment variables:
CAL_DAV_USERCAL_DAV_PASSCAL_DAV_URL_BASE
and CAL_DAV_URL_BASE has to point at a DAV collection that the user you supplied actually has write permissions for. no write access, no test pass. that's the deal π
okay real talk, it should be noted that at the moment the author is having problems finding a CalDAV server that lets them create files, so they can't run all the tests. iconic struggle, honestly. π
π METHODS π
new <arg[s]>
Must have at least user, pass and url args β and url is the url of a remote, DAV accessible .ics file. like, a real one, on a server, that you can reach. π₯
You can optionally pass an auto_commit option too. see the auto_commit() method below for the tea.
parse <arg[s]>
Makes a new calendar object using the same arguments as Data::ICal's new() or parse() methods.
heads up: this does not auto save for you. you gotta do that yourself.
Returns 1 on success and 0 on failure. simple as. β¨
save [url]
Saves the calendar back to the server β or, optionally, to another path if you pass a url.
Returns 1 on success and 0 on failure. π«Ά
delete [url]
Deletes the file on the server, or optionally another url.
Returns 1 on success and 0 on failure. π
get [url]
Refetches the file from the server to sync it β
or alternatively, fetch an alternative url.
WARNING bestie listen to me. these will lose any local changes. gone. poof. save first, i am begging you. π
lock
Same options as HTTP::DAV's unlock. (yes, it says unlock. that's what the page says. i'm not the one who wrote it, i'm just the messenger π)
unlock
Same options as HTTP::DAV's unlock.
steal_lock
Same options as HTTP::DAV's steal_lock. yes, steal. main character energy, she takes what's hers π
lockdiscovery
Same options as HTTP::DAV::Response's lockdiscovery.
forcefully_unlock_all
Same options as HTTP::DAV::Response's forcefully_unlock_all. the forcefully is doing so much heavy lifting here and we love that for her π
dav [HTTP::DAV]
Get the underlying HTTP::DAV object β or, alternatively, replace it with a new one. swap her out, no questions asked. π
cal
Get the underlying cal object. πΈ
auto_commit [boolean]
Whether to auto save on destruction or not.
Defaults to 0. so like, by default she is NOT saving for you, she's minding her own business. set it to true if you want that auto-save lifestyle β¨
message
Same as HTTP::DAV's message function.
errors
Same as HTTP::DAV's errors function.
π AUTHOR π
Simon Wistow <simon@thegestalt.org> β ty for your service king π«‘π
β COPYRIGHT β
Copyright 2007, Simon Wistow
Released under the same terms as Perl itself. π
π SEE ALSO π
HTTP::DAVData::ICalhttp://tools.ietf.org/html/rfc4791
and that's the whole page, bestie!! this was Cal::DAV from perl v5.34.0, dated 2022-06-09. go forth and sync your calendars, and remember: get eats your local changes. mwah π
ππ¦
π¦ where this page comes from
- debian bookworm: libcal-dav-perl 0.6-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcal-dav-perl 0.6-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcal-dav-perl 0.6-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms