[Remind-Fans] Adapting Remind's Display to NetNewsWire (OS X)?
Mike Harris
mjharris-lists at rcn.com
Thu Apr 7 23:26:55 EDT 2005
(4/7/05 10:53 AM) Chris Janton <face at CentosPrime.COM> wrote:
> Assume that you keep a calendar (see "man calendar") in your
> ~/.calendar folder
>
> Put the following script into a useful place on your system, do a
> "chmod +x" on it.
>
> Now point NNW to the script (you can change the number of days to look
> ahead as an argument)
>
> #----- cut here -----
> #!/usr/bin/perl
>
> use POSIX qw(strftime);
> use Date::Parse;
>
> $ndays = '14';
> if ($ARGV[0] != '') {
> $ndays = $ARGV[0];
> }
>
> $now = time();
> $cTime = strftime("%a, %e %b %Y %H:%M:%S %z", localtime($now));
>
> print '<?xml version="1.0" ?>' . "\n";
> print '<rss version="2.0" >' . "\n";
> print "<channel>\n";
> print "<title>Important Dates</title>\n";
> print "<description>My very own dates</description>\n";
> print "<language>en-us</language>\n";
>
> open(DATES, "calendar -W " . $ndays . "| ");
> foreach $line (<DATES>) {
> ($date, $text) = split('\t', $line);
> chop($text);
> $atime = str2time($date);
> $aRtime = strftime("%a, %e %b %Y %H:%M:%S %z",
> localtime($atime));
> print "<item>\n";
> print "<title>" . $text . "</title>\n";
> print "<pubDate>" . $aRtime . "</pubDate>\n";
> print "<description>" . $text . "</description>\n";
> print "</item>\n\n";
> }
> close(DATES);
> print "</channel>\n";
> print "</rss>\n";
> #---- end cut-here ----
>
> 8)
I thought I'd repost this to the remind-fans mailing list to see if any perl greats wanted to adopt it for remind. Essentially, this can be used with Mac OS X's NetNewsWire 2.0b's 'special subscription' function to thus display someone's Remind features in a NetNewsWire RSS feed.
I don't know as I'd strictly be USING this, mind you, but it'd be a neat (and I imagine popular) hack ...
Mike
More information about the Remind-fans
mailing list