RSS feed of Backpack Reminders

I thought it might be fun to get my Backpack Reminders syndicated as an RSS feed, for easy sharing outside of a calendar. So, I whipped up a little Rails app to do just that.

How can I use this for myself?

This 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 Joyent.

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 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.

To use this, the steps are more or less as follows:

  1. Download the Rails app.
  2. Edit the file app/controllers/feed_controller.rb to include your Backpack username and API key.
  3. Choose a security token to be embedded in your feed’s URL. In this example, let’s pretend it’s mytoken.
  4. Generate the SHA-1 hash of your security token. On a Mac, this can be done in Terminal with echo -n mytoken | openssl dgst -sha1. Put this value in the appropriate spot on line 6 of feed_controller.rb.
  5. Change the text blurbs in app/views/feed/rss.rxml to pretty-up the display of the feed.
  6. Upload the Rails app to your web host and test the URL. It should be something like http://myhost.com/reminderfeed/feed?sectoken=mytoken.

How does this work?

The Backpack API makes it a breeze to access your reminders in Ruby, and Rails makes it easy to serve an RSS feed. This is basically the minimum amount of glue need to connect the two. If you’d like more details, 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, please leave a comment and get in touch.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s