This is what is on the reno shell for the php of the code:
/******************************************************************************
*
* User configuration section. Please read included comments.
*
*****************************************************************************/
// Set the zipecode below to the zipcode you wish to gather weather information for.
$zip = "89502";
// Set the $units variable to 'f' for Fahrenheit or 'c' for Celsius.
$units = "f";
// If you are following the instructions then this variable should not need changing.
$file = 'mux2.10/game/text/weather.txt';
/******************************************************************************
*
* No configuration is required beyond this point.
*
*****************************************************************************/
$feed = 'http://weather.yahooapis.com/forecastrss?p=' . $zip . '&u=' . $units;
$content = file_get_contents( $feed );
$rss = simplexml_load_string( $content );
if( !$rss ) die( 'Failed to retrieve RSS Weather feed' );
$copyright = $rss->channel->copyright;
$base = $rss->channel->children( "http://xml.weather.yahoo.com/ns/rss/1.0" );
foreach( $base as $x => $base_item )
foreach( $base_item->attributes() as $k => $attr )
$channel[$x][$k] = $attr;
$base = $rss->channel->item->children( "http://xml.weather.yahoo.com/ns/rss/1.0" );
foreach( $base as $x => $base_item ) {
foreach( $base_item->attributes() as $k => $attr ) {
if( $k == 'day' ) $day = $attr;
if( $x == 'forecast' ) { $forecast[$x][$day . ''][$k] = $attr; }
else { $forecast[$x][$k] = $attr; }
}
}
$fr = fopen( $file, 'w' );
fputs( $fr, "&help\n" );
fputs( $fr, "Raw weather data for weather code.\n" );
$items = array( "units", "wind", "atmosphere", "astronomy" );
foreach( $items as $x ) {
@fputs( $fr, "\n& " . $x . "\n" );
foreach( $channel[$x] as $val ) {
@fputs( $fr, $val . ';' );
}
}
fputs( $fr, "\n& condition \n" );
foreach( $forecast['condition'] as $key => $val ) {
if ( $key == "date" ) {
@fputs( $fr, strtotime( $val ) . ';' );
} else {
@fputs( $fr, $val . ';' );
}
}
$count = 1;
foreach( $forecast['forecast'] as $x => $y ) {
fputs( $fr, "\n& forecast" . $count . " \n" );
foreach( $forecast['forecast'][$x] as $key => $val ) {
if ( $key == "date" ) {
@fputs( $fr, strtotime( $val ) . ';' );
} else {
@fputs( $fr, $val . ";" );
}
}
$count++;
}
@fclose( $fr );
?>
This is what is on darkwater for the soft code:
&L.CATS Weather Code Framework=units;wind;atmosphere;astronomy;condition;forecast1;forecast2
&L.CATS-UNITS Weather Code Framework=temperature;distance;pressure;speed
&L.CATS-WIND Weather Code Framework=chill;direction;speed
&L.CATS-ASTRONOMY Weather Code Framework=rising;setting
&L.CATS-CONDITION Weather Code Framework=text;code;temperature;date
&L.CATS-FORECAST1 Weather Code Framework=day;date;low;high;text;code
&L.CATS-FORECAST2 Weather Code Framework=day;date;low;high;text;code
&FN.CONVERT-WIND Weather Code Framework=switch(1,and(gte(%0,11.25),lte(%0,33.75)),NNE,and(gte(%0,33.75),lte(%0,56.25)),NE,and(gte(%0,56.65),lte(%0,78.75)),ENE,and(gte(%0,78.75),lte(%0,101.25)),E,and(gte(%0,101.25),lte(%0,123.75)),ESE,and(gte(%0,123.75),lte(%0,146.25)),SE,and(gte(%0,146.25),lte(%0,168.75)),SSE,and(gte(%0,168.75),lte(%0,191.25)),S,and(gte(%0,191.25),lte(%0,213.75)),SSW,and(gte(%0,213.75),lte(%0,236.25)),SW,and(gte(%0,236.25),lte(%0,258.75)),WSW,and(gte(%0,258.75),lte(%0,281.25)),W,and(gte(%0,281.25),lte(%0,303.75)),WNW,and(gte(%0,303.75),lte(%0,326.25)),NW,and(gte(%0,326.25),lte(%0,348.75)),NNW,or(and(gte(%0,348.75),lte(%0,360)),and(gte(%0,0),lte(%0,11.25))),N,ERR)
&I.FILE Weather Code Framework=weather
&FN.GETTEMP Weather Code Framework=setq(0,extract(textfile(v(I.FILE),condition),3,1,;))[switch(extract(textfile(v(I.FILE),units),1,1,;),F,%q0 F %([round(fdiv(sub(%q0,32),1.8),2)] C%),C,%q0 C %([round(add(mul(%q0,1.8),32),2)] F%))]
&FN.GETSHORTTEMP Weather Code Framework=setq(0,extract(textfile(v(I.FILE),condition),3,1,;))[switch(extract(textfile(v(I.FILE),units),1,1,;),F,%q0 F,C,%q0 C)]
&FN.GETCONDITION Weather Code Framework=extract(textfile(v(I.FILE),condition),1,1,;)
&FN.GETCODE Weather Code Framework=extract(textfile(v(I.FILE),condition),2,1,;)
&FN.GETDATE Weather Code Framework=extract(textfile(v(I.FILE),condition),4,1,;)
&FN.GETSUNRISE Weather Code Framework=extract(textfile(v(I.FILE),astronomy),1,1,;)
&FN.GETSUNSET Weather Code Framework=extract(textfile(v(I.FILE),astronomy),2,1,;)
&FN.GETWIND Weather Code Framework=setq(0,textfile(v(I.FILE),wind))[setq(1,extract(%q0,3,1,;))][setq(2,extract(%q0,2,1,;))][switch(setr(3,extract(textfile(v(I.FILE),units),4,1,;)),mph,%q1 [ucstr(%q3)] [u(FN.CONVERT-WIND,%q2)] %([round(mul(%q1,1.609344),2)] KPH%),kph,%q1 [ucstr(%q3)] [u(FN.CONVERT-WIND,%q2)] %([round(fdiv(%q1,1.609344),2)] MPH%))]
&FN.GETSHORTWIND Weather Code Framework=setq(0,textfile(v(I.FILE),wind))[setq(1,extract(%q0,3,1,;))][setq(2,extract(%q0,2,1,;))][switch(setr(3,extract(textfile(v(I.FILE),units),4,1,;)),mph,%q1 [ucstr(%q3)] [u(FN.CONVERT-WIND,%q2)],kph,%q1 [ucstr(%q3)] [u(FN.CONVERT-WIND,%q2)])]
&FN.GETWINDCHILL Weather Code Framework=setq(0,extract(textfile(v(I.FILE),wind),1,1,;))[setq(1,extract(textfile(v(I.FILE),units),1,1,;))][switch(%q1,F,%q0 F %([round(fdiv(sub(%q0,32),1.8),2)] C%),C,%q0 C %([round(add(mul(%q0,1.8),32),2)] F%))]
&FN.GETSHORTWINDCHILL Weather Code Framework=setq(0,extract(textfile(v(I.FILE),wind),1,1,;))[setq(1,extract(textfile(v(I.FILE),units),1,1,;))][switch(%q1,F,%q0 F,C,%q0 C)]
&FN.GETVIS Weather Code Framework=[setq(0,extract(textfile(v(I.FILE),atmosphere),2,1,;))][setq(1,extract(textfile(v(I.FILE),units),2,1,;))][switch(%q1,mi,%q0 Miles %([round(mul(%q0,1.609344),2)] KM%),km,%q0 Kilometers %([round(fdiv(%q0,1.609344),2)] MI%))]
&FN.GETSHORTVIS Weather Code Framework=[setq(0,extract(textfile(v(I.FILE),atmosphere),2,1,;))][setq(1,extract(textfile(v(I.FILE),units),2,1,;))][switch(%q1,mi,%q0 Miles,km,%q0 Kilometers)]
&FN.GETHUMIDITY Weather Code Framework=[extract(textfile(v(I.FILE),atmosphere),1,1,;)]%%
&FN.GETPRES Weather Code Framework=[extract(textfile(v(I.FILE),atmosphere),3,1,;)][extract(textfile(v(I.FILE),units),3,1,;)]
&FN.GETPRESSTATE1 Weather Code Framework=switch(extract(textfile(v(I.FILE),atmosphere),4,1,;),0,=,1,^,2,v,=)
&FN.GETPRESSTATE2 Weather Code Framework=extract(textfile(v(I.FILE),atmosphere),4,1,;)
&FN.GETFORECAST Weather Code Framework=ifelse(and(t(match(v(L.CATS-FORECAST1),%1,;)),t(match(today;tmw,%0,;)),t(match(long;short,%2,;))),u(FN.FORECAST[switch(%2,short,SHORT,)]%1,%0),ERROR: Incorrect usage.)
&FN.FORECASTLOW Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),3,1,;))[setq(1,extract(textfile(v(I.FILE),units),1,1,;))][switch(%q1,C,%q0 C %([round(add(mul(%q0,1.8),32),2)] F%),F,%q0 F %([round(fdiv(sub(%q0,32),1.8),2)] C%))]
&FN.FORECASTHIGH Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),4,1,;))[setq(1,extract(textfile(v(I.FILE),units),1,1,;))][switch(%q1,C,%q0 C %([round(add(mul(%q0,1.8),32),2)] F%),F,%q0 F %([round(fdiv(sub(%q0,32),1.8),2)] C%))]
&FN.FORECASTSHORTLOW Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),3,1,;))[setq(1,extract(textfile(v(I.FILE),units),1,1,;))][switch(%q1,C,%q0 C,F,%q0 F)]
&FN.FORECASTSHORTHIGH Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),4,1,;))[setq(1,extract(textfile(v(I.FILE),units),1,1,;))][switch(%q1,C,%q0 C,F,%q0 F)]
&FN.FORECASTDAY Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),1,1,;))[switch(%q0,Sun,Sunday,Mon,Monday,Tue,Tuesday,Wed,Wednesday,Thu,Thursday,Fri,Friday,Sat,Saturday)]
&FN.FORECASTSHORTDAY Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),1,1,;))[switch(%q0,Sun,0,Mon,1,Tue,2,Wed,3,Thu,4,Fri,5,Sat,6)]
&FN.FORECASTDATE Weather Code Framework=setq(0,extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),2,1,;))[timefmt($a $b $d $Y,%q0)]
&FN.FORECASTSHORTDATE Weather Code Framework=extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),2,1,;)
&FN.FORECASTTEXT Weather Code Framework=extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),5,1,;)
&FN.FORECASTSHORTTEXT Weather Code Framework=extract(textfile(v(I.FILE),forecast[switch(%0,today,1,tmw,2)]),6,1,;)
&C.+WEATHER Weather Code Framework=$+weather:@pemit %#=[setq(b,v(I.ANSI-HEADER))][setq(a,g)][header(Time %& Weather)]%r%r[center(ansi( %qa, Current Time),78)]%r[center([setq(0, extract(setr(2, convsecs(sub(secs(), 10800))), 4, 1))][setq(1, extract(%q0, 1, 1, :))][if(gt(%q1, 12), [sub(%q1, 12)]:[extract(%q0, 2, 1, :)], %q1:[extract(%q0, 2, 1, :)])] [if(gte(%q1, 12), pm, am)] on [extract(%q2, 1,3)]%b[extract(%q2, 5, 1)], 78)]%r%r[center(ansi(%qa,Current Conditions),79)]%r%r[rjust(ansi(%qa, Temp:%b),12)][ljust(ulocal(FN.gettemp),25)][rjust(ansi(%qa,Sunrise:%b),12)][ljust(ulocal(FN.GETSUNRISE),30)]%r[ rjust(ansi(%qa,Wind:%b),12)][ljust(ulocal(FN.GETWIND),25)][rjust(ansi(%qa,Sunset:%b),12)][ljust(ulocal(FN.GETSUNSET),30)]%r[rjust(ansi(%qa,Condition:%b),12)][ljust(ulocal(FN.GETCONDITION),25)][rjust(ansi(%qa,Wind Chill:%b),12)][ljust(ulocal(FN.GETWINDCHILL),30)]%r[rjust(ansi(%qa,Humidity:%b),12)][ljust(ulocal(FN.GETHUMIDITY), 25)][rjust(ansi(%qa,Visibility:%b),12)][ljust(ulocal(FN.GETVIS),30)]%r[rjust(ansi(%qa,Pressure:%b),12)][ljust([ulocal(FN.GETPRES)]%b[switch(ulocal(FN.GETPRESSTATE2),0,Steady,1,Rising,2,Falling)], 24)]%r%r%r[space(12)][center(ansi(%qa,Today's Forecast),33)][center(ansi(%qa,Tomorrow's Forecast),33)]%r%r[rjust(ansi(%qa,Low:%b),12)][center(ulocal(FN.getforecast,today,low,long),33)][center(ulocal(FN.GETFORECAST,tmw,low,long),33)]%r[rjust(ansi(%qa,High:%b),12)][center(ulocal(FN.GETFORECAST,today,high,long),33)][center(ulocal(FN.GETFORECAST,tmw,high,long),33)]%r[rjust(ansi(%qa,Condition:%b),12)][center(ulocal(FN.GETFORECAST,today,text,long),33)][center(ulocal(FN.GETFORECAST,tmw,text,long),33)]%r%r[footer()]
&I.ANSI-HEADER Weather Code Framework=hy
&I.ANSI-SUBHEADER Weather Code Framework=hg
&L.CATS-ATMOSPHERE Weather Code Framework=humidity;visibility;pressure;state
&C.+WEATHER/FILE Weather Code Framework=$+weather/file:@pemit %#=[center(| Weather.txt Structure |,79,-)]%r%r& help%r[space(5)]Irrelevant basic entry%r[iter(get(#191/L.CATS),& [itext()]%r[space(5)][iter(get(#191/L.CATS-[itext()]),itext(),;,%b:%b)],;,%r)]%r%r[repeat(-,79)]
&L.CATS-MOON Weather Code Framework=percent illumination;phase name;waxing waning
&FN.GETMOONPHASE Weather Code Framework=[setq(0, extract(textfile(v(I.FILE),moon),3,1,;))][if(t(%q0), %q0%b)][extract(textfile(v(I.FILE),moon),2,1,;)]
&FN.GETMOONPERCENT Weather Code Framework=extract(textfile(v(I.FILE),moon),1,1,;)
@set Weather Code Framework=SAFE
@rxlevel Weather Code Framework=
@txlevel Weather Code Framework=
I don't remember all of the steps to get it working, but those are the pieces of it.
Oh right: You have to create weather.php with the info above, and you need to create a weather.txt file that it points at.