Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

request details from shoutcast

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-21-2008 13:13
im trying to get this to work and having no luck, it seams like it should im requesting the body of the page but it isnt sending anything, on my server it is saying a Invalid resource request(/7.html)

CODE

default
{
state_entry()
{
llHTTPRequest("http://208.101.149.213:8000/7.html",[],"");
}
//...
http_response(key id, integer status, list metadata, string body)
{
llOwnerSay(body);
}
}
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
12-21-2008 14:17
That is an odd port number. Are you sure it's not meant to be 8080?
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-21-2008 14:34
ya port is right
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
12-21-2008 16:14
A quick whois on the IP address suggests you're running the server on your local computer? You probably just need to open the port on your hardware/software firewall to let Second Life access it.
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-21-2008 16:43
ports are open, i can host and everything, it gets a connections from secondlife but it dosent return anything from body all i see is

object:
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
12-21-2008 17:21
look up a set of PHP scripts called scstats. You need to host these scripts on your server and config them to point to your SC server. Make your httprequest go to the scstats.php file. Edit the online.php and offline.php to show how you want (line breaks etc.). Display the results as floating text or however you want. This works as I have done it myself.
_____________________
There are no stupid questions, just stupid people.
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
Request timed out.
12-21-2008 23:42
I tried your script from SL after I tweaked it a little to this:

CODE

default
{
touch_start(integer total_number)
{
llSay(0,"One moment...");
requestid = llHTTPRequest("http://208.101.149.213:8000/7.html", [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], "");
}

http_response(key request_id, integer status, list metadata, string body)
{
llSay(0,"Here's the response..");
if (request_id == requestid) {
if(status == 499) llSay(0, "Request time out. Please try again.");
else if(status != 200) llSay(0, "An unknown error occured.");
else if(body == "") llSay(0, "body is empty");
else llSay(0,body);
}
}
}



All I got was a status 499 though.
It looks to me there's something wrong with either your server or your firewall.

I also tried the above script on my own server and it works just fine.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
12-22-2008 07:38
This is how I do it, hope it helps.

this script takes a URL, sets the parcel Media Stream and displays the stream info in floating text, updated ever 60 seconds.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
12-22-2008 12:05
From: Mrc Homewood
im trying to get this to work and having no luck, it seams like it should im requesting the body of the page but it isnt sending anything, on my server it is saying a Invalid resource request(/7.html)

CODE

default
{
state_entry()
{
llHTTPRequest("http://208.101.149.213:8000/7.html",[],"");
}
//...
http_response(key id, integer status, list metadata, string body)
{
llOwnerSay(body);
}
}


Try this instead

llHTTPRequest(CurURL+"/7.html HTTP/1.0\nUser-Agent: XML Getter (Mozilla Compatible)\n\n",[],"";);

Where CurURL is your server
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-22-2008 12:16
Look in your HTTP server's error log. Internal errors could easily cause an empty reply or an HTTP error.

EDIT: Oh, yeah. If you're getting timeouts that is most likely a firewall issue.

EDIT EDIT: Oops. But 499 isn't a timeout error, actually. I think SL returns 499 when you have a badly formatted URL and/or when the MIME type/character encoding isn't one it likes or something like that.
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-22-2008 15:22
From: Very Keynes
Try this instead

llHTTPRequest(CurURL+"/7.html HTTP/1.0\nUser-Agent: XML Getter (Mozilla Compatible)\n\n",[],"";);

Where CurURL is your server


worked :) now to make it into a list and pull info out of it :o lol
thanks for all the help