Simon Harriyott

Showing RSS Heading in Second Life

I just met someone in Second Life, at Koz's blogHUD area, where we couldn't get the news screen to work. We got chatting, and she was interested in my "first thing that works" object that reads the first title from an RSS feed in the real world and puts it in the chat window. Honestly, it was just for trying out HTTP requests in the scripting language, nothing of use.

Anyway before a could give her an object with the correct permissions, she vanished. As I'm not going to develop it further for quite a while, I'll post the script as a starter for ten. If anyone (including Pixeleen Mistral) can use it, hoorah, and please let me know how you get on.


key requestid;

default
{
state_entry()
{
}

touch_start(integer total_number)
{
requestid = llHTTPRequest(
"http://feeds.feedburner.com/harriyott/simonssoftwarestuff",
[HTTP_METHOD,"GET"],"");
}

http_response(key request_id, integer status,
list metadata, string body)
{
if (request_id == requestid)
{
list titles = llParseString2List(
body,["<title>", "</title>"],[]);
llSay(0, llList2String(titles,3));
}
}
}


[Tags: ]
13 October 2006