<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>James Smith - Main</title>
  <id>tag:www.floppy.org.uk,2010:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://www.floppy.org.uk/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.floppy.org.uk/" rel="alternate" type="text/html"/>
  <updated>2009-12-17T14:26:10Z</updated>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2009-12-17:1187</id>
    <published>2009-12-17T14:17:00Z</published>
    <updated>2009-12-17T14:26:10Z</updated>
    <category term="amee"/>
    <category term="ecomo09"/>
    <category term="greasemonkey"/>
    <link href="http://www.floppy.org.uk/2009/12/17/my-ecomo09-google-maps-hack" rel="alternate" type="text/html"/>
    <title>My EcoMo09 Google Maps Hack</title>
<content type="html">
            &lt;p&gt;
In early September, &lt;a href=&quot;http://www.betavine.net/bvportal/community/sustainability&quot;&gt;Betavine&lt;/a&gt; organised a 24-hour hack event called &lt;a href=&quot;http://www.vimeo.com/6623187&quot;&gt;EcoMo09&lt;/a&gt;, with an environmental theme. Unfortunately I couldn't stay the whole time, but I went along as an &lt;a href=&quot;http://www.amee.com&quot;&gt;AMEE&lt;/a&gt; representative to support other people using our API during the event. In the quiet periods, I managed to come up with my own hack, which used GreaseMonkey and AMEE to add carbon emissions to Google Maps.
&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://vimeo.com/6907428&quot;&gt;AMEE-Google Mashup Greasemonkey script by James Smith&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user2311507&quot;&gt;Carbon Tippy Toes&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
You can even &lt;a href=&quot;http://gist.github.com/185744&quot;&gt;get the code&lt;/a&gt; and try it yourself. It's very basic, and actually most of the work was dealing with Google Maps and making Greasemonkey behave properly - the AMEE bit, getting the carbon value, was dead easy.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2009-11-10:1173</id>
    <published>2009-11-10T09:37:00Z</published>
    <updated>2009-11-10T09:45:53Z</updated>
    <category term="activism"/>
    <category term="geeks"/>
    <category term="philosophy"/>
    <link href="http://www.floppy.org.uk/2009/11/10/activist-geek-philosophy" rel="alternate" type="text/html"/>
    <title>The Activist Geek Philosophy</title>
<summary type="html">&lt;p&gt;
On my old blog, I used to write about more political subjects; war, ID cards, etc. This one has, to date, been mostly all about technical subjects - most of my political comment goes on &lt;a href=&quot;http://twitter.com/Floppy&quot;&gt;Twitter&lt;/a&gt; instead. However, after a conversation recently with my colleague &lt;a href=&quot;http://agoodgeek.blogspot.com/&quot;&gt;James H&lt;/a&gt;, there are some questions I'd like to present and invite comment on. They aren't about particular issues or party politics, but instead about something I feel is above that. The question is:
&lt;/p&gt;
&lt;p&gt;
Is there a unifying philosophy within the community I work in (a certain subset of the &quot;geek&quot; community), and if so, what are its core tenets?
&lt;/p&gt;
&lt;p&gt;
I'm sure this has been written about many times before, but I want to clarify it in my own head (rather than simply reading what others have written), and invite help from whoever may read this.
&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;
On my old blog, I used to write about more political subjects; war, ID cards, etc. This one has, to date, been mostly all about technical subjects - most of my political comment goes on &lt;a href=&quot;http://twitter.com/Floppy&quot;&gt;Twitter&lt;/a&gt; instead. However, after a conversation recently with my colleague &lt;a href=&quot;http://agoodgeek.blogspot.com/&quot;&gt;James H&lt;/a&gt;, there are some questions I'd like to present and invite comment on. They aren't about particular issues or party politics, but instead about something I feel is above that. The question is:
&lt;/p&gt;
&lt;p&gt;
Is there a unifying philosophy within the community I work in (a certain subset of the &quot;geek&quot; community), and if so, what are its core tenets?
&lt;/p&gt;
&lt;p&gt;
I'm sure this has been written about many times before, but I want to clarify it in my own head (rather than simply reading what others have written), and invite help from whoever may read this.
&lt;/p&gt;
&lt;p&gt;
So, first, let's have a stab at identifying the community I'm talking about - this in itself is a pretty hard problem. I guess I'm talking about &quot;activist geeks&quot;, in a way. The sort of people who are involved in the work of &lt;a href=&quot;http://mysociety.org&quot;&gt;MySociety&lt;/a&gt;, or &lt;a href=&quot;http://www.sicamp.org/&quot;&gt;Social Innovation Camp&lt;/a&gt;. The people who go along to events like &lt;a href=&quot;http://www.geekyoto.com/&quot;&gt;geeKyoto&lt;/a&gt;, or perhaps &lt;a href=&quot;http://russelldavies.typepad.com/planning/2009/08/interesting-speakers.html&quot;&gt;Interesting&lt;/a&gt;. They are the people that go out and create innovative things that make the world better. I can't put any names on a list here, though there are some obvious ones of course, but you will probably know if this is your sort of community or not.
&lt;/p&gt;
&lt;p&gt;
So having made a (very) vague stab at who I'm talking about, what are the core philosophies that come out of that? One caveat: obviously this is  my own personal viewpoint, and implies absolutely nothing on behalf of those examples linked above. I could be completely wrong on all of this (though I'd invite comment). I think I am what would traditionally be called &quot;left wing&quot;, so my please note that my views may be coloured by that.
&lt;/p&gt;
&lt;p&gt;
Firstly, I think that while there are certain things that do unite the community, they often don't fit along traditional political lines. You cannot say that this community is left-wing for instance; there are certainly members of all political parties involved. We'll come back to some of the things that &lt;em&gt;don't&lt;/em&gt; unite us later on, but let's find some common ground first.
&lt;/p&gt;

&lt;dt&gt;&lt;b&gt;Privacy&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
Even though many of us share vast amounts of information on various social networks, we have a strong belief in privacy of personal data. Perhaps this is better phrased as belief in &lt;em&gt;control&lt;/em&gt; of personal data. I can delete my social network accounts at any time, and can decide who can see them, so I remain in control (as long as I trust the site). On the other side, I will not be able to remove my record from the ID card database or decide who accesses it, so I am not in control of that. This is part of a more fundamental belief in &lt;a href=&quot;http://www.un.org/en/documents/udhr/&quot;&gt;universal human rights.&lt;/a&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Transparency&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
While personal information should be kept tightly controlled by its owner, information about (and generated by) government and public services should be fully transparent and open. The MP expenses scandal was an example of further erosion of trust in government because of an opaque system that was open to abuse. As they say (I think), sunlight is the best disinfectant. Government operations should be open to public scrutiny, and assets produced by that system (OS maps anyone?) should be freely available to the taxpayers who have paid for them.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Tolerance&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
I don't think we give a monkeys where someone is from, what their background is, or about their religion, sexuality, or favourite colour. It's just not relevant. The rest of you, get over it.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Anti-authoritarian&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
It always confuses me that a criticism of the left is that it wants to control people. Maybe that's true, in which case I need to recalibrate my open personal compass a little, but my belief is that the community is very much about freedom of the individual. There is a strong anti-authoritarian streak - none of us want to end up in a police state.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Social Conscience&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
However, the above freedom of the individual does not lead to blind self-interest. I believe that the community is not one of self-interested people with no care for others, but of a group of empowered individuals who actively engage in and make society better.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Engagement&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
My final point is that the above lead to a community that is engaged with the world around them. We engage on issues of importance, such as my own personal focus, climate change, and they are interested in the way their society is governed. I believe that those qualities are fundamental for a functioning democracy, and we see that currently most of society does not measure up to that standard (a situation which we try to improve of course).
&lt;/dd&gt;

&lt;p&gt;
On the other hand, I seriously doubt we are all united on things like &lt;a href=&quot;http://s.wsj.net/public/resources/images/OB-AO890_invisi_20070824192939.jpg&quot;&gt;economics&lt;/a&gt; (I love that picture), the role of corporations, how to deal with climate change, foreign policy, and so on.
&lt;/p&gt;
&lt;p&gt;
I'm sure there is more that can be said, but I will let it play out in the comments (if anyone wants to add to this). My final question is - if there is a central theme emerging, does that mean we should do something with it in these days when so many of the above viewpoints are rather missing from general society?
&lt;/p&gt;
&lt;p&gt;
Discuss.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2009-10-28:1168</id>
    <published>2009-10-28T17:58:00Z</published>
    <updated>2009-10-28T18:24:25Z</updated>
    <category term="amee"/>
    <category term="articles"/>
    <category term="currentcost"/>
    <category term="developerworks"/>
    <link href="http://www.floppy.org.uk/2009/10/28/ibm-developerworks-articles" rel="alternate" type="text/html"/>
    <title>IBM DeveloperWorks articles</title>
<content type="html">
            &lt;p&gt;
Over the summer, I was asked to write an article for the IBM &lt;a href=&quot;http://www.ibm.com/developerworks/&quot;&gt;DeveloperWorks&lt;/a&gt; site about energy monitoring and so on. Eventually, that turned into a series of articles centered around &lt;a href=&quot;http://www.amee.com&quot;&gt;AMEE&lt;/a&gt; and how you can track energy consumption and calculate carbon emissions with it.
&lt;/p&gt;
&lt;p&gt;
So, now that they're all published, here's a bit of a linkdump to the various articles and other things that came out of them.
&lt;/p&gt;

&lt;dt&gt;
&lt;a href=&quot;http://www.ibm.com/developerworks/xml/library/x-ameeintro/&quot;&gt;Introduction to AMEE&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
This is a technical introduction to the AMEE platform, how it works, and what you can do with it. It covers things like signing up, creating profiles, storing data, and getting results. It was also adapted into a screencast for the &lt;a href=&quot;http://my.amee.com/developers&quot;&gt;AMEE developer site&lt;/a&gt;.
&lt;/dd&gt;
&lt;dt&gt;
&lt;a href=&quot;http://www.ibm.com/developerworks/opensource/library/os-green-ict/index.html?S_TACT=105AGX44&amp;amp;S_CMP=HP&quot;&gt;Calculate your computer's carbon footprint using AMEE&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
This one is an introduction to the wide variety of ways in which you can track energy data using AMEE, using the monitoring of computer energy use as a case study. It also shows some code examples for the &lt;a href=&quot;http://github.com/Floppy/amee-ruby&quot;&gt;AMEE ruby gem&lt;/a&gt;.
&lt;/dd&gt;
&lt;dt&gt;
&lt;a href=&quot;http://www.ibm.com/developerworks/xml/tutorials/x-ameetut/index.html&quot;&gt;Monitor home energy with AMEE&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
This is my favourite of the three - a long tutorial, with lots of code, which shows a complete implementation of an online energy-monitoring system, using a &lt;a href=&quot;http://www.currentcost.com&quot;&gt;CurrentCost&lt;/a&gt; display, AMEE, and a little Rails code. This uses a lot of the open source software I've been writing over the last year, which regular readers will have seen in previous posts, but it's really nice to tie it all together and tell the world how it works!
&lt;/dd&gt;
&lt;dt&gt;
&lt;a href=&quot;https://www.ibm.com/developerworks/mydeveloperworks/blogs/scott/entry/james_smith_on_embedding_environmental_intelligence&quot;&gt;James Smith on embedding environmental intelligence&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
Scott Laningham was nice enough to interview me for the DeveloperWorks podcast when the first article went out, so if you want to hear me blathering on about it in person, you can do so!
&lt;/dd&gt;

          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2009-07-08:1136</id>
    <published>2009-07-08T09:17:00Z</published>
    <updated>2009-07-08T09:23:21Z</updated>
    <category term="currentcost"/>
    <category term="energy"/>
    <category term="homecamp"/>
    <category term="reboot britain"/>
    <category term="slides"/>
    <category term="talks"/>
    <link href="http://www.floppy.org.uk/2009/7/8/reboot-britain" rel="alternate" type="text/html"/>
    <title>Reboot Britain</title>
<content type="html">
            &lt;p&gt;
I was lucky enough to be invited to talk at the &lt;a href=&quot;http://www.rebootbritain.com&quot;&gt;Reboot Britain&lt;/a&gt; conference on Monday. It was a fascinating day, with lots of inspiring moments. It left me with a feeling that we can make the world a better place if we all get out there and &lt;b&gt;make&lt;/b&gt; things. It's something I already believed, but it's great to have a recharge every now and again.
&lt;/p&gt;
&lt;p&gt;
My session was on hacking energy data, kind of a &lt;a href=&quot;http://homecamp.org.uk&quot;&gt;Homecamp&lt;/a&gt; intro for the uninitiated. My slides are up on &lt;a href=&quot;http://www.slideshare.net/Furtive&quot;&gt;Slideshare&lt;/a&gt;, and embedded here for your viewing pleasure. Hopefully at some point I'll get to re-record the audio and add it in.
&lt;/p&gt;
&lt;div&gt;&lt;a href=&quot;http://www.slideshare.net/Furtive/if-you-can-see-it-you-can-change-it&quot; title=&quot;If you can see it, you can change it&quot;&gt;If you can see it, you can change it&lt;/a&gt;&lt;div&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot;&gt;documents&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/Furtive&quot;&gt;James Smith&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2009-05-21:1125</id>
    <published>2009-05-21T20:38:00Z</published>
    <updated>2009-05-21T20:44:55Z</updated>
    <category term="carbondiet"/>
    <category term="github"/>
    <category term="open source"/>
    <link href="http://www.floppy.org.uk/2009/5/21/the-carbon-diet-goes-open-source" rel="alternate" type="text/html"/>
    <title>The Carbon Diet goes open source</title>
<content type="html">
            &lt;p&gt;
Well, I finally got round to it. I started developing &lt;a href=&quot;http://www.carbondiet.org&quot;&gt;The Carbon Diet&lt;/a&gt; 2 years ago (had the idea 3 years ago!), and it's finally spread it's wings and joined the world of open source. 
&lt;/p&gt;
&lt;p&gt;
After I'd been developing it for a few months, it became obvious that it was never going to be a commercial proposition, so it's been my intention to open it up for a very long time now. However, I was putting it off until &quot;after I get it finished&quot;, or &quot;after I tidy up the code&quot;, or any number of other reasons. Having a small child puts paid to all those plans, so I've finally bitten the bullet and released my dodgy code to the world as it is, warts and all.
&lt;/p&gt;
&lt;p&gt;
The site is built in Rails, but it's pretty creaky. It was originally written in version 1.2 as I was learning, and a lot of the old-style controller and route code is still hanging around, waiting to be improved. I've started, but there is a long way to go to bring it up to a decent standard.
&lt;/p&gt;
&lt;p&gt;
Anyway, if you use the site (or not!) and fancy improving it, now you can. Head on over to &lt;a href=&quot;http://github.com/Floppy/carbon-diet&quot;&gt;github&lt;/a&gt; to grab the code and join in. I hope to see you there!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2009-03-28:1114</id>
    <published>2009-03-28T16:18:00Z</published>
    <updated>2009-03-28T16:38:08Z</updated>
    <category term="amee"/>
    <category term="carbondiet"/>
    <category term="currentcost"/>
    <category term="pachube"/>
    <category term="ruby"/>
    <category term="twitter"/>
    <link href="http://www.floppy.org.uk/2009/3/28/publishing-currentcost-data-to-the-world" rel="alternate" type="text/html"/>
    <title>Publishing CurrentCost data to the world</title>
<content type="html">
            &lt;p&gt;
A while ago, I started hacking around with a &lt;a href=&quot;http://www.currentcost.co.uk&quot;&gt;CurrentCost&lt;/a&gt; real-time energy monitor. This is a very nice little device that measures your electricity use, but more importantly has a serial output on the bottom so you can get data out of it.
&lt;/p&gt;
&lt;p&gt;
Well, eventually I decided that while being able to get data off the meter was nice, it would be better if I could publish it somewhere. So, I wrote a program in Ruby to do exactly that. It reads data from the meter, and sticks it on the web. I'll go into a bit more detail in a minute, but first, you can download it (and get the source code) from &lt;a href=&quot;http://github.com/Floppy/currentcost-daemon/&quot;&gt;github&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
The program operates as a system daemon, which runs in the background on your Linux box (Mac should work as well) and uploads to various places. Adding new publishers is dead easy, so if you want to publish your data somewhere else, you can easily add it.
&lt;/p&gt;
&lt;h3&gt;The Carbon Diet&lt;/h3&gt;
&lt;p&gt;
First up, my own site, &lt;a href=&quot;http://www.carbondiet.org&quot;&gt;The Carbon Diet&lt;/a&gt;. This uploads your daily usage history from the meter into your carbon diet account so that you don't have to take so many meter readings to get an accurate graph. This is still pretty experimental and needs more work, but it's pretty useful already. You can see how it looks on &lt;a href=&quot;http://www.carbondiet.org/profile/james&quot;&gt;my profile&lt;/a&gt;.
&lt;/p&gt;
&lt;h3&gt;AMEE&lt;/h3&gt;
&lt;p&gt;
Next, what I think of as the important one. &lt;a href=&quot;http://www.amee.com&quot;&gt;AMEE&lt;/a&gt;, if you're not aware, AMEE is a neutral aggregation platform for sharing energy data and carbon calculations (disclaimer: I work for them these days). Think OpenID for your energy identity. Anyway, we have a nice &quot;smart meter&quot; demo which uses my currentcost app as the data source. Every minute, it uploads into an AMEE profile, and then another app &lt;a href=&quot;http://my.amee.com/demo/1&quot;&gt;makes a nice graph&lt;/a&gt; of the CO2 produced. In theory, the Carbon Diet could pull that data from AMEE instead of me publishing it directly, but that's still to come.
&lt;/p&gt;
&lt;h3&gt;Pachube&lt;/h3&gt;
&lt;p&gt;
Another energy data sharing service is &lt;a href=&quot;http://www.pachube.com&quot;&gt;Pachube&lt;/a&gt; (pronounced &quot;patch bay&quot;). As far as I can tell, this is more geared at art and design than rigorous data, but it's fun to play with. They've done a bunch of stuff with the CurrentCost, and now my app joins the throng. My &lt;a href=&quot;http://www.pachube.com/feeds/488&quot;&gt;pachube feed&lt;/a&gt; updates every 6 seconds - every time the meter sends data out.
&lt;/p&gt;
&lt;h3&gt;Twitter&lt;/h3&gt;
&lt;p&gt;
Finally, what would be the point of a web energy publisher if it couldn't tweet? If you really want to, you can see my minute-by-minute energy usage on Twitter by visiting &lt;a href=&quot;http://twitter.com/james_energy&quot;&gt;@james_energy&lt;/a&gt;.
&lt;/p&gt;
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-11-04:393</id>
    <published>2008-11-04T22:52:00Z</published>
    <updated>2008-11-05T09:56:02Z</updated>
    <category term="mephisto"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://www.floppy.org.uk/2008/11/4/running-mephisto-on-ruby-1-8-7" rel="alternate" type="text/html"/>
    <title>Running Mephisto on Ruby 1.8.7</title>
<content type="html">
            &lt;p&gt;
My server runs Ubuntu, and seeing as 8.10 (Intrepid Ibex) is out, I thought &quot;woo, let's upgrade&quot;. Bad idea. Well, partly. Most of the upgrade went fine, but there was one problem. Intrepid comes with Ruby 1,8.7, which works fine with Rails &gt;=2.1, but doesn't work with anything lower. Mephisto, on the other hand, doesn't work with Rails 2.1 yet, and is only usable with Rails &amp;lt;=2.0.2. So, you get an error starting Mephisto that looks like this:
&lt;/p&gt;

&lt;p&gt;
So, I was faced with having to downgrade to Ruby 1.8.6 (a royal pain as Intrepid doesn't provide packages for it), or &quot;fix&quot; Mephisto to work with 2.1 (oh my god, don't even get me started). Fortunately, another solution presented itself.
&lt;/p&gt;
&lt;p&gt;
I came across &lt;a href=&quot;http://bicosyes.com/rails-2-1-con-ruby-1-8-7-broken/&quot;&gt;this blog post&lt;/a&gt; which describes the problem I was having. The gist (it's in Spanish) is that the main problem with Rails 2.0.2 and Ruby 1.8.7 is that Ruby 1.8.7 has added a String#chars function to the core language. Rails also adds this function, but the two have different return types, hence causing much breakage. The solution? Remove Ruby's String#chars and let Rails do its thing. Add this code to an initializer in your Rails 2.0.2 app, and it will work (better, at least) with Ruby 1.8.7.
&lt;/p&gt;
&lt;p&gt;
&lt;pre class=&quot;zenburnesque&quot;&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;begin&lt;/span&gt;
  &lt;span class=&quot;LibraryClassType&quot;&gt;String&lt;/span&gt;.&lt;span class=&quot;FunctionName&quot;&gt;class_eval&lt;/span&gt; { remove_method &lt;span class=&quot;UserDefinedConstant&quot;&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;:&lt;/span&gt;chars&lt;/span&gt; }
&lt;span class=&quot;LanguageKeyword&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;NameError&lt;/span&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
As you can tell by the fact that you're reading this blog, it works a treat. Hurrah!
&lt;/p&gt;
&lt;p&gt;
EDIT: Another solution, which I only just worked out, would be to install the very badly-named &lt;a href=&quot;http://www.rubyenterpriseedition.com/&quot;&gt;Ruby Enterprise Edition&lt;/a&gt;, which sits alongside the system's Ruby and is call-compatible with 1.8.6. This makes a lot of sense if you're using passenger (mod_rails), as well.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-10-13:152</id>
    <published>2008-10-13T20:31:00Z</published>
    <updated>2008-10-13T20:38:17Z</updated>
    <category term="gems"/>
    <category term="github"/>
    <category term="rubymarks"/>
    <category term="sandwiches"/>
    <link href="http://www.floppy.org.uk/2008/10/13/gems-bookmarks-and-sandwiches" rel="alternate" type="text/html"/>
    <title>Gems, Bookmarks, and Sandwiches</title>
<content type="html">
            &lt;p&gt;
I've been crazy busy for a while, but what little spare time I have grabbed here and there has been used investigating some areas of Rails I hadn't played with before, like route globbing and running without a database. The results are a couple of tools, one useful, one most definitely not.
&lt;/p&gt;

&lt;p&gt;
The first (and most useful) is &lt;a href=&quot;http://hasmygembuiltyet.org&quot;&gt;Has My Gem Built Yet?&lt;/a&gt;. I have a bunch of ruby gems on GitHub and get annoyed that I have to keep running &quot;gem update&quot; while waiting for GitHub to build the gem once I've pushed the code. Well, no more. Just put in the details, and the page checks for you and pops up a message when the gem is done. Nice. It got picked up on &lt;a href=&quot;http://github.com/blog/177-has-my-gem-built-yet&quot;&gt;the GitHub blog&lt;/a&gt;, and I've even had some patches sent in. It's a nice feeling :)
&lt;/p&gt;
&lt;p&gt;
The second app is somewhat less useful (though still entertaining). After a suggestion on Twitter by &lt;a href=&quot;http://tomtaylor.co.uk&quot;&gt;Tom Taylor&lt;/a&gt;, I built a website which lets you bookmark &lt;a href=&quot;http://s.andwi.ch&quot;&gt;sandwich&lt;/a&gt; combinations. There are a couple of interesting bits in this though - first is route globbing, which is the Rails way of using arbitrary bits of the URL as parameters to an action. Not something you use in every project, but still. More importantly, I've used it to test out &lt;a href=&quot;http://github.com/Floppy/rubymarks&quot;&gt;rubymarks&lt;/a&gt;, a Rails plugin for generating links for social bookmarking services.
&lt;/p&gt;
&lt;p&gt;
I love Rails for this sort of thing. I can't think of other system I've used that would let me create such fun things in the tiny snippets of spare time I have at the moment. And of course, everything above is open source and available on &lt;a href=&quot;http://github.com/Floppy&quot;&gt;Github&lt;/a&gt;.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-08-31:116</id>
    <published>2008-08-31T10:15:00Z</published>
    <updated>2008-08-29T10:17:24Z</updated>
    <category term="amee"/>
    <category term="json"/>
    <category term="monkeypatching"/>
    <category term="ruby"/>
    <link href="http://www.floppy.org.uk/2008/8/31/mocking-kernel-require" rel="alternate" type="text/html"/>
    <title>Mocking Kernel#require</title>
<content type="html">
            &lt;p&gt;
The other day, I remembered to add coverage analysis to my &lt;a href=&quot;http://github.com/Floppy/amee-ruby&quot;&gt;AMEE-Ruby&lt;/a&gt; tests, using &lt;a href=&quot;&quot;&gt;rcov&lt;/a&gt;. 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 the system (XML support is built into core Ruby). Problem is, require calls throw errors if they fail, so I had to write some code to handle the load failure and carry on regardless. This is the code inside amee.rb:
&lt;/p&gt;&lt;p&gt;
&lt;pre class=&quot;zenburnesque&quot;&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;begin&lt;/span&gt;
  &lt;span class=&quot;LanguageKeyword&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;json&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;LoadError&lt;/span&gt;
  &lt;span class=&quot;BuiltInConstant&quot;&gt;nil&lt;/span&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/p&gt;&lt;p&gt;
Problem with this is that the gem is installed on my system, so the require never fails, and the rescue is never used. Rcov notices, and I can't get to 100% coverage, which is &lt;em&gt;annoying&lt;/em&gt;.
&lt;/p&gt;&lt;p&gt;
So, mocking to the rescue. We have to make Kernel#rescue throw an error if we try to require 'json', even if the gem is installed. At first, I tried to use flexmock to do this, but couldn't make it work - if anyone knows how, &lt;em&gt;please&lt;/em&gt; tell me. My final approach was to monkeypatch Kernel#require inside my test so that require 'json' (and only json) would fail:
&lt;/p&gt;&lt;p&gt;
&lt;pre class=&quot;zenburnesque&quot;&gt;
it &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;should cope if json gem isn't available&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;LanguageKeyword&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; Monkeypatch Kernel#require to make sure that require 'json'&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; raises a LoadError&lt;/span&gt;
  &lt;span class=&quot;LanguageKeyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;TypeName&quot;&gt;Kernel&lt;/span&gt;
    &lt;span class=&quot;LanguageKeyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;FunctionName&quot;&gt;require_with_mock&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;string&lt;/span&gt;)
      &lt;span class=&quot;LanguageKeyword&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;LibraryClassType&quot;&gt;LoadError&lt;/span&gt;.&lt;span class=&quot;FunctionName&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;LanguageKeyword&quot;&gt;if&lt;/span&gt; string &lt;span class=&quot;Operators&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;json&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt; 
      &lt;span class=&quot;FunctionName&quot;&gt;require_without_mock&lt;/span&gt;(string)
    &lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;LanguageKeyword&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;UserDefinedConstant&quot;&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;:&lt;/span&gt;require_without_mock&lt;/span&gt;, &lt;span class=&quot;UserDefinedConstant&quot;&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;:&lt;/span&gt;require&lt;/span&gt; 
    &lt;span class=&quot;LanguageKeyword&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;UserDefinedConstant&quot;&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;:&lt;/span&gt;require&lt;/span&gt;, &lt;span class=&quot;UserDefinedConstant&quot;&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;:&lt;/span&gt;require_with_mock&lt;/span&gt;
  &lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; Remove amee.rb from required file list so we can load it again&lt;/span&gt;
  &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;&amp;quot;&lt;/span&gt;.&lt;span class=&quot;FunctionName&quot;&gt;delete_if&lt;/span&gt;{|&lt;span class=&quot;Variable&quot;&gt;x&lt;/span&gt;| x.&lt;span class=&quot;FunctionName&quot;&gt;include?&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;amee.rb&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;}
&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; Require file - require 'json' should throw a LoadError,&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; but we should cope with it OK.&lt;/span&gt;
  lambda {
    &lt;span class=&quot;LanguageKeyword&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;amee&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
  }.&lt;span class=&quot;FunctionName&quot;&gt;should_not&lt;/span&gt; raise_error
&lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/p&gt;&lt;p&gt;
We have to make a new require function, then use alias_method to rename the old one and install our new one in it's place. Rails includes alias_method_chain to make this easier, but that's not available in pure Ruby. Never mind. Once we've done the monkeypatch, we take amee.rb out of the $&quot; array, which lists all the currently-required files, to make sure we can require it again, then simply run the require and make sure it catches the error that is thrown by our patched require. And the most satisfying part? The rescue is executed, the test works, and we get to 100% coverage. I've got a nice warm fuzzy feeling inside... mmmmmm.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-08-29:115</id>
    <published>2008-08-29T09:56:00Z</published>
    <updated>2008-08-29T10:18:39Z</updated>
    <category term="currentcost"/>
    <category term="eeml"/>
    <category term="github"/>
    <category term="pachube"/>
    <category term="ruby"/>
    <category term="webrick"/>
    <link href="http://www.floppy.org.uk/2008/8/29/currentcost-data-live-on-pachube" rel="alternate" type="text/html"/>
    <title>CurrentCost data live on Pachube</title>
<content type="html">
            &lt;p&gt;
So, the other day I got a nice little &lt;a href=&quot;&quot;&gt;tray icon&lt;/a&gt; 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.
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://pachube.com&quot;&gt;Pachube&lt;/a&gt; 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 attempt at putting my power data online. My first thought was to get my app to post data at regular intervals to the service, but unfortunately Pachube doesn't work like that. Instead, it acts more like a news reader, not a publishing platform - Google Reader instead of Blogger, if that makes sense. So, I had to publish my feed live on the web and point Pachube at the URL.
&lt;/p&gt;&lt;p&gt;
First step: EEML. This is an XML-based format which Pachube reads which can contain not only multiple data feeds, but tags and other metadata. So (as seems to be the fashion), I wrapped it up in a Ruby gem, &lt;a href=&quot;http://github.com/Floppy/eeml-ruby/tree/master&quot;&gt;available from GitHub&lt;/a&gt; as ever. The gem simply provides utility classes to build an EEML feed and convert it to the XML-based format for delivery over the web.
&lt;/p&gt;&lt;p&gt;
Then, the final step was to publish the data on the web. For that, we need a web server. However, having a full web server for just one feed seemed overkill, and I didn't want to publish to yet another intermediate server, so we need to serve the data directly. Ruby to the rescue once again. WEBrick is a simple web server which is part of the core Ruby libraries. You create a server, write simple servlet classes, and mount them at particular locations. For instance:
&lt;/p&gt;&lt;p&gt;
&lt;pre class=&quot;zenburnesque&quot;&gt;
&lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; Create WEBrick server&lt;/span&gt;
s &lt;span class=&quot;Operators&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;WEBrick&lt;/span&gt;::&lt;span class=&quot;FunctionName&quot;&gt;HTTPServer&lt;/span&gt;.&lt;span class=&quot;FunctionName&quot;&gt;new&lt;/span&gt;( &lt;span class=&quot;UserDefinedConstant&quot;&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;:&lt;/span&gt;Port&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Number&quot;&gt;50000&lt;/span&gt; )
&lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; A simple &amp;quot;hello world&amp;quot; servlet &lt;/span&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;TypeName&quot;&gt;HelloServlet&lt;span class=&quot;InheritedClass&quot;&gt; &lt;span class=&quot;InheritedClass&quot;&gt;&amp;lt;&lt;/span&gt; WEBrick::HTTPServlet::AbstractServlet&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;LanguageKeyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;FunctionName&quot;&gt;do_GET&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;request&lt;span class=&quot;Variable&quot;&gt;,&lt;/span&gt; response&lt;/span&gt;)
    response.&lt;span class=&quot;FunctionName&quot;&gt;status&lt;/span&gt; &lt;span class=&quot;Operators&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Number&quot;&gt;200&lt;/span&gt;
    response[&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Content-Type&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] &lt;span class=&quot;Operators&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;text/xml&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    response.&lt;span class=&quot;FunctionName&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;Operators&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;hello world&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;LanguageKeyword&quot;&gt;end&lt;/span&gt;
s.&lt;span class=&quot;FunctionName&quot;&gt;mount&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;/&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;HelloServlet&lt;/span&gt;)
&lt;/pre&gt;
&lt;/p&gt;&lt;p&gt;
Now, http://localhost:50000/ will say &quot;hello world&quot;. From here it's a simple modification to publish the EEML feed. EEML-Ruby includes a &lt;a href=&quot;http://github.com/Floppy/eeml-ruby/tree/master/examples/simple_server.rb&quot;&gt;simple EEML server script&lt;/a&gt; as an example. So, after building this into the tray app, now whenever my CurrentCost is connected and the app is running, it serves up EEML data to the web. You can see the data feed (fairly intermittent, as obviously the meter isn't always connected to my PC at the moment) &lt;a href=&quot;http://pachube.com/feeds/488&quot;&gt;live on Pachube&lt;/a&gt;.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-08-22:60</id>
    <published>2008-08-22T09:25:00Z</published>
    <updated>2008-08-22T09:34:59Z</updated>
    <category term="currentcost"/>
    <category term="gem"/>
    <category term="github"/>
    <category term="ruby"/>
    <link href="http://www.floppy.org.uk/2008/8/22/some-successful-currentcost-hacking" rel="alternate" type="text/html"/>
    <title>Some successful CurrentCost hacking</title>
<content type="html">
            &lt;p&gt;
After a bit of work, I've finally got my &lt;a href=&quot;http://www.currentcost.com&quot;&gt;CurrentCost&lt;/a&gt; meter working in Ruby, and I now have a power monitor sitting in my system tray! There were a few stages involved...
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Serial comms:&lt;/strong&gt; 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 me. So, I had to write my own. I've created a nice simple serial library (including a gem) for Ruby called RB232, which is available on &lt;a href=&quot;http://github.com/Floppy/rb232&quot;&gt;GitHub&lt;/a&gt;. It only supports reading at the moment, and only works on Linux systems, but it's a start. Next!
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Reading CurrentCost data:&lt;/strong&gt; Once RB232 was in place, this was pretty easy. Just create a couple of classes to wrap up the process of getting data from the meter, and away you go. Easy. Also released as a Ruby gem on &lt;a href=&quot;http://github.com/Floppy/currentcost-ruby&quot;&gt;Github&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;User interface:&lt;/strong&gt; Last step was to make a simple user interface for the meter, which you can see in the picture above. It's a simple tray icon that changes colour based on power usage. It's based heavily on another very useful tool called &lt;a href=&quot;http://rubyforge.org/projects/cctrayrb/&quot;&gt;cctrayrb&lt;/a&gt;, so many thanks to Daniel Parnell for doing the heavy GUI lifting there. The app is included as part of the currentcost-ruby gem mentioned above.
&lt;/p&gt;
&lt;p&gt;
Anyway, it's all freely available, so if you have a CurrentCost meter and a serial cable for it, you can grab the code and get going. Enjoy :)
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-08-07:33</id>
    <published>2008-08-07T21:10:00Z</published>
    <updated>2009-05-02T11:15:48Z</updated>
    <category term="co2updates"/>
    <category term="facebook"/>
    <category term="github"/>
    <category term="jabber"/>
    <category term="twitter"/>
    <category term="xmpp"/>
    <link href="http://www.floppy.org.uk/2008/8/7/twitter-support-in-jabberstatus" rel="alternate" type="text/html"/>
    <title>Twitter support in JabberStatus</title>
<content type="html">
            &lt;p&gt;
&lt;a href=&quot;http://floppy.github.com/jabberstatus&quot;&gt;JabberStatus&lt;/a&gt; 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. 
&lt;/p&gt;
&lt;p&gt;
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 list and it will talk you through the rest.
&lt;/p&gt;
&lt;p&gt;
The JabberStatus code has &lt;a href=&quot;http://github.com/Floppy/jabberstatus&quot;&gt;moved to GitHub&lt;/a&gt; now, so you can grab it from there. The &lt;a href=&quot;http://github.com/Floppy/co2updates&quot;&gt;code for the CO2Updates app&lt;/a&gt; has also moved there.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-08-06:32</id>
    <published>2008-08-06T09:56:00Z</published>
    <updated>2008-08-06T10:22:42Z</updated>
    <category term="Projects"/>
    <category term="carbon"/>
    <category term="github"/>
    <category term="ruby"/>
    <category term="twitter"/>
    <link href="http://www.floppy.org.uk/2008/8/6/one-hundred-months" rel="alternate" type="text/html"/>
    <title>One Hundred Months</title>
<content type="html">
            &lt;p&gt;
I just saw the &lt;a href=&quot;http://onehundredmonths.org/&quot;&gt;One Hundred Months&lt;/a&gt; campaign, and decided it was ripe for a bit of automated Twittering. So, 5 minutes hacking and we have &lt;a href=&quot;http://twitter.com/100months&quot;&gt;One Hundred Months on Twitter&lt;/a&gt;. Code (as ever these days) is available from &lt;a href=&quot;http://github.com/Floppy/onehundredmonths&quot;&gt;GitHub&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;
I'm amazed by what computers can do sometimes. This one seriously took me longer to publish to the world than to write.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-08-06:31</id>
    <published>2008-08-06T00:09:00Z</published>
    <updated>2008-08-06T00:19:36Z</updated>
    <category term="amee"/>
    <category term="currentcost"/>
    <category term="energy"/>
    <category term="gem"/>
    <category term="github"/>
    <category term="meter"/>
    <category term="ruby"/>
    <link href="http://www.floppy.org.uk/2008/8/6/hacking-your-energy-usage-with-the-currentcost" rel="alternate" type="text/html"/>
    <title>Hacking your energy usage with the CurrentCost</title>
<content type="html">
            &lt;p&gt;
The other day, I managed to get hold of a &lt;a href=&quot;http://www.currentcost.com/&quot;&gt;CurrentCost&lt;/a&gt; energy monitor (available to buy from &lt;a href=&quot;https://www.ecogadgetshop.co.uk/ProductDetails.aspx?ProductCode=Current%20Cost%20Device%20(TEST)&amp;amp;Category=1&quot;&gt;here&lt;/a&gt;, 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 &lt;a href=&quot;http://rooreynolds.com/2008/07/06/current-cost-presentation-at-open-tech-2008/&quot;&gt;a bit of hacking&lt;/a&gt;) plug into your PC, and - bingo - lovely XML data!
&lt;/p&gt;&lt;p&gt;
However, once you have it connected and spewing XML at you, you really need something to do with all that data. I don't have anything big  written yet, but my first step towards making something useful is a Ruby gem, which is available from &lt;a href=&quot;http://github.com/Floppy/currentcost-ruby/tree/master&quot;&gt;GitHub&lt;/a&gt;. So far it can only parse the XML data from the meter - direct access to the serial port is hopefully coming soon.
&lt;/p&gt;&lt;p&gt;
In other news, the AMEE gem I started a while ago is still coming on. It can now use the XML and JSON interfaces, parse the whole Data API, and retrieve a list of Profiles. Not a bad start.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.floppy.org.uk/">
    <author>
      <name>james</name>
    </author>
    <id>tag:www.floppy.org.uk,2008-07-10:30</id>
    <published>2008-07-10T21:29:00Z</published>
    <updated>2008-08-06T10:22:49Z</updated>
    <category term="Projects"/>
    <category term="amee"/>
    <category term="carbon"/>
    <category term="gem"/>
    <category term="github"/>
    <category term="ruby"/>
    <link href="http://www.floppy.org.uk/2008/7/10/amee-for-ruby" rel="alternate" type="text/html"/>
    <title>AMEE for Ruby</title>
<content type="html">
            &lt;p&gt;
In a fit of why-the-hell-not, I've just started writing my first gem for Ruby, which is going to be a wrapper around the &lt;a href=&quot;http://amee.cc&quot;&gt;AMEE&lt;/a&gt; carbon calculation engine. It's still in a very early incarnation, but more will be forthcoming soon. At the moment it can authenticate, and parse DataCategory nodes. DataItems and DataItemValues will be following after a short (UK-based) holiday. Source code and installation instructions are available from &lt;a href=&quot;http://github.com/Floppy/amee-ruby&quot;&gt;GitHub&lt;/a&gt;.
&lt;/p&gt;
          </content>  </entry>
</feed>
