Gruff is a new Ruby gem that allows you to make cool little Keynote-esque graphs, and it works nicely in Rails. So, I thought I might take the time to resurrect my old Morale-O-Meter (if you're reading this somewhere other than from my blog, you can see the graph here).
People are always asking me how they can get something like this to work on their site. Unfortunately, I haven't built this in a way is easily portable to other people's systems because instead of making it easy to port I've instead made it super easy for me to update. The main barrier for me to keep track of this data is laziness, so I have come up with a rather crazy system to make this all work. It goes something like this:
1) I purchased a copy of Moodstats. It's a cool desktop app (both PC and Mac friendly) that has a cool interface for scoring up to 6 dimensions on a 1-10 scale, and allows you to add short diary entries. Why use a desktop app? Well, first of all, I want the data to be private. Second, it's pretty. Third, it's fast.
2) However, since Moodstats doesn't let you choose all of the categories (it only gives you 3 configurable dimensions), I had to find a way to hack it. Luckily, it was easy since all of the configuration for the app is in a single xml file.
3) Not only is all of the configuration in an xml file, but all of the data is also stored in the xml file. Every day's morale, sleep, alcohol, and caffeine levels are in a single easy to access file. Yay! Now I just need to find a way to get it online.
4) Using iCal, Automator, and Transmit, I could schedule a daily event in iCal to upload the file to my server. This should be easier to do. Automator also then hits a page on my server that uses Rails and Gruff to generate the graph.
5) Add a simple image tag to my homepage and voila!
Even though this is a crazy setup, it's really pretty amazing that it all works together. If you think about it, all I'm doing is inputing data into a commercial app on my personal computer, and it magically gets stored in a readable format, uploaded to a remote server, triggers a script to generate an image, and displays on my blog. This is the weird world that we live in.
Incidentally, I'm doing something similar with Photo Booth and my built in iSight to take a picture of every day and have it uploaded automatically to the top right corner of my blog. I want to find a way to get my most played iTunes albums (in the last 30 days) in an easy format so I can display that on my blog too. Any ideas?
You could use the Audioscrobbler plug-in for iTunes, create an account at last.fm (it's free), and then use their web services to pull the info. They have ready-made feeds of your data including top artists, albums, tracks, etc. I haven't tried this myself but it seems possible.
Posted by: Carrick | Wednesday, 16 November 2005 at 09:24 AM
Hey Carrick, I didn't know about these web services! Very cool. Though, a few of them don't work. And I wish they would include amazon ASINs, but oh well. In any case, definitely something worth looking into.
Posted by: Erik Benson | Thursday, 17 November 2005 at 08:42 AM
> Even though this is a crazy setup
I think it's brilliant
Posted by: daniel | Thursday, 17 November 2005 at 05:34 PM
Make peace, not war!
Posted by: rillElece | Saturday, 12 January 2008 at 05:03 PM