August 2008
6 posts
4 tags
Mocking Kernel#require
The other day, I remembered to add coverage analysis to my AMEE-Ruby tests, using rcov. The results were pretty good - most of the code was already tested, except a few failure cases, and I quickly wrote some new tests to make sure those were working properly. One little bit of code stood out though. Because AMEE talks XML and JSON, my gem can use JSON, but only if the JSON gem is available on...
6 tags
CurrentCost data live on Pachube
So, the other day I got a nice little tray icon working for my CurrentCost power monitor. That’s great, but data is only really gets fun when it’s mashable, so the next step was to get it online somehow.
Pachube is a site which aggregates data feeds from real-world (and virtual-world) devices, shows them on a map, makes graphs, things like that, so it seemed like a good first...
4 tags
Some successful CurrentCost hacking
After a bit of work, I’ve finally got my CurrentCost meter working in Ruby, and I now have a power monitor sitting in my system tray! There were a few stages involved…
Serial comms: The ruby-serialport library that already existed for Ruby was no good to me. Firstly, it didn’t seem to be in a working state, but more importantly, the license it is under (GPL) is no good to...
6 tags
Twitter support in JabberStatus
JabberStatus was originally inspired by Twitter’s facility to update your status via XMPP/Jabber. Unfortunately, Twitter’s Jabber interface has been down for months now, which is rather sucky.
The solution to this? Extend JabberStatus to work for Twitter as well as Facebook. It turned out to be very easy, so it’s online now. Just add twitterstatus@jabber.org to your contact...
4 tags
One Hundred Months
I just saw the One Hundred Months campaign, and decided it was ripe for a bit of automated Twittering. So, 5 minutes hacking and we have One Hundred Months on Twitter. Code (as ever these days) is available from GitHub.
I’m amazed by what computers can do sometimes. This one seriously took me longer to publish to the world than to write.
7 tags
Hacking your energy usage with the CurrentCost
The other day, I managed to get hold of a CurrentCost energy monitor (available to buy from here, or maybe from your electricity supplier). Now, the nice thing about this particular monitor (apart from the ton of information on-screen) is the fact that it has a serial output on the bottom, which you can (with a bit of hacking) plug into your PC, and - bingo - lovely XML data!
However, once...