-------------------------------------------------- THIS IS THE CODE THAT GOES INTO A SECOND LIFE PRIM -------------------------------------------------- // // P. Fishwick Feb. 2008 // Basic weather orb // key requestid; string NUM; float temp; float red; float blue; vector color; float min=32.0; float max=100.0; default { state_entry() { } touch_start(integer total_number) { llSetTimerEvent(30); } timer() { requestid = llHTTPRequest("http://cero11.cise.ufl.edu/~metaphorz/php/weather.php",[HTTP_METHOD, "GET"],""); } http_response(key request_id, integer status, list metadata, string body) { if (request_id == requestid) { temp = (float) body; // llSay(0,body); if ((temp > min) && (temp < max) ) { llSetText(body,<0,0,0>,1.0); red = (temp - min)/(max-min); blue = 1.0 - red; color = ; llSetColor(color,ALL_SIDES); } } } } ------------------------------------------ THIS IS THE CODE THAT GOES ON YOUR SERVER: ------------------------------------------ 100) { // Get temperature unit C or F $spos = strpos($wrss,'yweather:units temperature="')+strlen('yweather:units temperature="'); $epos = strpos($wrss,'"',$spos); if ($epos>$spos){ $tempu = substr($wrss,$spos,$epos-$spos); } // $spos = strpos($wrss,'yweather:wind chill="')+strlen('yweather:wind chill="'); $spos = strpos($wrss,'°')-3; // $epos = strpos($wrss,'"',$spos); $epos = $spos +2; if ($epos>$spos){ $temp += substr($wrss,$spos,$epos-$spos); } else { $temp = '-'; } // Get city name $spos = strpos($wrss,'yweather:location city="')+strlen('yweather:location city="'); $epos = strpos($wrss,'"',$spos); if ($epos>$spos) { $city = substr($wrss,$spos,$epos-$spos); } } return $temp; } print(processWeather('http://rss.weather.com/weather/rss/local/32608?cm_ven=LWO&cm_cat=rss&par=LWO_rss')); ?>