These forums are CLOSED. Please visit the new forums HERE
Alternate to llHTTPRequest? Lower level plaintext? |
|
|
Maui Capalini
Registered User
Join date: 1 Feb 2008
Posts: 3
|
04-23-2008 23:54
I know llHTTPRequest has problems with RSS feeds, amongst other complex web content.. is there an alternate method to just receive the stream as plain text? I don't mind doing the parsing in LSL, but I don't know how to get the HTML without all the complications (and failings) of llHTTPRequest.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-24-2008 01:15
You _are_ receiving the response as plain text - that's the problem.
llHTTPRequest will only receive what it gets as a response, there is no option to "strip tags" or anything like that (which would be nice but seems unlikely to appear). The best solution I have found is to have your own server, with a proxy script in PHP or whatnot which reads the page that you want, parses it, and sends the information back to your LSL script. Then you call your proxy from LSL instead of the original page. So, for example, instead of requesting a page with the latest cricket scores, you write a proxy which requests the page, parses it, grabs the cricket scores and turns them into a nice CSV or some such. Then your LSL script calls that proxy and gets only the information it needs. _____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names |
|
Maui Capalini
Registered User
Join date: 1 Feb 2008
Posts: 3
|
04-24-2008 01:34
Maybe I misunderstand something else then..? I've tried loading some XML pages from within SL, only to see "Unsupported or unknown Content-Type." If it were coming in as plaintext, shouldn't I just see the stream of XML?
For example, if I try to load the page http://twitter.com/statuses/show/792410100.xml , I just get the error message. Putting that into my web browser properly shows the XML. Even looking at the page source shows nothing complicated. This makes me think llHTTPRequest is doing SOME type of pre-processing for the action to fail. |
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
04-24-2008 06:29
Don't know, whether this is working, but I had the same Problem calling some Radio-Stats page which is in XML-Format as well.
I had to do the call like this: CODE
The important part here is: HTTP/1.0\nUser-Agent: XML Getter (Mozilla Compatible)\n\n HTH |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
04-24-2008 11:16
SL sends the HTTP request header "Accept: text/*". Maybe the web server is having an issue interpreting that, or maybe LSL is having an issue with the actual Content-Type the web server is sending back (e.g. "application/rss+xml"
. If possible, you could setup your own little proxy script on your own web server to change the Content-Type header to "text/plain" and see if that makes a difference. |
|
Maui Capalini
Registered User
Join date: 1 Feb 2008
Posts: 3
|
04-24-2008 12:45
Haruku, I tried adding the extra info to my URL string, but still no luck.
Hewee/Ordinal, as it is, I do have it setup to hit a proxy server which parses the XML for me, as it's the only way I've been able to get it to work. My original question was an attempt to avoid this method, and have SL get the information directly from the source. |