I am attaching the saved html of a usage report. Basically, it gives you daily usage by date. I needed a better data like the accumulated usage for the month to date of subscription, AND the percentage of quota use ..etc..
I wrote jquery to do that. My first attempt is here:
var arr = {};
var duse;
var tday;
var usesofar=0;
$('#ctl00_ContentPlaceHolder1_TD_Unlimited_Usage_PerDay tr').each(function() {
duse = $(this).find("td").eq(3).html();
tday = $(this).find("td").eq(0).html();
console.log(tday);
console.log(duse);
arr[tday] = duse;
});
$.each(arr, function (index, value) {
//console.log( index + ' : ' + value );
if(/GB/g.test(value)){usesofar += parseFloat(value);}
});
alert (usesofar);
I need your help in doing it right.
- This is a secured site I have to login.
- once I am in how can I use my jquery to display the report in a window.
- Is it possible to automate this proceedure and email me with the report ?
I did it in Perl but I feel jquery could be a better solution.. What do you think?