User:Paranomia/rights.js

// scraped from VoA's code function get_userlist_xml(arg) { document.getElementById('contentSub').innerHTML += ' Searching for current usergroup information.' + '\n' + 'Please wait... '; gml_xmlhttp = sajax_init_object; if(!gml_xmlhttp) return; var pageurl = '/w/index.php?title=Special:Listusers&group=&username=' + escape(arg); gml_xmlhttp.open("GET", pageurl, true); gml_xmlhttp.onreadystatechange = alertget; gml_xmlhttp.send(null); } function alertget { if(gml_xmlhttp.readyState != 4) return; xml = gml_xmlhttp.responseText.replace(//, ''); var obj = new DOMParser var doc = obj.parseFromString(xml, "text/xml") var rights = '(username invalid)'; if(doc.getElementsByTagName('li')[1]) {rights = doc.getElementsByTagName('li')[1].innerHTML;} document.getElementById('contentSub').innerHTML += ' ' + rights + ' '; }