Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Viewer 2 llSetPrimMediaParams_using_HTTPIn  

llSetPrimMediaParams_using_HTTPIn

llSetPrimMediaParams_using_HTTPIn

Category: Viewer 2
By : Kelly Linden
Created: 2010-09-02 Edited: 2010-09-02
Worlds: Second Life

the Zip file

Download all files for llSetPrimMediaParams_using_HTTPIn
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. llSetPrimMediaParams_using_HTTPIn_1.lsl
1 show(string html)
2 {
3 html = "data:text/html," + llEscapeURL(html);
4 llSetPrimMediaParams(0, // Side to display the media on.
5 [PRIM_MEDIA_AUTO_PLAY,TRUE, // Show this page immediately
6 PRIM_MEDIA_CURRENT_URL,html, // The url currently showing
7 PRIM_MEDIA_HOME_URL,html, // The url if they hit 'home'
8 PRIM_MEDIA_HEIGHT_PIXELS,512, // Height/width of media texture will be
9 PRIM_MEDIA_WIDTH_PIXELS,512]); // rounded up to nearest power of 2.
10 }
11
12 string replace_all(string src, string target, string replace)
13 {
14 return llDumpList2String(llParseString2List(src,[target],[]),replace);
15 }
16
17 string get_query(key id, string name)
18 {
19 string query = llGetHTTPHeader(id,"x-query-string");
20 query = replace_all(query,"+"," ");
21 query = llUnescapeURL(query);
22 list q = llParseString2List(query,["=","&",";"],[]);
23 integer i = llListFindList(q,[name]);
24 if(i != -1)
25 {
26 return llList2String(q,i+1);
27 }
28
29 return "";
30 }
31
32 default
33 {
35 {
36 show("<h1>This is a test</h1><h2>This is a test</h2><h3>This is a test</h3>");
38 }
39
40 http_request(key id, string method, string body)
41 {
42 if(method == URL_REQUEST_GRANTED)
43 {
44 show("<h1><a href='" + body + "/?get=owner'>Owner ID</a><br><br><a href='" + body + "/?get=object'>Object ID</a></h1>");
45 }
46 else if(method == "GET")
47 {
48 string get = get_query(id,"get");
49 if(get == "owner")
50 {
51 llHTTPResponse(id,200,"Owner is: " + (string)llGetOwner());
52 }
53 else if(get == "object")
54 {
55 llHTTPResponse(id,200,"Object is: " + (string)llGetKey());
56 }
57 else
58 {
59 llHTTPResponse(id,400,"huh?");
60 }
61 }
62 }
63 }
64

Back to the Best Free Tools in Second Life and OpenSim.