Shoutbox

Website Status - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Website Status (/showthread.php?tid=91922)

Website Status by smithygotlost on 08-19-2009 at 06:06 PM

I was looking at making something that would change my personal message to say, Site has no problems, site offline ect by pinging it. so if it pinged google and it replide Google In Running With No Problems, If google doesnt reply Google is Currently Experiencing Problems


Would something like this be possible and can anyone advise anything

Thanks
Mike


RE: Website Status by matty on 08-19-2009 at 07:19 PM

Something like this is the easiest way :)

Javascript code:
CheckWebsiteStatus ( 'google.ca' );
 
function CheckWebsiteStatus ( sUrl ) {
    var xmlhttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
    xmlhttp.open ( 'GET', 'http://downforeveryoneorjustme.com/'+sUrl+'&'+new Date ( ).getTime ( ), true );
 
    xmlhttp.onreadystatechange=function ( ) {
        if ( xmlhttp.readyState === 4 && xmlhttp.status === 200 ) {
            var resText = xmlhttp.responseText.toLowerCase();
            if ( resText.substr ( 0 , 3 ) === 'huh' ) {
                Debug.Trace ( 'Website does not exist on the interwho' );
            } else if ( resText.substr ( 0 , 13 ) === 'it\'s just you' ) {
                Debug.Trace ( 'Website is up' );
            } else if ( resText.substr ( 0 , 17 ) === 'it\'s not just you' ) {
                Debug.Trace ( 'Website is down' );
            }
        }
    }
    xmlhttp.send ( '' );
}


And there is a much better way of doing this I am just too lazy to do it.
RE: Website Status by smithygotlost on 08-20-2009 at 04:46 PM

hmmm i wish i could understand these things :P

how would i compile that ?

or even make it work ?

i really need to learn this :P

Thanks
Mike