Difference between revisions of "User:Jana Kamachi/Profile"

From Second Life Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Jana}}
{{Jana}}
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.
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
<pre>
<pre>
string URL_RESIDENT =  "http://world.secondlife.com/resident/";
string URL_RESIDENT =  "http://world.secondlife.com/resident/";
Line 26: Line 28:
integer REQ_BORN      =    0x08; //When they were born.
integer REQ_BORN      =    0x08; //When they were born.
</pre>
</pre>
== Forum Posts ==
for llName2Key, I open a search query and then search for
<pre>
  <a href="http://world.secondlife.com/resident/
</pre>
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:
<pre>
<span class="l"><b>Jcool410</b> <b>Wildcat</b></span
</pre>
As opposed to
<pre>
<span class="l">Simman Federal</span></a><br>
</pre>
So you need to keep the string and check for both of these.

Latest revision as of 13:59, 25 November 2007

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 Posts

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.