I found this interesting script to check the bandwith usage by Ferdianto. You can directly download the scripts here. Just edit the files with notepad to change the username and password with your speedy account username and password. And then, connect to internet with your speedy account, run the file by double-click it. This little script is utilizing the useful XMLHttpRequest and Javascript capabilities. The XMLHTTP object will do all the HTTP communication. This javascript can be run in your Windows Box using WScript.exe or CScript.exe, this two apps is shipped with your Windows instalation.
Here is how it works :
For developers, here a little bit explanation about telkomspeedy bandwith usage grabber script. First we create the xmlhttp object
var xmlhttp = false;
// create xmlhttp object
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
// no xml http, bail
WScript.Echo("Error, cannot create XMLHTTP object");
WScript.Quit();
}
}
And then, we need to send the login information, and retrieve the session cookie
var cookie = '';
var logged_in = false;xmlhttp.open("POST", "http://divre5.telkomspeedy.com/session.php", false);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4) {
// retrieve session cookie
cookie = xmlhttp.getResponseHeader('set-cookie');
//check for login status
body = xmlhttp.responseText;
if (body.match(/location.href='/?'/)) {
logged_in = true;
} else {
WScript.Echo("Error, login failed!");
WScript.Quit();
}
}
}
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send('username='+username+'&password='+password);
When our loggin success, their website gives a JS redirection code:
location.href='/?';
So we just need to follow their redirection and parse the speedy bandwith info.
xmlhttp.open("POST", "http://divre5.telkomspeedy.com/?", false);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4) {
cookie = xmlhttp.getResponseHeader('set-cookie');
body = xmlhttp.responseText;
// retrieve speedy usage
pos = body.indexOf('Sisa Limit');
limit = body.substring(pos + 33, pos + 38);
pos = body.indexOf('Pemakaian‘);
used = body.substring(pos + 32, pos + 37);
WScript.Echo("Speedy Usage For: " + username + "nSisa Limit: " + limit + "%nTerpakai : " + used + "%" );
}
}
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Cookie", cookie);
xmlhttp.send(”);
And this is how we grab the useful information of telkomspeedy bandwith usage, minus downloading the image and flash animation
Fully Credit to : Ferdianto




[...] (more…) [...]
[...] (more…) [...]
ups, this script is soooo outdated. please check the new script at:
http://ferdianto.com/2007/12/22/telkom-speedy-bandwidth-checker-script-updated/