Cal::DAV(3pm)

πŸ“¦
version 0.6 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– 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_USER
  • CAL_DAV_PASS
  • CAL_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 2007, Simon Wistow

Released under the same terms as Perl itself. πŸ’œ


🌈 SEE ALSO 🌈


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