It’s all very well and good to be able to visualize the energy flow from New Brunswick to Prince Edward Island, but what if we want more “ambient” feedback? What if we want to feel the energy flow?
Enter Pachube, SoundCloud, and a bit of PHP code to stitch them together. The result: iTunes plays songs with a beats-per-minute reflecting the current energy flow. Watch it in action:
What’s happening here is this:
- The New Brunswick System Operator page is being scraped and converted into a Pachube feed which exposes the data in XML (code here).
- The XML data is grabbed from Pachube and the figure, in megawatts, representing energy flowing from New Brunswick to Prince Edward Island is use to search SoundCloud via its API (code here).
- The tracks returned from SoundCloud are played in iTunes.
The result: you can hear how much energy is flowing over the cable from New Brunswick to Prince Edward Island.
Update: I’ve packaged up the code as a Mac OS X app that you can download and install without the need to fuss with code.
Comments
Intrigued by your project
Intrigued by your project here but after reviewing the code, I’m not sure how the bpm updates as energy flow changes. Am I missing something?
On my server I have this code
On my server I have this code that scrapes the data from the New Brunswick System Operator every minute.
The Pachube feed I have set up for this purpose is pointed at that script, and updates itself regularly with the updated energy flow data.
Finally, this code, fed from the Pachube feed, is the glue between SoundCloud and the updated energy flow data.
Add new comment