Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Parcel Web Browser

Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
03-13-2008 23:06
Note: This script is only usable starting from SL viewer 1.19.1.1 RC

From: someone

//Parcel Web Browser v1.1
//(C) Antonius Misfit 2008
//Licensed under the terms of the GNU GPLv3 or later
//for the "prim preview" feature to work,
//set the appropriate texture on the front
//according to your parcel's web settings
string home_url="http://secondlife.com";//home URL
string current_url;
default
{
state_entry()
{
llListen(0,"",llGetOwner(),"";);
}
//touch to load the webpage in the in-world browser
touch_start(integer total_number)
{
llLoadURL(llDetectedKey(0),"Load live browser instance for "+current_url+"?",current_url);
}

listen(integer channel,string name,key id,string message)
{
//Say "Go http://yourwebsite.com" to preview on a prim
if(llGetSubString(message,0,1)=="Go";)
{
current_url=llStringTrim(llGetSubString(message,2,llStringLength(message)-1),STRING_TRIM);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
//go to your home URL
if(message=="Home";)
{
current_url=home_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
}
}

Update: fixed a bug where the media url is prepended with a space, and wouldn't load properly in an external browser.
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Library bump
03-15-2008 08:54
:)
_____________________
i've got nothing. ;)
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
Update to Parcel Web Browser
03-31-2008 11:14
I've updated the code. It's a bit cleaner now, using llParseString2List instead of relying on llGetSubString to parse commands:
From: someone

//Parcel Web Browser v1.2
//(C) 2008 Antonius Misfit
//Licensed under the terms of the GNU GPLv3 or later
//for the "prim preview" feature to work,
//set the appropriate texture on the front
//according to your parcel's web settings
string home_url="http://secondlife.com";//home URL
string current_url;
default
{
state_entry()
{
llListen(0,"",llGetOwner(),"";);
}
//touch to load the webpage in the in-world browser
touch_start(integer total_number)
{
llLoadURL(llDetectedKey(0),"Load live browser instance for "+current_url+"?",current_url);
}

listen(integer channel,string name,key id,string message)
{
list args=llParseString2List(message,[" "],[]);
//Say "Go http://yourwebsite.com" to preview on a prim
if(llList2String(args,0)=="Go";)
{
current_url=llList2String(args,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
//go to your home URL
if(message=="Home";)
{
current_url=home_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
}
}

Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
03-31-2008 11:52
How about a one-liner saying what it does? "Parcel Web Browser" suffers from ambiguous associativity. Is it a web browser for browsing various parcels? A web browser for browsing the things on a given parcel? A web browser that is tied to a particular parcel in some ways?

My intuition says that "parcel" is only relevant as an artifact of the implementation, i.e. it uses llParcelMediaCommandList. This makes me think that the word "parcel" isn't really relevant.
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
03-31-2008 12:09
From: Kidd Krasner
How about a one-liner saying what it does? "Parcel Web Browser" suffers from ambiguous associativity. Is it a web browser for browsing various parcels? A web browser for browsing the things on a given parcel? A web browser that is tied to a particular parcel in some ways?

My intuition says that "parcel" is only relevant as an artifact of the implementation, i.e. it uses llParcelMediaCommandList. This makes me think that the word "parcel" isn't really relevant.

It's an Internet browser script for your land that uses the new "webpage on a prim" and pop-up inworld browser features in the latest RC viewer.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
05-11-2008 20:37
Jeez, Kid, a bit nit picky today...lol, how about 'parcel media web browser'.
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
05-11-2008 22:48
From: Johan Laurasia
Jeez, Kid, a bit nit picky today...lol, how about 'parcel media web browser'.

Not today, nor yesterday, but rather several weeks ago.

But I stand by my original comment. This is a web browser script. Calling it a 'parcel web browser' or 'parcel media web browser' is like calling a notecard giver script a 'notecard give inventory' script.

Antonius's response to my note is just fine. A statement like that should be the norm for library submissions, with rare exceptions.
Taft Worsley
Registered User
Join date: 6 Aug 2006
Posts: 4
05-18-2008 08:25
Doesn't seem to work properly - no matter whats its called
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
05-18-2008 09:05
works for me, try deleteing the script and creating a new one
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
05-26-2008 23:53
Any way to get display the forum page forums.secondlife.com and not have the bottom of the page cut off?
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
06-01-2008 21:11
From: SuezanneC Baskerville
Any way to get display the forum page forums.secondlife.com and not have the bottom of the page cut off?


Unfortunately, scrolling isn't implemented with the "webpage on a prim" feature yet. The Lindens need to fix that problem. That's one reason why I put in the llLoadURL calls when touching the prim. BTW, the code has gone through some more changes, most notably being able to do a search with "Search yoursearchterm":

From: someone

//Parcel Web Browser v2.4
//(C) Antonius Misfit 2008
//Licensed under the terms of the GNU GPLv3 or later
//for the "prim preview" feature to work,
//set the appropriate texture on the front
//according to your parcel's web settings
string home_url="http://secondlife.com";
string prev_url="";
string current_url;
string next_url="";
string search_string="http://www.google.com/search?q=";
default
{
on_rez(integer start_params)
{
llResetScript();
}
state_entry()
{
llListen(0,"",llGetOwner(),"";);
}

touch_start(integer total_number)
{
llLoadURL(llDetectedKey(0),"Load live browser instance for "+current_url+"?",current_url);
}

listen(integer channel,string name,key id,string message)
{
list args=llParseString2List(message,[" "],[]);
if(llList2String(args,0)=="Go";)
{
prev_url=current_url;
current_url=llList2String(args,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Home";)
{
prev_url=current_url;
current_url=home_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Back";)
{
next_url=current_url;
current_url=prev_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Next";)
{
current_url=next_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(message=="Reload";)
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Search";)
{
prev_url=current_url;
current_url=search_string+llList2String(args,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
}
}

SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
06-01-2008 21:49
I wasn't thinking of scrolling, I was wondering if there is a way to get it to display the entire page.

For example, if you use a browser on a monitor in portrait mode, you can display more vertically than you can with a landscape mode monitor, without scrolling.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
06-02-2008 00:23
From: SuezanneC Baskerville
I wasn't thinking of scrolling, I was wondering if there is a way to get it to display the entire page.

For example, if you use a browser on a monitor in portrait mode, you can display more vertically than you can with a landscape mode monitor, without scrolling.

I just IMed you in-world about that problem, but I'll repeat my answer here; you might get the effect desired by manually setting the media size(in pixels) at the Media tab in "About Land". For some reason I can't do that(maybe a bug in the Linux viewer), but you may have better luck. In any case, it may be best to simply think of the static page on the prim as a sort of page preview, and wait until the Lindens improve the implementation.
Front Dawes
Registered User
Join date: 28 Oct 2007
Posts: 76
06-02-2008 02:01
I have been looking at webpages on a prim, particularly those that display webcams. I have been berated in the Resident Answers forum for wanting to put webpages onto a prim, 'why not just fire up your browser and save us all the precious bandwidth that your ill-conceived ideas consume?'.

As I do not know the ins and outs of this, can some of you savvy people in the scripting forum explain the effects of web-on-a-prim on lag? And whether the effects are much worse depending on the content of the web page (e. g. a static page, as opposed to a page with scrolling text or animated gifs on it, or a page with a video clip on it).

Much obliged,

Front
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
06-02-2008 10:47
From: Front Dawes

As I do not know the ins and outs of this, can some of you savvy people in the scripting forum explain the effects of web-on-a-prim on lag? And whether the effects are much worse depending on the content of the web page (e. g. a static page, as opposed to a page with scrolling text or animated gifs on it, or a page with a video clip on it).

Much obliged,

Front


As it stands right now, the Lindens' implementation leaves much to be desired:

1. Can't watch Flash or Quicktime movies on a page.
2. Can't click on links in a page.
3. Can't enter form data.
4. Can't scroll around pages.

All the more reason I made the script to pop up an external browser. But it's not all bad. Animated GIFs and some scripting on a page works(I tested with SL Exchange homepage). And the lag effects of plain web-on-a-prim are pretty much the same as with streaming Quicktime since it only affects the viewer playing the media.
Kulalyle Anatine
Resident
Join date: 28 Jul 2007
Posts: 4
concept of web on a prim
08-02-2008 23:43
i think the concept is so multiple people can see the web pag or come accross the prim
to view then luanch web page in a browser or jusst to look at it
Sandie Rhode
Registered User
Join date: 4 Dec 2007
Posts: 3
08-20-2008 14:05
this script (any version of it) its not working in world..it does not detect and chat commands, and will not change the parcel media for some reason...and the webpage wont load in a browser when touched....but i cant work out why!..i have the texture set in the media and have the same texture on the prim...

web on a prim works fine if i add the address to the media manually...but not through the script

anyone got any thoughts on this?
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
08-22-2008 20:48
From: Sandie Rhode
this script (any version of it) its not working in world..it does not detect and chat commands, and will not change the parcel media for some reason...and the webpage wont load in a browser when touched....but i cant work out why!..i have the texture set in the media and have the same texture on the prim...

web on a prim works fine if i add the address to the media manually...but not through the script

anyone got any thoughts on this?


if you are on group land, the object needs to be deeded to the group
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
09-02-2008 22:13
From: Ruthven Willenov
if you are on group land, the object needs to be deeded to the group

And you must have the appropriate group tag active to issue chat commands, too. Oh, and I've upgraded the script yet again, adding the ability to set the music stream. And it's been renamed "Parcel Media Manager" to reflect the added functionality:
From: someone

//Parcel Media Manager v1.0
//(C) Antonius Misfit 2008
//Licensed under the terms of the GNU GPLv3 or later
//for the "prim preview" feature to work,
//set the appropriate texture on the front
//according to your parcel's web settings
string home_url="http://secondlife.com";
string prev_url="";
string current_url;
string next_url="";
string search_string="http://www.google.com/search?q=";
default
{
on_rez(integer start_params)
{
llResetScript();
}
state_entry()
{
llSetObjectName("Parcel Media Manager - "+llKey2Name(llGetOwner()));
//to make browser commands usable by anyone, change llGetOwner() to ""
llListen(0,"",llGetOwner(),"";);
}

touch_start(integer total_number)
{
llLoadURL(llDetectedKey(0),"Load live browser instance for "+current_url+"?",current_url);
}

listen(integer channel,string name,key id,string message)
{
list args=llParseString2List(message,[" "],[]);
if(llList2String(args,0)=="Go";)
{
prev_url=current_url;
current_url=llList2String(args,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Home";)
{
prev_url=current_url;
current_url=home_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Back";)
{
next_url=current_url;
current_url=prev_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Next";)
{
current_url=next_url;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(message=="Reload";)
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="Search";)
{
prev_url=current_url;
current_url=search_string+llList2String(args,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,current_url]);
}
if(llList2String(args,0)=="SetHome";)
{
home_url=llList2String(args,1);
}
if(llList2String(args,0)=="SetMusic";)
{
llSetParcelMusicURL(llList2String(args,1));
llSay(0,"Music stream set to "+llList2String(args,1));
}
}
}
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-09-2008 14:20
hmm, something i haven't really thought about. i'm sure it's been done. how do you make group objects communicate to each other? and what if the object has a owner only function? does that also give anyone in the group access to it?