function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
ro = new ActiveXObject("Microsoft.XMLHTTP");
}else{
ro = new XMLHttpRequest();
ro.overrideMimeType('text/xml');
}
return ro;
}
var http = createRequestObject();
function sndReq(action) {
document.getElementById("slvisitors").innerHTML = "loading";
http.onreadystatechange = handleResponse;
http.open('get', 'http://www.daden.co.uk/cgi-bin/sl/sllogger.pl?uid=1234&api=lastn&num=5', true);
http.send(null);
}
function handleResponse() {
//alert("got response "+http.readyState);
if(http.readyState == 4){
if (http.status != 200) {
document.getElementById("slvisitors").innerHTML = "http error "+http.status;
} else {
var xmldoc = http.responseXML;
var listitems = xmldoc.getElementsByTagName("name")
var show = "
- ";
- "+nm_node[0].firstChild.nodeValue;
show += " @ "+tm_node[0].firstChild.nodeValue+" ";
var listitems = xmldoc.getElementsByTagName("visitor")
var show = "
- ";
for (i=0; i
var tm_node = listitems[i].getElementsByTagName("time");
show += "
}
show += "
document.getElementById("slvisitors").innerHTML = show;
}
}
}
Here are the last 5 people to visit our offices in Second Life.
This list is generated dynamically using the Linden Scripting Language to push the data from SL across the web and into a database on our servers, a Perl script to generate an XML feed from the database, and finally some AJAX to get the XML feed and display the list. Give us a call if you'd like something similar to show your web users what is happening at your presence in Second Life.

