I would like to present the global environment variables to the user login page.
I am not seeing them appear. $(weather) Any hints?
Code: Select all
/tool fetch url="http://w1.weather.gov/xml/current_obs/KIOW.xml" mode=http
:global fileContents [/file get [/file find name=KIOW.xml] contents];
:local start [:find $fileContents "<station_id>" 0];
:set start ($start + 12 );
:local end [:find $fileContents "</station_id>" $start];
:global "station_id" [:pick $fileContents $start $end];
:set start [:find $fileContents "<weather>" 0];
:set start ($start + 9 );
:set end [:find $fileContents "</weather>" $start];
:global weather [:pick $fileContents $start $end];
:set start [:find $fileContents "<temperature_string>" 0];
:set start ($start + 20 );
:set end [:find $fileContents "</temperature_string>" $start];
:global temperature [:pick $fileContents $start $end];
:set start [:find $fileContents "<wind_string>" 0];
:set start ($start + 13 );
:set end [:find $fileContents "</wind_string>" $start];
:global winds [:pick $fileContents $start $end];
:set start [:find $fileContents "<observation_time>" 0];
:set start ($start + 18 );
:set end [:find $fileContents "</observation_time>" $start];
:global observation [:pick $fileContents $start $end];
:set start [:find $fileContents "<icon_url_name>" 0];
:set start ($start + 15 );
:set end [:find $fileContents "</icon_url_name>" $start];
:global icon [:pick $fileContents $start $end];
:set start [:find $fileContents "<icon_url_base>" 0];
:set start ($start + 15 );
:set end [:find $fileContents "</icon_url_base>" $start];
:global iconurl ( [:pick $fileContents $start $end] . $icon);
/tool fetch url=$iconurl mode=http