RSS feed of Backpack reminders
Let me set the stage a little bit: I was playing around with 30 Boxes and I had an idea for how to create Backpack reminders via e-mail or SMS. I threw that together without too much hassle and I was feeling pretty good about myself.
So, a little later on, I was looking at 30 Boxes more in depth, and as I was contemplating ditching iCal I was thinking that one thing I would miss is my Backpack reminders being embedded into my calendar. Backpack lets you “subscribe” to your reminders as another calendar using the iCalendar format.
Lo and behold, I was poking around in the 30 Boxes settings when I discovered that it has the ability to display RSS feeds in an embedded manner in your calendar. It was at this point when the wheels started turning. ;)
So, I whipped up another little Rails app to serve my Backpack reminders as an RSS feed. I’ll admit it’s somewhat underwhelming to simply read this feed in your aggregator. But, if you plug it in to 30 Boxes, it’s pretty sweet.
How can I use this for myself?
Unlike my previous Backpack API hack, this one basically requires that you have a web hosting account with a provider that supports Ruby on Rails. If you’re in the market for one, I’ve been really happy with my experience at A Small Orange. I’ve also heard good things about Textdrive.
The other thing to watch out for here is security. You don’t want anyone who can guess the URL to be able to read the feed. So, I embedded a randomly generated security token in the URL that is “unguessable” for all intents and purposes. Also, I avoid storing that token in the source code in clear text by using a standard encryption algorithm. Just keep in mind you’ll need to deal with this.
To use this, the steps are more or less as follows:
- Download the Rails app (reminderfeed.zip, 64 KB).
- Edit the file
app/controllers/feed_controller.rbto include your Backpack username and API key. - Choose a security token to be embedded in your feed’s URL. In this example, let’s pretend it’s
mytoken. - Generate the SHA-1 hash of your security token using this Ruby script, and put this value in the appropriate spot on line 6 of
feed_controller.rb. - Upload the Rails app to your web host and test the URL. It should be something like
http://myhost.com/reminderfeed/feed?sectoken=mytoken.
That’s all there is to it.
How does this work?
The code here is so dead simple, it’s almost sample code. Go ahead and poke around in there if you’re interested in how it works…the files of interest are app/controllers/feed_controller.rb and app/views/feed/rss.rxml.
If you look at rss.rxml, you’ll notice that I ran into a time zone gotcha because my web host is in a different time zone then my Backpack. If anyone has suggestions on how to improve this, holla atchya boy.
So, what’s next?
Word on the street is that Backpack will grow a calendar of its own, and maybe I’ll be able to throw this code out the window. No biggie…it was still a good learning exercise and it took maybe an hour tops.
Comments
Please refer to this post instead.