[Ruby] GroupWise export to iCal

UPDATE: I’ve posted a more complete version of this code in More Ruby Exporting of Groupwise to iCal.

I’ve wanted to export my Groupwise calendar to iCal format for a long time. Every time I try to do it, I ended up running into the same few pages. They sorta worked, but were clumsy.

So I threw this little beauty together in under 10 minutes and 2 google searches. It seems to be a start, though I expect to improve it. Groupwise Object API Docs (PDF format; the web version keeps blinking — arrrgh) from Novell were useful, as was this Ruby gem.

require win32ole
require icalendar

groupwise = WIN32OLE.new(NovellGroupWareSession)
# 2nd arg is not password, so leave blank
account = groupwise.Login(your-username, )
path_to_host = account.PathToHost
cal = Icalendar::Calendar.new
account.Calendar.Messages.each do |message|
  next unless message.ClassName == GW.MESSAGE.APPOINTMENT
  event = cal.event  # This automatically adds the event to the calendar
  event.user_id = tims@asrs.state.az.us
  event.timestamp = DateTime.now
  event.summary = message.subject.PlainText
  event.description = message.BodyText.PlainText
  event.start = message.StartDate
  event.end = message.EndDate
end

puts cal.to_ical

Every day I find more reasons to love using Ruby. Enjoy!

Setting up Basecamp

I’ve been on the mailing list for Basecamp for a year, and I’ve never tried it out. They recently sent an email about a free todo list web application based on their Basecamp site. I tried out the todo list, and decided it was worth setting up a simple project with their free Basecamp profile.

So far, it looks promising. I like the fact that they charge per project and not per person. I also like that they allow you to export the project milestones in iCal format. My wife uses a Mac, and I use a PC with Firefox browser on either Linux or Windows.