/** * Check for Speedy usage * version 3.1 */ var username = 'speedy_user@telkom.net'; var password = 'password'; var xmlhttp = null; // create xmlhttp object try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { WScript.Echo("Error, cannot create XMLHTTP object"); WScript.Quit(); } try { xmlhttp.open("POST", 'https://portal.telkomspeedy.com/index.php?flash=-1', false); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { //check for login status var body = xmlhttp.responseText; if (/Login Area/gi.test(body)) { // logged in var re = new RegExp('

Pemakaian pada bulan (.*?)(.|\n)*?'+ 'Pemakaian(.|\n)*?(.*?)(.|\n)*?(.|\n)*?'+ 'Limit (.|\n)*?(.*?)(.|\n)*?(.|\n)*?'+ 'Kelebihan(.|\n)*?(.*?)(.|\n)*?', 'gi'); var match = re.exec(body); if (match) { str = "Pemakaian Speedy " + match[1].replace(/(<[^>]+>| )/gi, ' ') + "\n"; str += "Pemakaian: " + match[4] + "\n"; str += "Limit: " + match[8] + "\n"; str += "Kelebihan: " + match[12] + "\n"; str += "\n\nhttp://ferdianto.com/\n"; WScript.Echo(str); } } } } xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send('username='+username+'&password='+password+'&login=+++login+++'); } catch(e) { WScript.Echo(e); WScript.Quit(); }