NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Same thing I posted earlier? (Score:2)
My starter script is also available in that earlier post for anyone who wants to help.
Re:Same thing I posted earlier? (Score:1)
#!/usr/bin/perl
use strict;
use Data::Dumper;
use Template;
use DateTime;
use Net::Google::Calendar;
my $url = "http://www.google.com/calendar/feeds/ngctmrd1cac35061mrjt3hpgng%40group.calend
my $cal = Net::Google::Calendar->new( url => $url );
my $dt = DateTime->now();
my @entries = ();
# Here, I want events that contain:
# YAPC, Workshop(s), Conference(s), Hackathon(s)
# Multiple hits to Google with get_events? Need to prevent dupes.
# Way to do it with one hit and and 'OR'?
foreach my $event ( $cal->get_events(
'q' => "YAPC",
'start-min' => $dt,
)
)
{
my $hash = {};
my $title = $event->title();
$hash->{title} = $event->title;
my $body = $event->content->body;
# warn $body, "\n\n\n";
$body =~ s/ /
# This stuff doesn't seem to work for the 'full' style feed.
# Need to figure out how to get these details out of the $event
# object we get back.
# Default something sensible if we get nothing.
$hash->{description} = do { $body =~ s/(?:
\s*)*Event Description:\s+(.*)\s*//; $1 };
$hash->{status} = do { $body =~ s/(?:
\s*)*Event Status:\s+(.*)\s*//; $1 };
$hash->{where} = do { $body =~ s/(?:
\s*)*Where:\s+(.*)\s*//; $1 };
$hash->{when} = do { $body =~ s/When:\s+(.*)\s*//; $1 };
$hash->{when} =~ s/
Replaces.*//;
push @entries, $hash;
}
print Dumper (\@entries);
Reply to This
Parent