Posted Tuesday, July 18th, 2006, at 2:42 pm Eastern by Mark Wallace

Cory Linden, aka Cory Ondrejka, chief technology officer at Linden Lab, makers of the virtual world of Second Life, has sent along what looks like a nice SL-del.icio.us mashup that works as a kind of SL-centric “GPS” location-tracker and has the potential to become a piece of social networking software for SL as well. The slice of Linden Scripting Language code (aka LSL, pasted after the jump) goes in an attachment worn on your avatar, and periodically posts your location to del.icio.us under the “SLurlTrack” tag. If you want to monitor someone’s movements or track your own, just subscribe to the del.icio.us feed for the right user and the SLurlTrack tag. While Cory’s codeslice is a bit crude at the moment (codeslice? did I just coin that?), it contains the fundamental seeds of some interesting possibilities, and could easily be reworked to do some powerful stuff.

Here’s the code. Blueskying follows.

string delicious_username = ""; // add in your del.icio.us username -- I'm using CoryLindenTracking
string delicious_password = ""; // add in your del.icio.us password -- I wouldn't use a secure password here.

string user = "Cory Linden";

integer lastx = 0;
integer lasty = 0;
integer lastz = 0;

integer placetimer = 0;
float checktime = 10.f;

default
{
state_entry()
{
llSetTimerEvent(checktime);
}

timer()
{
string simname = llEscapeURL(llGetRegionName());
vector pos = llGetRootPosition();
integer x = 10*llRound(pos.x/10.f);
integer y = 10*llRound(pos.y/10.f);
integer z = 10*llRound(pos.z/10.f);

if ( (x == lastx)
&&(y == lasty)
&&(z == lastz))
{
placetimer += (integer)checktime;
}
else
{
placetimer = 0;
lastx = x;
lasty = y;
lastz = z;
}

string sx = (string)(x);
string sy = (string)(y);
string sz = (string)(z);

string timestamp = llGetTimestamp();

string apibase = "https://" + delicious_username + ":" + delicious_password + "@api.del.icio.us/v1/posts/add?";
string url = "url=http://slurl.com/secondlife/";
url += simname;
url += "/" + sx + "/" + sy + "/" + sz + "/;";
string description = "description=" + llEscapeURL(user + " here for " + (string)placetimer + " seconds") + ";";
string dt = "dt=" + timestamp + ";";
string tags = "tags=slurltrack+secondlife:region:" + simname + ";";
string api = apibase + url + description + dt + tags;
llHTTPRequest(api,[HTTP_METHOD,"POST"],"");
}

// for debugging -- it's generating a 415 error right now, but creates the tags
// I'm sure someone can fix whatever the dumb mistake is
http_response(key request_id, integer status, list metadata, string body)
{
// llSay(0, "status: " + (string)status);
// llSay(0, "body: " + body);
}
}

So bascially what’s happening, as far as I can tell, is that the script periodically posts the location as if it were the location of the del.icio.us user. I’d love to see a version of this that posts with your avatar name as one of the tags, just as the concatenation of “secondlife:region:” and the simname variable works — something like “secondlife: avatar” + avname, which is totally do-able with LSL and del.icio.us.

In his blog post, Cory envisions some real-world/virtual-world mashup applications that the technology could have. I’ll let you guys ponder that one. The SL things you could do with this are cool enough. If you wanted to track your location without giving away your current location, you could just have it post to del.icio.us whenever the sim name changed. And as Cory mentioned in his email to me, “you could start putting in additional information, like where you are near other people, who’s property you crossed, etc. del.icio.us becomes a very interesting data aggregation of SL then.”

Indeed. You could easily turn this into a kind of mobile social software app, by using a Web-based back end to store things like your friend lists, etc. If you had access to those in-world, then the attachment could tell you if one of your friends was in the same sim as you (or a neighboring sim, even). You could also farm the del.icio.us data for all kinds of useful information about how people use SL, if enough people adopt the service. Or you could feed the information into the SL Webmap API and make your own maps that way. In any case, I find it all very cool, and hope someone will hack up even cooler stuff out of this (and tell me about it as soon as they do). These kind of Web-SL crossovers are going to be what truly brings the 3pointD world to life.


Comments are closed. Trackbacks are closed.

3 comments:


mobile phone