Free name2key database download and lookup facility
|
|
Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
|
05-17-2006 07:04
I recently asked a question on the Second Life Answers forum about the possibility of seeing an LSL name2key function in the future to enable retrieval of avatar keys from avatar names. The post is here. It looks like it might come at some point, but as to when, who knows. In view of this I've decided to open up my name2key database, both for download and also for direct queries either via. HTTP or Email - for free  . The full CSV download (available as either .gz or .zip) is updated daily. Currently I have around 104,200 keys in the database and it's being kept as up to date as possible, via. my own data and also periodically pulling in data from other sources. Expect coverage to drop over time though as Second Life expands ever quicker - it's pretty impossible to keep up. For more information please see: http://www.moopf.com/name2key.php Now if demand is really high for this, to the point of it having an impact on my servers, then I may have to pull the HTTP and Email facilities, and bear in mind that these are very simple interfaces currently and it's possible they may change in the future. Anyway, I'm really keen to see LL implement something directly but, until then please make use of my service if you want to. Any questions, bugs, problems, issues, just either post here, PM me on the forum, IM me in-world or email me from my web site. PS> I posted it here as I figure that scripters are the only people who really need this facility 
|
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-17-2006 07:15
Neato, two things:
1) Are all these keys verified to be correct, i.e., tested by in-world scripts? 2) Does this include other two databases? w-hat.com/name2key and ulrikasheim.org/tools/name2key.html
|
|
Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
|
05-17-2006 07:32
From: Keknehv Psaltery Neato, two things: 1) Are all these keys verified to be correct, i.e., tested by in-world scripts? 2) Does this include other two databases? w-hat.com/name2key and ulrikasheim.org/tools/name2key.html 1. I've been using it for gift deliveries on my own vendors for a long while now and the majority of data has come directly from myself. I'd be suprised if there weren't some examples of records being incorrect, such as name changes, but it's been successfully used in my gift vendors without problem (and I've been seeing a lot of gift purchases of my Skoopf skates, for instance) 2. I periodically use the w-hat.com one, but not ulrikasheim.org as that seems considerably out of date now. In addition I've been pulling data from slboutique.com's avatar keys output.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
05-17-2006 09:56
Good to see you're still around Moopf. It's good that there are now two services offering this.
BTW, the zip archive link doesn't work.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
|
05-17-2006 10:18
From: Strife Onizuka Good to see you're still around Moopf. It's good that there are now two services offering this. BTW, the zip archive link doesn't work. Hi Strife, zip link should now be sorted - thanks for pointing that out. I didn't realise there was another free lookup service? Do you have a link to more information about it? It would be good if people could pool their databases as it will aid coverage on different name2key services so I'd be interested to know who else is doing this. I know Rathe Underthorn had a paid for service that I used for a while.
|
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
05-17-2006 13:15
<3!!
|
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
05-17-2006 13:56
Moopf, you are a lifesaver (the chery kind, probably). I had a nice little db of 200+ customers of a product of mine, and I need to send a new version out. W-hat's database could only get me keys on like 60% of them... yours got me keys on all but ten. That's totally awesome. I can do ten by hand.
|
|
Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
|
05-17-2006 23:03
From: Lex Neva Moopf, you are a lifesaver (the chery kind, probably). I had a nice little db of 200+ customers of a product of mine, and I need to send a new version out. W-hat's database could only get me keys on like 60% of them... yours got me keys on all but ten. That's totally awesome. I can do ten by hand. Glad it came in useful for you Lex 
|
|
Zing Ping
Registered User
Join date: 3 Jul 2006
Posts: 8
|
07-03-2006 11:54
Anyone got a sample script to use Moopf's lookup service?
|
|
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
|
07-03-2006 20:38
Here you go: integer handler = 0; key request = NULL_KEY;
default { touch_start(integer num_detected) { if (llDetectedKey(0) == llGetOwner()) { llSetTimerEvent(30.0); llOwnerSay("Listening for 30 seconds, please say the avatar name to lookup"); handler = llListen(0, "", llGetOwner(), ""); } } timer() { if (handler != 0) { llOwnerSay("Listener timeout!"); llListenRemove(handler); handler = 0; } } listen(integer channel, string name, key id, string message) { llListenRemove(handler); handler = 0; llSetTimerEvent(0.0); llOwnerSay("Recieved request, contacting server . . . "); request = llHTTPRequest("http://www.sldata.com/public/name2key/query.php?avname=" + llEscapeURL(message), [], ""); } http_response(key request_id, integer status, list metadata, string body) { if (request_id == request) { list temp = llCSV2List(body); if ((integer) llList2String(temp, 1) == -1) { llOwnerSay(llList2String(temp, 0) + "'s key is not in the database"); } else { llOwnerSay(llList2String(temp, 0) + "'s key is '" + llList2String(temp, 1) + "'"); } } } }
|
|
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
07-03-2006 21:45
Thank you! I finally got that working, now I'm trying to merge the capabilities of another script into this one. I have a notecard reading script that has a list of the names of people who have bought my Trivia Stadium. I have an update coming out soon and would like to look up all their names and send them an update. Here's my notecard reading script: string notecardName = "Avatars"; integer lineCounter; key dataRequestID;
default { state_entry() { llSay(0, "Click to read notecard."); } touch_start(integer num_detected) { state readNotecard; } } state readNotecard { state_entry() { lineCounter = 0; dataRequestID = llGetNotecardLine(notecardName, lineCounter); } dataserver(key queryid, string data) { if (dataRequestID) { if (data != EOF) { llSay(0, "Line #" + (string)lineCounter + ": " + data); lineCounter += 1; dataRequestID = llGetNotecardLine(notecardName, lineCounter); } else { state default; } } } } How can I get the script to do a key lookup for each line it reads? I'll add timers in to slow it down to avoide the throttle. I just need the script above to read each line, and then allow me to lookup the key for the name on each line and do something with that data before pausing and moving onto the next line. I'll also add code to create a list of names that it couldn't a key for, which would be spit out at the end. I can do all that but get it to do the name2key query with every line.  Any help would be greatly appreciated!
|
|
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
|
07-03-2006 23:27
each time you get a name from a line you call the llHTTPRequest function from above . . . then do nothing until you get a http_response event in which you do whatever you want with the data then sleep to avoid the filter and finally call for the next notecard line.
|
|
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
07-04-2006 16:33
Lol. I'm a hack. Here's my code (that doesn't work). It's a mix of three different scripts found on the wiki and here in the forums. string notecardName = "Avatars"; integer lineCounter; key dataRequestID; key requestid; string resident; string msg;
default { state_entry() { llSay(0, "Ready. Click to start."); } touch_start(integer num_detected) { state readNotecard; } }
state readNotecard { state_entry() { lineCounter = 0; dataRequestID = llGetNotecardLine(notecardName, lineCounter); } dataserver(key queryid, string data) { if (dataRequestID) {
if (data != EOF) { llSay(0, "Line #" + (string)lineCounter + ": " + data); lineCounter += 1;
resident = data; llSay(0,"resident = " + resident); requestid = llHTTPRequest("http://www.sldata.com/public/name2key/query.php?avname="+resident,[HTTP_METHOD,"GET"],"");
dataRequestID = llGetNotecardLine(notecardName, lineCounter); } else { state default; } } }
http_response(key request_id, integer status, list metadata, string body) { integer i; if (request_id == requestid) { if ( ( i = llSubStringIndex(body,resident) ) != -1 ) llSay(0,llGetSubString(body,i,i+llStringLength(resident)+31)); else llSay(0,"No one named\""+resident+"\" found in the database"); } else llSay(0,(string)status+" error"); } } ANY help would be greatly appreciated.
|
|
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
|
07-04-2006 16:45
not tested in world at all but it should compile. Make sure you use consistant spacing/indentation for such an issue as it's so much easier to figure out what went wrong if you have a consistant coding style. string notecardName = "Avatars"; integer lineCounter; key dataRequestID; key requestid;
default { state_entry() { llSay(0, "Ready. Click to start."); } touch_start(integer num_detected) { state readNotecard; } }
state readNotecard { state_entry() { lineCounter = 0; dataRequestID = llGetNotecardLine(notecardName, lineCounter); } dataserver(key queryid, string data) { if (dataRequestID) { if (data != EOF) { llSay(0, "Line #" + (string)lineCounter + ": " + data); lineCounter += 1; llSay(0,"resident = " + data); requestid = llHTTPRequest("http://www.sldata.com/public/name2key/query.php?avname=" + llEscapeURL(data), [], ""); } else { llSay(0, "End of file reached"); state default; } } } http_response(key request_id, integer status, list metadata, string body) { if (request_id == requestid) { list temp = llCSV2List(body); if ((integer) llList2String(temp, 1) == -1) { llOwnerSay(llList2String(temp, 0) + "'s key is not in the database"); } else { llOwnerSay(llList2String(temp, 0) + "'s key is '" + llList2String(temp, 1) + "'"); } llSleep(0.2); dataRequestID = llGetNotecardLine(notecardName, lineCounter); } else { llSay(0, (string) status + " error."); } } }
|