How To Check Output Of A Created URL?
I want to make a RuneScape(an MMORPG Game) Name Checker. For this i am using an IRC bot. The URL i am using to check names is this- http://rscript.org/lookup.php?type=namecheck&
Solution 1:
Dont know what language u are using, with jQuery u can do following things
You can load the response inside a div.
function nameCheck() { var username = document.getElementById('uname').value; var url = "http://rscript.org/lookup.php?type=namecheck&name="; var curl = url + username; var output = $('#someDiv').load( curl ).html() // .html() will give you the output or what the page if( output.contains('NAMECHECK: NOTAVALIBLE'){ nameNotAva(); } }
You can use simple AJAX and get the response text ( may be with async false)
function nameCheck() { var username = document.getElementById('uname').value; var url = "http://rscript.org/lookup.php?type=namecheck&name="; var curl = url + username; $.ajax({ url : curl, type : 'GET' //or 'POST', success : function( urlOutput ){ if( urlOutput .contains('NAMECHECK: NOTAVALIBLE'){ nameNotAva(); } } }); }
Post a Comment for "How To Check Output Of A Created URL?"