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 Make_TinyURLs_by_script  

Make_TinyURLs_by_script

* Any URL or data URI can be mapped to a TinyURL. The example above reduces an assigned HTTP-in URL, which is a long one such as:
http://sim4605.agni.lindenlab.com:12046/cap/2b9f06f7-431e-5b0f-9271-2d03bd15370b

into a TinyURL this size:
http://tinyurl.com/y9etul3

Category: Viewer 2
By : Becky Pippen
Created: 2010-09-02 Edited: 2010-09-02
Worlds: Second Life

the Zip file

Download all files for Make_TinyURLs_by_script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Make_TinyURLs_by_script_1.lsl
1 string myTinyURL;
2
3 default
4 {
6 {
8 }
9
10 http_request(key id, string method, string body)
11 {
12 if(method == URL_REQUEST_GRANTED) {
13 // Send our full URL to tinyurl.com for conversion
14 // The answer will come back in http_response()
15 llHTTPRequest("http://tinyurl.com/api-create.php?url=" + body, [], "");
16 } else if(method == "GET") {
17 llHTTPResponse(id, 200, "Hello Real World from the Virtual World");
18 }
19 }
20
21 http_response(key req, integer stat, list met, string body)
22 {
23 myTinyURL = body;
24 llOwnerSay("My HTTP-in TinyURL is: " + myTinyURL + " , Click Me!");
25 }
26 }

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