get the user profile key and get the username from linden website + code cleaning
ssm2017 Binder - December 23, 2008 - 14:36
| Project: | Second Life framework |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
hello
here is a new version
this version is using cvs version 1.4.2.3
changements :
- added my name in the readme file
- added the "strip_tags" filter to the "message" output
- added 3 functions
- get the html page profile from the linden web site
- extracts the image key from this profile page
- extracts the username from this profile page
- code cleaned using the "code-style.pl" drupal script
i hope this will help
| Attachment | Size |
|---|---|
| secondlife-1.4.2.3.diff | 6.77 KB |

#1
Patches should be about one functional change, not a mix of unrelated changes.
You need to describe things better: what is a profile page, why is it HTML, ...etc. What value will these key be? ...etc.
#2
what is a profile :
In SecondLife and OpenSim worlds, we are using "profiles".
a "profile" is a page that contains informations about a user.
we can see profiles "inworld" and we can also see profiles on the linden website.
about the profile picture key :
profiles can have a picture to represent the avatar.
every element in these worlds are represented by a unique key called uuid
( http://www.lslwiki.net/lslwiki/wakka.php?wakka=key )
the profile picture is represented by a uuid.
Linden is not providing an easy way to get the uuid from a profile.
The only way that lsl scripters are using is to get the picture from the linden's website
here is an example code in lsl : http://www.lslwiki.net/lslwiki/wakka.php?wakka=LibraryDisplayProfilePic
to get this 'image key' we need to buffer the html page and look for the key inside.
im using this function in some of my scripts and i think that this is a good idea to put it inside this framework to prevent the future coders to dont rewrite it all the time.
about the profile username :
sometimes, we need to get the username from a user uuid key.
sometimes, it is not possible to get it from inworld because of absence of script, lag, bugs...
this function is helping me sometimes to get the username from the profile in the website
if im asking the username to an inworld script and it answered a blank string, im asking to the website.
the 3 functions i/o :
secondlife_get_linden_user_profile($user_key) :
input : a string containing the user uuid key
output : a string containing the html page
secondlife_extract_picture_key($profile_page) :
input : a string containing the profile html page
output : the image profile uuid key
secondlife_extract_username($profile_page) :
input : a string containing the profile html page
output : the profile user name
#3
here is the first of the few separated patches for this post
this one is filtering the output with php strip_tags function because we dont need html tags in secondlife/opensim
#4
here is the second one about the html profile extraction ( see comment #2 )
#5
the last one is for code cleaning