I'm trying to access google calendars via the command line. I just want a list of events spat out.

I'm trying out Net::Google::Calendar with not much success. The documentation is creepy- the module has good reviews and it seems a lot of work was put into it.

use Net::Google::Calendar; use Smart::Comments '###'; my $c = Net::Google::Calendar->new; $c->login( $username, $password ); my @calendars = $c->get_calendars; # great, this works- it returns a 5 element list # this next line however.. my @e = $c->get_events; warn "ecount ".@e; ### @e for my $cal (@calendars){ printf "title %s, id %s\n", $cal->title, $cal->id; my @e = $cal->get_events; for (@e){ printf "event %s %s\n", $_->title, $_->content->body; } }

Im trying to get a list of events..

If I don't try to get_events() from the main calendar object created, it goes on fine to list title and id (private url) of each calendar.

As it is.. I get an error when I call get_events() 400 Bad Request at /usr/lib/perl5/site_perl/5.8.8/Net/Google/Calendar.pm line 577.

and then..

Argh.. anyhow.. I figure I must be using the interface wrong- Anyone know how to use the Net::Google::Calendar API?


In reply to Anyone know how to use the Net::Google::Calendar API? by leocharre

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.