Since the tutorial provided by xively didnt exactly work out of the box, here is the version that I was able to get to work