[Remind-Fans] Improved ical2rem script available, prototype sms2rem code available
Mark Stosberg
mark at summersault.com
Tue Mar 20 21:19:54 EDT 2007
Hello,
I'm trying out remind and wyrd. As part of this, I improved the
"ical2rem" script and published the result here:
http://wiki.43folders.com/index.php/ICal2Rem
Here's an example of how I use it now, showing off some of the new
options available:
wget -O- http://...cal.ics | \
ical2rem --no-todos --lead-time 0 --label Work>~/.remind/work.txt
I also wanted to bring to remind two of the features I love about Google
Calendar:
1. natural language date parsing for event entry (wyrd has this, but not
from the command line)
2. Ability to add events from a cell phone
So, I can send a text messages to Google calendar that says
"tommorrow noon. Lunch with Bob"
And it adds the event and replies with an message showing the date and
title it derived from my message.
Today I scheduled a meeting the same way, using my cell phone and
remind. :)
Since "wyrd --add" doesn't already work, I used a natural language date
parser written in Perl, DateTime::Format::Natural, on CPAN. Some of you
may appreciate that it supports German as well as English.
The SMS part was actually trivial, since like many phones, there is an
SMS/email gateway built-in, with no extra "data" charges.
So, I just setup a secret email address that forwarded the mail on to a
Perl script. It process the mail easily using "Mail::Audit".
Because it's small enough, I'll just point the few lines of the
Mail::Audit script I have that handles receiving the message, adding the
actual reminder, and replying with a success message.
Perhaps I'll continue to work on this to develop a more re-usable
"sms2remind" script. I'd like to eventually support Google Calender's
other SMS features: reminders via SMS, "next", "day" and
"nday" (details, here:
http://www.google.com/support/calendar/bin/answer.py?answer=37228 ).
I'm also considering using the same concepts to support adding a new
entry to an "ics" file via SMS as well, which would be useful for
several other calendar programs.
Mark
# An address meant to be used via SMS.
# Accepts a natural language date followed by a period and an event
description.
# Writes the result to .reminders and replies with a success msg.
if ($m->to eq 'mysecretaddy at mydomain.com') {
require DateTime::Format::Natural;
my ($date,$msg) = split '\.', $m->body;
$date ||= '';
$msg ||= '';
$m->reply(body => "no date found") unless length $date;
chomp $date;
chomp $msg;
my $dt = DateTime::Format::Natural->new->parse_datetime(string =>
$date);
# REM Mar 7 2007 +0 AT 13:00 MSG %a %2 %"Training%"%
my $rem_line = sprintf ("REM %02s %02s %4s AT %02s:%02s",
$dt->month_abbr, $dt->day, $dt->year, $dt->hour, $dt->min)
.qq{ MSG %a %2 %"$msg%"%\n};
open(REMIND, ">>/home/mark/.reminders");
print REMIND $rem_line;
close(REMIND);
$m->reply(body => "added: $rem_line");
}
More information about the Remind-fans
mailing list