| BradTrupp.com - Little slices of my life and my projects | BradTrupp.com -- Tags -- Code |
| ||
BradTrupp.com -- Tags -- Code -- A Simple iCalendar to Task Coach Conversion Utility written in Ruby
A Simple iCalendar to Task Coach Conversion Utility written in Ruby
One product that I have recently started using to keep myself organized is Task Coach. Task Coach is a simple open source todo manager to manage personal tasks and todo lists. Being a work-in-progress, it is missing a number of features ( as of release 0.72.6 in April 2009 ) that I need. One is the ability to import tasks from other formats. It does however have a merge feature so you can combine tasks from other Task Coach files. In my case, I can export events in iCalendar format from Lotus Notes at work and Google Calendar for my personal schedule. Task Coach does not yet import "*.ics" or iCalendar format files. Instead I wrote a quick utility in Ruby to read in these files and write out a simple "*.tsk" task file -- that I can then merge in. The Utility -- ical2taskcoach.rb -- Note that this version only ports over the start and due dates, the title, and the description. It also reuses the UID (unique ID) from each iCalendar entry to populate the unique ID for each task entry -- so if your input file does not contain valid unique UID values then your resulting task file will likely not merge correctly.
The ".ics" extension on filename is optional. For example -- ical2taskcoach golfdates will convert golfdates.ics into golfdates.tsk. Files should be in the current working directory. I took the lazy approach on the output file and wrote out the XML tags directly instead of using a ruby gem to generate the xml.
Just run "ical2taskcoach.rb", start up task Coach, and merge the new task file into your existing task file. Remember, if you do not like the results of the merge then just cancel out of Task Coach without saving. Simple enough? The iCalendar gem -- The iCalendar gem provides an easy way to read in your iCalendar file.
More notes on the file format --
This line is included so Task Coach will have some clue as to which fields are valid. When I excluded this line completely, the description was not being imported since Task Coach was trying to maintain compatibility with an old file format where I guess description did not yet exist.
Code Snippets 1. ical2taskcoach.rb
Tags: Code Share: Del.icio.us | Digg | Facebook | Google Bookmarks | Reddit | Technorati | Twitter | Windows Live | Yahoo! My Web
|
|