Hello Monks,

just registered to ask this question as I feel lost. I'm neither a programmer nor do I have the broad wisdom I'm searching for here.

As a small background:

We have a shift rooster whichs is changing quite often and is managed in an xlsx sheet. Now I figured out how to get all the data out of that Excel sheet and stored it in a hash of hashes.

As I thought it would be a good idea to have me and my colleagues sync their calendars on their phones or pads with a caldav server I am looking for a way how to push the gathered data into that calendar. I installed a Baikal server on one of my machines here which is already setup.

First thing im not aware of - what modules to use. I found http:dav, Data:iCal, Cal:DAV but none of them (or their description in cpan.org) shed a light on me how to use them. It seems I am even a lil too dumb to google it properly, so I hope for the wisdom of the perl monks.

What I have so far is just a simple:

my $user = "test"; my $pass = "test"; my $url = "http://baikal.local/cal.php/principals/test/testshift"; #my $url = "http://baikal.local/cal.php"; my $cal = Cal::DAV->new( user => $user, pass => $pass, url => $url); my $dav = $cal->dav; print Dumper($cal); print Dumper($dav);

which finally gives me only

$VAR1 = bless( { 'url' => 'http://baikal.local/cal.php/principals/test +/testshift', '_dav' => bless( { '_lockedresourcelist' => bless( { +'_resources' => undef }, + 'HTTP::DAV::ResourceList' ), '_comms' => bless( { '_headers' => + bless( {}, 'HTTP::DAV::Headers' ), '_user_agent' + => bless( { + 'max_redirect' => 7, + 'protocols_forbidden' => undef, + 'show_progress' => undef, + 'handlers' => { + 'response_header' => bless( [ + { + 'owner' +=> 'LWP::UserAgent::parse_head', + 'callbac +k' => sub { "DUMMY" }, + 'm_media +_type' => 'html', + 'line' = +> '/usr/share/perl5/LWP/UserAgent.pm:612' + } + ], 'HTTP::Co +nfig' ) + }, + 'no_proxy' => [], + 'protocols_allowed' => undef, + 'local_address' => undef, + 'use_eval' => 1, + 'requests_redirectable' => [ + 'GET', + 'HEAD' + ], + 'timeout' => 180, + 'def_headers' => bless( { + 'user-agent' => 'DAV.pm/v0.47' + }, 'HTTP::Headers' ), + 'proxy' => {}, + 'basic_authentication' => { + 'baikal.local:80' => { + + 'default' => [ + + 'test', + + 'test' + + ] + +} + }, + 'max_size' => undef + }, 'HTTP::DAV::UserAgent' ) }, 'HTTP::DAV:: +Comms' ) }, 'HTTP::DAV' ), '_auto_commit' => undef }, 'Cal::DAV' ); $VAR1 = bless( { '_lockedresourcelist' => bless( { '_resources' => und +ef }, 'HTTP::DAV::Resour +ceList' ), '_comms' => bless( { '_headers' => bless( {}, 'HTTP:: +DAV::Headers' ), '_user_agent' => bless( { 'max_r +edirect' => 7, 'proto +cols_forbidden' => undef, 'show_ +progress' => undef, 'handl +ers' => { + 'response_header' => bless( [ + { + 'owner' => 'LWP::UserAgent: +:parse_head', + 'callback' => sub { "DUMMY" + }, + 'm_media_type' => 'html', + 'line' => '/usr/share/perl5 +/LWP/UserAgent.pm:612' + } + ], 'HTTP::Config' ) + }, 'no_pr +oxy' => [], 'proto +cols_allowed' => undef, 'local +_address' => undef, 'use_e +val' => 1, 'reque +sts_redirectable' => [ + 'GET', + 'HEAD' + ], 'timeo +ut' => 180, 'def_h +eaders' => bless( { + 'user-agent' => 'DAV.pm/v0.47' + }, 'HTTP::Headers' ), 'proxy +' => {}, 'basic +_authentication' => { + 'baikal.local:80' => { + 'default' => [ + 't +est', + 't +est' + ] + } + }, 'max_s +ize' => undef }, 'HTTP +::DAV::UserAgent' ) }, 'HTTP::DAV::Comms' ) }, 'HTTP::DAV' );

On the Baikal Server the user test with password test is there and has a calendar created named testshift.

I found some sniplets in the web but none of them enabled me to understand HOW to add an entry. Most of them even only show how to write .ics files which I guess is not what io want.

Anyone ?

Thanks


In reply to Using Perl to add entries in iCal Calendar by hoschi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.