User:Jana Kamachi/Profile

From Second Life Wiki
Jump to navigation Jump to search

If you like this script, or any script I've released, please post on my Talk page, or I'll most likely never see it o: If you want to improve a script, just go for it!


This is not a complete script, its a simple something out of a much more complex script I am working on. Read down below this script for status updates.

Note: First commercial use is http://slexchange.com/modules.php?name=Marketplace&file=item&ItemID=443137

string URL_RESIDENT =   "http://world.secondlife.com/resident/";
default
{
    
    touch_start(integer p){
        llHTTPRequest( URL_RESIDENT + (string)llDetectedKey(0),[HTTP_METHOD,"GET"],"");
    }
    
    http_response(key req,integer stat, list met, string body){
        llSetTexture((key)llGetSubString(body,llSubStringIndex(body,"<img alt=\"profile image\" src=\"http://secondlife.com/app/image/")+llStringLength("<img alt=\"profile image\" src=\"http://secondlife.com/app/image/"),llSubStringIndex(body,"\" class=\"parcelimg\" />")-3),ALL_SIDES);
    }
}

Eventually, it to shall be released. Its functions like a dataserver event. I've lost the script twice thanks to inventory loss, but oh well :) Below is the current defines header, and it shows what it can do atm.

integer REQ_PROFILE    =    0x01; //Profile information. It will automaticly be stripped of html tags.
integer REQ_DISPLAY    =    0x02; //A key for the users profile pick. Returns NULL_KEY if they have none.
integer REQ_PICKS      =    0x03; //Top 5 picks from their profile.
integer REQ_KEY_FIND   =    0x04; //Takes a name and returns a key. Thats right, llName2Key.
integer REQ_FLAGS      =    0x06; //This is a secret ;) Its a bug, which I may or may not report.
integer REQ_NAME       =    0x07; //Their name. You can use this like llKey2Name, but without its limitations.
integer REQ_BORN       =    0x08; //When they were born.

Forum Profile

for llName2Key, I open a search query and then search for

  <a href="http://world.secondlife.com/resident/

And then delete everything up to it. I jump ahead 36 spaces, taking the key. Then I just parse out the name. One fun thing here is if the name ends in a number, the tags are different:

 <span class="l"><b>Jcool410</b> <b>Wildcat</b></span

As opposed to

 <span class="l">Simman Federal</span></a><br>

So you need to keep the string and check for both of these.