Last week I contacted Pachube to get access to their API (they are still in beta, so you must be invited to get a login). It was a great experience. The API is very well documented and even easier to use. After just 10 minutes I was able to log data to a ‘feed’ that I set up. You can see it here:
I then started thinking about how I could wrap these commands using openFrameworks. If you’ve been following the project, then you know my thought was to write an application using oF (C++), and distribute it for users of M||N to run when they are ready to upload their collected data to the database. The app would let the user choose the most recent .TXT file saved by the MSP, and then upload it to their specific database. Amazingly, someone (Carl Johan Rosen) has already created an openFrameworks addon specifically for posting and pulling from Pachube. It worked like a charm, and the data on the feed now was posted from a sketch I wrote using Rosen’s addon. Very nice.
I have since realized this is a horrible idea, compared to the alternative of using PHP to do all of these things. This way, I do not have to make an OS X AND a PC compatible C++ app. Using PHP, a user would just have to visit a web address, click “Browse…” which will open a file dialog box. It will the upload the .TXT file, parse it, and post it to a MySQL database. I’ve already prototyped this, and have it parsing, and writing to a MySQL database.
I will be using the Google Gadgets API to visualize data from my database. More on that later. Progress!