Writing, publishing, geekdom, and errata.

BASH script to turn Remember The Milk's RSS Feed into plain text for ifttt

No comments
technology.pngI like Remember The Milk.  I like IFThisThenThat.  But there's no easy integration.  I hoped that maybe I could parse the RSS feed from Remember The Milk so that ifttt could use it...

I haven't succeeded that far - but I did manage to parse RTM's tasks into a plain text format, with comma separated values, dates, and links to the original task in a BASH script.  You can probably do something similar with VB, since the dependent items have all been ported or coded to Windows.  (Batch files don't support arrays, though.)

Why in BASH?  Two big reasons:

1. I'm not horribly familiar with Python, Ruby, Perl, etc.  I can teach myself them, but just haven't yet.
2. BASH is actually pretty easy to understand and read, even if you don't know a programming language while still supporting complex things like arrays. I'm hoping that new Linux users give these BASH scripts a shot, Mac users start exploring their shell, and that Windows users take more control of their machines.

It does require WGET, XMLStarlet, and SED.  My code is probably all kinds of kludgy, so feel free to point out where it can be done better in the comments.

Two notes:

1.  It's not completely done.  I mean, it's functional, but it's not a full-featured program.  Right now it outputs a list of all tasks after loading them in an array.  It only outputs the title, scheduled date of completion, and link.  Once it's in an array, you can do all sorts of stuff to the records - sorting, searching, etc.

2.  RTM's RSS feed (which is what I grab to do all of this) is ugly.  The description, note, date, priority, and tags are all in the description field.  The problem is twofold - the description field is HTML span tags, not XML; and the note field can contain newlines, which breaks the parser.  So with this version, notes on your tasks are actively truncated.

You can grab the BASH script at pastebin here.  Make sure you change the username and password appropriately!

No comments :