SL Social Location-Tracking Hack Via del.icio.us
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.



What I find truly hilarious about this that Cory is putting this on the Internet (teh Intarnut) just at the moment when likely in the next patch, the Lindens are going to take out of the client the ability to track your friends inworld using their calling cards on “friendship”.
FlipperPA is one of the loudest lobbyists with the Lindens trying to get them to accelerate and prioritize taking this tracking ability out of the calling cards. Like many people who have a lot of customer service calls and a lot of important friends some of whom he wants to keep as “friends” without having them know where he is at (with other “friends”), he wants to be able to make himself invisible, as we could in TSO, when “stalk mode” could be turned off. (With Alphaville so small and predictable, you could often just find your friend anyway through deductive reasoning, but it was popular nonetheless).
I’ve been a critic of trying to take one more feature needed urgently by only one class of people and putting it ahead of the queue; I also don’t understand why, if there is someone who maps you or annoying IM’s you the minute you log in, you don’t *cut their card*. That’s what I do. I also don’t care if someone maps me. In business, don’t you want to be found? Your socializing can go on after hours on an alt where you keep only a few close friends’ cards. I find some of my closest friends in SL are people whose cards I don’t even have anyway.
So now people can sign up to be mapped. But the real jackpot here with the delicious stuff is that you can possibly (not sure because I didn’t try the script yet) do stuff like “Wow, gang here I am shopping at Aimee’s in Midnight City” and then “woot, buying a new record at Spin’s” etc. The potential for breathless blogging has just been amplified by about 444 squared *if it leaves a trail*. So you’ll see first, the Advertar’s trail-blazing (paid for at $10 per by Spin), then you’ll see people clicking like Pavlov’s dogs on the clickables that were already clicked.
And that’s how you make a Web, not a World.
BTW, we get so used to the idea that Lindens comingle with top scripters in the IRC channel and have special talks in RL etc etc that we assume they know everything that’s going on. I do want to point out that Ordinal Malaprop already made a script that posts the location of the trolly in Caledon to her web page (didn’t you write about it here) and a HUD you don in order to create SLURLs you can paste into delicious.
So I’m thinking that what Cory’s thing does is make that process of the pasting into delicious automatic?
[…] This 3pointD post about a script, a web interface, and a location moves two approaching worlds (RL <=> SL) a little bit closer. Corey Linden speaks of “SL mirror-world space to visualize, market, and sell the data” using world-converging mashups such as this. I’m more interested in the innovations for the non-mirror world, metaverse-as-a-media built environment that scripts like this will make possible. In the spirit of geo-caching or gps art, invented in the wake of cheap, available GPS tech, what are the objects and spaces that will emerge from the convergence between art, tech and territory? […]
[…] http://www.3pointd.com/20060718/sl-social-location-tracking-hack-via-delicious/ […]