Name2Key+Generator

code //Name2Key Generator

integer SERVICE_NAME2KEY       = 19790; integer SERVICE_NAME2KEY_RET   = 19791;

string proxy                   = "http://66.196.80.202/babelfish/translate_url_content?&intl=us&lp=fr_en&trurl="; string search                  = "http://search.secondlife.com/client_search.php?session=00000000-0000-0000-0000-000000000000&q="; string result                  = "secondlife:///app/agent/"; string notfound                = "There were no matches for ";

list   requests;

default {   on_rez(integer i) { llResetScript; }

state_entry {       requests = []; }

link_message(integer s, integer n, string m, key i)   { if (n == SERVICE_NAME2KEY) { if(llListFindList(requests,[m]) == -1) { list Args=llParseString2List(m, [" "], []);

string FirstName = llList2String(Args, 0); string LastName = llList2String(Args, 1);

string url = proxy+llEscapeURL(search)+FirstName+"%2520"+LastName;; key id = llHTTPRequest(url, [], ""); requests += [(string)id,m]; }       }    }

http_response(key request_id, integer status, list metadata, string body) {       integer p = llListFindList(requests,[(string)request_id]); if (p != -1) { string n = llList2String(requests,p+1); integer f = llSubStringIndex(body,result); if(f == -1) { f = llSubStringIndex(body,notfound); if(f == -1) llMessageLinked(LINK_SET,SERVICE_NAME2KEY_RET,"Error with lookup!",NULL_KEY); else llMessageLinked(LINK_SET,SERVICE_NAME2KEY_RET,n+" not found.",NULL_KEY); } else { f += llStringLength(result); string a = llGetSubString(body,f,f+35);

llMessageLinked(LINK_SET,SERVICE_NAME2KEY_RET,n,(key)a); }           requests = llDeleteSubList(requests,p,p+1); }   } }

code