Charlie Harvey

Getting Chandler Hub to send a daily agenda by email

I think that the OSAF's Chandler project is awesome and I’ve been using Chandler to organise my life for a while now. But one feature it was lacking was a daily email agenda update. Here's how I hacked one in perl. The code is at:

The first thing was to be able to pick up some vaguely parseable version of my do list. I used LWP::UserAgent to pick up an iCal version of my todo feed. That goes a bit like this. Note that we're picking this up over https. There's nothing very interesting in my do list, but I try and encrypt everything out of principle.

my $browser = LWP::UserAgent->new; $browser->credentials( 'hub.chandlerproject.org:443', 'Chandler Server', $user => $pass, );

SNIP

$browser->get($ical_url, ':content_file' => $file); die "Can't retrieve ical" unless -e $file;

Next, I need to make it into something a little more perl-ish. Well perl hackers, rather than saying there's an app for that say there's a CPAN module for that. And there is. iCal::Parser parses my iCalendar file into a nice perl-ish data structure.

my $parser = iCal::Parser->new(start=>$start, end=>$end ); my $cal = $parser->parse($file); my $events = $cal->{events}->{$start->year}->{$start->month}->{$start->day}; my $todos = $cal->{todos};

And that said Charlie is that. Well there's a bit of faffling to format the email and such. Check out the code for more info.

PS. For those of you who like cheesey videos, here's the three minute tour of Chandler:


Comments

  • Be respectful. You may want to read the comment guidelines before posting.
  • You can use Markdown syntax to format your comments. You can only use level 5 and 6 headings.
  • You can add class="your language" to code blocks to help highlight.js highlight them correctly.

Privacy note: This form will forward your IP address, user agent and referrer to the Akismet, StopForumSpam and Botscout spam filtering services. I don’t log these details. Those services will. I do log everything you type into the form. Full privacy statement.