Jump to content

How to get agent's name given the UUID (outside SL)


Bruce Liebknecht
 Share

You are about to reply to a thread that has been inactive for 257 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I store agent UUIDs in my database and want to show the current agent legacy or display names on my website given the agent UUID. Is there a way to do this? I searched a lot but can't find a way. Thanks!

I have found how to work around this problem by storing and updating agent's names in my database as well but it is very inefficient this way.

  • Like 1
Link to comment
Share on other sites

<?php
$uuid = "242dc266-7025-4199-bff1-561de2f74011";

$source = file_get_contents('https://world.secondlife.com/resident/'.$uuid);

$dom = new DOMDocument("1.0","UTF-8");
@$dom->loadHTML($source);
$dom->preserveWhiteSpace = false;

//Get Title
$title = $dom->getElementsByTagName('title')->item(0)->nodeValue;


foreach($dom->getElementsByTagName('meta') as $metas) {
    if($metas->getAttribute('name') =='description'){ $description = $metas->getAttribute('content'); }
    if($metas->getAttribute('name') =='keywords'){    $keywords = $metas->getAttribute('content');    }
}

print_r($title);
?>

 

this is a hack job but you should get the idea.. :)

  • Like 1
Link to comment
Share on other sites

That's probably a better way to do it, but I hate scraping web pages and am (irrationally?) suspicious that world.secondlife.com could stop working someday, so I might be tempted to run an in-world http_request() / llHTTPResponse() server (or several) to use llRequestUsername() to field queries from your website—and to update their URLs every CHANGED_REGION_START. That's obviously messy, the website acting as an ersatz registry service for those ephemeral URLs, and handling failover when servers are down. 

I'm sure world.secondlife.com will be Just Fine and I'm only being paranoid.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 257 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...