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, I'm intentionally keeping off the slurl and slurlmarker tags for now, because I didn't want to pollute their tag space, choosing "slurltrack" instead. So what is this? It's a way to always know where I've been in SL. If enough people start using this (or similar) scripts, they could generate some really interesting metadata about traffic flow in SL. This version isn't anonymized, of course, but someone could easily modify this to simply aggregate the data.
So, what's the billion dollar idea that riffs off of this?
I was stuck in traffic in a Hertz rental car the other day. I had the snazzy GPS navigation system in the car which offered "Fastest", "Most Highway", and "Least Highway" routes. Of course, the "Fastest" was a joke, because it didn't leverage real time data. It would be trivial for Hertz cars to report their average speed as they are driven around, which would allow Hertz to rent way more cars with their navigation system, since it would actually be able to offer you fastest routes that really were the fastest. Yes, you would have to be a little careful in building a system that was both truly anonymous and spoof resistant, but over drinks at Cory and Alice's going away party it was pretty easy to solve or minimize those risks. Once Hertz had the data, how much would local drivers pay to rent a GPS unit that also had the data? This would increase both the market to sell into as well as the data source. Plus, just like opentable.com, no driver would buy more than one of these systems, so whoever gets there first has an incredible opportunity to own the market.
What's so interesting for Second Life is that SL is a great place to test the algorithms and security you'd use without having to deal with the problems that come with real-world implementations. My 15 minute del.icio.us mashup is halfway there already. Plus, once you had the real-world data, you could use a SL mirror-world space to visualize, market, and sell the data.