Finding area under the curve

Here is my feed:

https://cosm.com/feeds/30326?pachube_redirect=true

I take a measurement once every 2 minutes or so and then upload the 4 data points you see to pachube. Basically I want to take the area under the curve of "dirty" and "clean".

Suppose I wanted to do this calculation all server-side instead of how we are discussing on the Arduino. I was thinking that I could just PULL data from Pachube, do the calculation, then PUSH data back onto Pachube on a completely new graph. If that was the case I suppose I could just write some script to do that for me. What programming language to do it in? Perhaps PERL or something that handles the data set well.