{"id":168,"date":"2010-01-14T12:17:22","date_gmt":"2010-01-14T12:17:22","guid":{"rendered":"http:\/\/blog.stratus.org.uk\/?page_id=168"},"modified":"2011-06-26T11:41:53","modified_gmt":"2011-06-26T10:41:53","slug":"php-weather-script-from-aprs-reports","status":"publish","type":"page","link":"https:\/\/blog.stratus.org.uk\/?page_id=168","title":{"rendered":"PHP: Weather script from APRS reports"},"content":{"rendered":"<p>Weather script from APRS reports<br \/>\n<code><br \/>\n<!--?php<br \/--> global $image_format, $baseimg, $img;<br \/>\n$start_pressure = -1;<br \/>\n$end_pressure = -1;<br \/>\n\/\/<br \/>\n\/\/ handle any script inputs<br \/>\narray_shift($argv);<br \/>\nif ($argv[0] != null ){<br \/>\n$IMAGEFILE = $argv[0];<br \/>\n} else {<br \/>\n$IMAGEFILE = \"\/home\/stratuso\/cgi-bin\/wx_panel_white\/white600x70.jpg\";<br \/>\n}<br \/>\nif ($argv[1] != null ){<br \/>\n$OUTPUTIMAGEFILE = $argv[1];<br \/>\n} else {<br \/>\n$OUTPUTIMAGEFILE = \"\/home\/stratuso\/webroots\/ratair.stratus.org.uk\/wc\/wx.jpg\";<br \/>\n}<br \/>\n\/\/<br \/>\n$result = get_web_page( \"http:\/\/www.findu.com\/cgi-bin\/raw.cgi?call=m3nic&start=3&length=5&time=1\" );<br \/>\n\/\/<br \/>\nif ( $result == null ) {<br \/>\n\/* ... error: bad url, timeout, redirect loop ... *\/<br \/>\n}<br \/>\n\/\/<br \/>\nif ( $result['http_code'] != 200 ) {<br \/>\n\/* ... error: no page, no permissions, no service ... *\/<br \/>\n}<br \/>\n\/\/<br \/>\n$page = $result['content'];<br \/>\n\/\/<br \/>\n\/* Ok lets now parse ou tthe weather data *\/<br \/>\n\/\/<br \/>\n$output = strip_html_tags( $page );<br \/>\n\/\/<br \/>\n\/* Ok, now we need to strip out the stuff at the end *\/<br \/>\n\/\/<br \/>\n$pieces = explode( \"\\n\", $output);<br \/>\n\/\/<br \/>\nforeach($pieces as $left ){<br \/>\nif ( strlen($left) >5 ) {<br \/>\n$bit = strstr($left, \"@\");<br \/>\n$bit = ltrim($bit, \"@\");<br \/>\n$bit = trim($bit, \".Dvs\");<br \/>\n\/\/ by now we just have the following ...<br \/>\n\/\/             1         2         3         4         5         6<br \/>\n\/\/   01234567890123456789012345678901234567890123456789012345678901<br \/>\n\/\/   112118z5210.97N\/00059.63E_229\/003g...t049r...p...P000h83b10216<br \/>\n$day = substr($bit,0, 2);<br \/>\n$time = substr($bit,2, 2).\":\".substr($bit,4,2);<br \/>\n$lat = substr($bit,7, 8);<br \/>\n$long = substr($bit,16, 9);<br \/>\n\/\/<br \/>\n$wind_dir = substr($bit,25, 4); \/\/ includes the _<br \/>\nif ( substr($wind_dir,0,1) == \"_\" ) {<br \/>\n$wind_dir = fnResolveWindDirection( substr($wind_dir,1,3) );<br \/>\n}else {<br \/>\n$wind_dir = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$wind_speed = substr($bit,29, 4);<br \/>\nif ( substr($wind_speed,0,1) == \"\/\" ) {<br \/>\n$wind_speed = fnProcessWindSpeed( substr($wind_speed,1,3) );<br \/>\n}else {<br \/>\n$wind_speed = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$wind_gust = substr($bit,33, 4);<br \/>\nif ( substr($wind_gust,0,1) == \"\/\" ) {<br \/>\n$wind_gust = fnProcessWindSpeed( substr($wind_gust,1,3) );<br \/>\n}else {<br \/>\n$wind_gust = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$temp_C = substr($bit,37, 4);<br \/>\nif ( substr($temp_C,0,1) == \"t\" ) {<br \/>\n$farenheight = substr($temp_C,1,3); \/\/ this is kept for later too<br \/>\n$temp_C = fnProcessCurrentTemperature( $farenheight );<br \/>\n}else {<br \/>\n$temp_C = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$rain = substr($bit,41, 4);<br \/>\nif ( substr($rain,0,1) == \"r\" ) {<br \/>\n$rain = fnProcessRainFall( substr($rain,1,3) );<br \/>\n}else {<br \/>\n$rain = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$rain_24 = substr($bit,45, 4);<br \/>\nif ( substr($rain_24,0,1) == \"p\" ) {<br \/>\n$rain_24 = fnProcessRainFall( substr($rain_24,1,3) );<br \/>\n}else {<br \/>\n$rain_24 = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$rain_since_mid = substr($bit,49, 4);<br \/>\nif ( substr($rain_since_mid,0,1) == \"P\" ) {<br \/>\n$rain_since_mid = fnProcessRainFall( substr($rain_since_mid,1,3) );<br \/>\n}else {<br \/>\n$rain_since_mid = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$humidity = substr($bit,53, 3);<br \/>\nif ( substr($humidity,0,1) == \"h\" ) {<br \/>\n$humidity = fnProcessHumidity( substr($humidity,1,2) );<br \/>\n}else {<br \/>\n$humidity = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\n$pressure = substr($bit,56, 6);<br \/>\nif ( substr($pressure,0,1) == \"b\" ) {<br \/>\n$pressure = fnProcessPressure( substr($pressure,1,5) );<br \/>\n}else {<br \/>\n$pressure = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\nif ($start_pressure == -1) # then first time<br \/>\n{<br \/>\n}<br \/>\n\/\/<br \/>\n$pressure = substr($bit,56, 6);<br \/>\nif ( substr($pressure,0,1) == \"b\" ) {<br \/>\n$pressure = fnProcessPressure( substr($pressure,1,5) );<br \/>\n}else {<br \/>\n$pressure = \"***\";<br \/>\n}<br \/>\n\/\/<br \/>\nif ($start_pressure == -1) # then first time<br \/>\n{<br \/>\n$start_pressure = $pressure;<br \/>\n} else {<br \/>\n$end_pressure = $pressure;<br \/>\n}<br \/>\n}<br \/>\n\/\/print ( \"\\n$bit\");<br \/>\n\/\/<br \/>\n}<br \/>\n\/\/ Summary here<br \/>\nif ( $start_pressure > $end_pressure ) {<br \/>\n$pressure = $pressure.\" (rise)\";<br \/>\n\/\/print (\"\\nPressure rising\");<br \/>\n} elseif  ( $start_pressure < $end_pressure ) {<br \/>\n$pressure = $pressure.\" (fall)\";<br \/>\n\/\/print (\"\\nPressure falling\");<br \/>\n} else {<br \/>\n$pressure = $pressure.\" (steady)\";<br \/>\n\/\/print (\"\\nPressure steady\");<br \/>\n}<\/code><\/p>\n<p><code>$dewpoint_C = fnCalcDewPoint($farenheight, $humidity);<br \/>\n$cloud_base = fnCalcCloudBase($dewpoint_C, $temp_C);<br \/>\n\/\/<br \/>\n\/\/print ( \"\\n--------------------\");<br \/>\nprint ( \"\\n$day\");<br \/>\nprint ( \"\\n$time\");<br \/>\nprint ( \"\\n$lat\");<br \/>\nprint ( \"\\n$long\");<br \/>\nprint ( \"\\n$wind_dir\");<br \/>\nprint ( \"\\n$wind_speed\");<br \/>\nprint ( \"\\n$wind_gust\");<br \/>\nprint ( \"\\n$temp_C\");<br \/>\nprint ( \"\\n$rain\");<br \/>\nprint ( \"\\n$rain_24\");<br \/>\nprint ( \"\\n$rain_since_mid\");<br \/>\nprint ( \"\\n$humidity\");<br \/>\nprint ( \"\\n$dewpoint_C\");<br \/>\nprint ( \"\\n$pressure\");<br \/>\nprint ( \"\\n$cloud_base\");<br \/>\n\/\/<br \/>\nfnWriteImage( $day, $time, $lat, $long,<br \/>\n$wind_dir, $wind_speed, $wind_gust,<br \/>\n$temp_C, $humidity, $cloud_base, $dewpoint_C,<br \/>\n$pressure, $IMAGEFILE, $OUTPUTIMAGEFILE );<br \/>\n\/\/<br \/>\n\/\/ End of main body of the script ---------------------------------------<br \/>\n\/\/<br \/>\n\/************************************************************************<br \/>\n* Get a web file (HTML, XHTML, XML, image, etc.) from a URL.  Return an<br \/>\n* array containing the header fields and content.<br \/>\n*\/<br \/>\nfunction get_web_page( $url )<br \/>\n{<br \/>\n$options = array( 'http' => array(<br \/>\n'user_agent'    => 'spider',    \/\/ who am i<br \/>\n'max_redirects' => 10,          \/\/ stop after 10 redirects<br \/>\n'timeout'       => 120,         \/\/ timeout on response<br \/>\n) );<br \/>\n$context = stream_context_create( $options );<br \/>\n$page    = @file_get_contents( $url, false, $context );<br \/>\n\/\/<br \/>\n$result  = array( );<br \/>\nif ( $page != false )<br \/>\n$result['content'] = $page;<br \/>\nelse if ( !isset( $http_response_header ) )<br \/>\nreturn null;    \/\/ Bad url, timeout<br \/>\n\/\/<br \/>\n\/\/ Save the header<br \/>\n$result['header'] = $http_response_header;<br \/>\n\/\/<br \/>\n\/\/ Get the *last* HTTP status code<br \/>\n$nLines = count( $http_response_header );<br \/>\nfor ( $i = $nLines-1; $i >= 0; $i-- )<br \/>\n{<br \/>\n$line = $http_response_header[$i];<br \/>\nif ( strncasecmp( \"HTTP\", $line, 4 ) == 0 )<br \/>\n{<br \/>\n$response = explode( ' ', $line );<br \/>\n$result['http_code'] = $response[1];<br \/>\nbreak;<br \/>\n}<br \/>\n}<br \/>\n\/\/<br \/>\nreturn $result;<br \/>\n}<br \/>\n\/* ********************************************************************** *\/<br \/>\n\/**<br \/>\n* Remove HTML tags, including invisible text such as style and<br \/>\n* script code, and embedded objects.  Add line breaks around<br \/>\n* block-level tags to prevent word joining after tag removal.<br \/>\n*\/<br \/>\nfunction strip_html_tags( $text )<br \/>\n{<br \/>\n$text = preg_replace(<br \/>\narray(<br \/>\n\/\/ Remove invisible content<br \/>\n'@]*?>.*?@siu',<br \/>\n'@<br \/>\n<!-- ]*?>.*? --><\/p>\n<p>@siu',<br \/>\n'@<!-- ]*?.*? \/\/ -->@siu',<br \/>\n'@]*?.*?@siu',<br \/>\n'@]*?.*?@siu',<br \/>\n'@]*?.*?@siu',<br \/>\n'@]*?.*?@siu',<br \/>\n'@<!--]*?.*?-->@siu',<br \/>\n'@]*?.*?@siu',<br \/>\n\/\/ Add line breaks before and after blocks<br \/>\n'@<!--?((address)|(blockquote)|(center)|(del))@iu',<br \/--> '@<!--?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',<br \/--> '@<!--?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',<br \/--> '@<!--?((table)|(th)|(td)|(caption))@iu',<br \/--> '@<!--?((form)|(button)|(fieldset)|(legend)|(input))@iu',<br \/--> '@<!--?((label)|(select)|(optgroup)|(option)|(textarea))@iu',<br \/--> '@<!--?((frameset)|(frame)|(iframe))@iu',<br \/--> ),<br \/>\narray(<br \/>\n' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',<br \/>\n\"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",<br \/>\n\"\\n\\$0\", \"\\n\\$0\",<br \/>\n),<br \/>\n$text );<br \/>\nreturn strip_tags( $text );<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction fnResolveWindDirection( $sWindDegrees )<br \/>\n{<br \/>\n$wind_dir = $sWindDegrees;<br \/>\n# Cardinal Direction    Degree Direction<br \/>\n#N      348.75 - 11.25<br \/>\n#NNE    11.25 - 33.75<br \/>\n#NE     33.75 - 56.25<br \/>\n#ENE    56.25 - 78.75<br \/>\n#E      78.75 - 101.25<br \/>\n#ESE    101.25 - 123.75<br \/>\n#SE     123.75 - 146.25<br \/>\n#SSE    146.25 - 168.75<br \/>\n#S      168.75 - 191.25<br \/>\n#SSW    191.25 - 213.75<br \/>\n#SW     213.75 - 236.25<br \/>\n#WSW    236.25 - 258.75<br \/>\n#W      258.75 - 281.25<br \/>\n#WNW    281.25 - 303.75<br \/>\n#NW     303.75 - 326.25<br \/>\n#NNW    326.25 - 348.75<br \/>\n\/\/<br \/>\nif ( (($wind_dir >= 348) && ($wind_dir <= 359))||(($wind_dir >= 0) && ($wind_dir <= 11)) )     {<br \/>\n#N      348.75 - 11.25<br \/>\n$wind_ind = \"N\";<br \/>\n} elseif ( (($wind_dir >= 12) && ($wind_dir <= 33)) ) {<br \/>\n#NNE    11.25 - 33.75<br \/>\n$wind_ind = \"NNE\";<br \/>\n} elseif ( (($wind_dir >= 34) && ($wind_dir <= 56)) ) {<br \/>\n#NE     33.75 - 56.25<br \/>\n$wind_ind = \"NE\";<br \/>\n} elseif ( (($wind_dir >= 57) && ($wind_dir <= 78)) ) {<br \/>\n#ENE    56.25 - 78.75<br \/>\n$wind_ind = \"ENE\";<br \/>\n} elseif ( (($wind_dir >= 79) && ($wind_dir <= 101)) ) {<br \/>\n#E      78.75 - 101.25<br \/>\n$wind_ind = \"E\";<br \/>\n} elseif ( (($wind_dir >= 102) && ($wind_dir <= 146)) ) {<br \/>\n#SE     123.75 - 146.25<br \/>\n$wind_ind = \"SE\";<br \/>\n} elseif ( (($wind_dir >= 147) && ($wind_dir <= 168)) ) {<br \/>\n#SSE    146.25 - 168.75<br \/>\n$wind_ind = \"SSE\";<br \/>\n} elseif ( (($wind_dir >= 169) && ($wind_dir <= 191)) ) {<br \/>\n#S      168.75 - 191.25<br \/>\n$wind_ind = \"S\";<br \/>\n} elseif ( (($wind_dir >= 192) && ($wind_dir <= 213)) ) {<br \/>\n#SSW    191.25 - 213.75<br \/>\n$wind_ind = \"SSW\";<br \/>\n} elseif ( (($wind_dir >= 214) && ($wind_dir <= 258)) ) {<br \/>\n#WSW    236.25 - 258.75<br \/>\n$wind_ind = \"WSW\";<br \/>\n} elseif ( (($wind_dir >= 259) && ($wind_dir <= 281)) ) {<br \/>\n#W      258.75 - 281.25<br \/>\n$wind_ind = \"W\";<br \/>\n} elseif ( (($wind_dir >= 282) && ($wind_dir <= 303)) ) {<br \/>\n#WNW    281.25 - 303.75<br \/>\n$wind_ind = \"WNW\";<br \/>\n} elseif ( (($wind_dir >= 304) && ($wind_dir <= 326)) ) {<br \/>\n#NW     303.75 - 326.25<br \/>\n$wind_ind = \"NW\";<br \/>\n} elseif ( (($wind_dir >= 327) && ($wind_dir <= 347)) ) {<br \/>\n#NNW    326.25 - 348.75<br \/>\n$wind_ind = \"NNW\";<br \/>\n} else {<br \/>\n# do nothing<br \/>\n$wind_ind =\"\";<br \/>\n}<br \/>\n$wind_ind = $wind_ind.\" (\".$wind_dir.\")\";<br \/>\n\/\/<br \/>\nreturn $wind_ind;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\n\/\/ This turns it into Knots and sets the calm if zero<br \/>\nfunction fnProcessWindSpeed( $sWindspeed )<br \/>\n{<br \/>\nif ($sWindspeed == \"000\"){<br \/>\n$windspeed = \"Calm\";<br \/>\n\/\/print \"\\nWindspeed is zero - set to calm\";<br \/>\n} else {<br \/>\n$windspeed = sprintf(\"%d kt\",$sWindspeed*0.8689755962687);<br \/>\n}<br \/>\nreturn $windspeed;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction fnProcessCurrentTemperature( $sTemp )<br \/>\n{<br \/>\n$faren = sprintf(\"%.1f\", $sTemp);<br \/>\n$temp = sprintf(\"%.1f\", ((5\/9) *($faren - 32)));<br \/>\n$temp = $temp.\"C\";<br \/>\n\/\/print \"\\ntemp modified to \".$temp;<\/p>\n<p>return $temp;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction fnProcessRainFall( $sRain )<br \/>\n{<br \/>\n$rain = sprintf(\"%3d\", ($sRain*(25\/100))). \" mm\";<\/p>\n<p>return $rain;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction fnProcessHumidity( $sHumidity )<br \/>\n{<br \/>\nif ($sHumidity == \"00\"){<br \/>\n$humidity = \"100%\";<br \/>\n\/\/print \"\\nHumidity modified to 100\";<br \/>\n} else<br \/>\n$humidity = sprintf(\"%s\", $sHumidity). \"%\";<br \/>\n\/\/print \"\\nHumidity='\".$humidity.\"'\";<\/p>\n<p>return $humidity;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction fnProcessPressure( $sPressure )<br \/>\n{<br \/>\n$press = $sPressure \/ 10;<br \/>\n$press = $press.\" mb\";<br \/>\n\/\/print \"\\nModified pressure = $press[0]\";<\/p>\n<p>return $press;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction  fnWriteImage( $day, $time, $lat, $long, $wind_dir, $wind_speed,<br \/>\n$wind_gust, $temp, $humidity, $cloud_base, $dew_point, $pressure, $sInputFileName, $sOutputFileName )<br \/>\n{<\/p>\n<p><\/code><\/p>\n<p><code> \/\/ create the base image<br \/>\nglobal $image_format, $baseimg, $img;<br \/>\n\/\/<br \/>\n$image_format = 'jpeg';<br \/>\n\/\/<br \/>\n\/\/ create a truecolor image to deal avoid any pallete problems<br \/>\nprint \"\\nReading $sInputFileName\";<br \/>\nprint \"\\nWriting $sOutputFileName\";<br \/>\n$baseimg = imagecreatefromjpeg($sInputFileName);<br \/>\n$basex = imagesx($baseimg);<br \/>\n$basey = imagesy($baseimg);<br \/>\nprint \"\\nSize is $basex by $basey\\n\";<br \/>\n\/\/<br \/>\n$img = imagecreatetruecolor($basex,$basey);<br \/>\nimagecopy($img,$baseimg,0,0,0,0,$basex,$basey);<br \/>\n\/\/<br \/>\n$color1 = imagecolorallocate($img,255,0,0);      \/\/ RED<br \/>\n$color2 = imagecolorallocate($img,0,128,0);      \/\/ GREEN<br \/>\n$color3 = imagecolorallocate($img,0,0,255);      \/\/ BLUE<br \/>\n$BLACK = imagecolorallocate($img,0,0,0);        \/\/ BLACK<br \/>\n$WHITE = imagecolorallocate($img,255,255,255);  \/\/ WHITE<br \/>\n$color6 = imagecolorallocate($img,255,215,0);  \/\/ GOLD<br \/>\n$color7 = imagecolorallocate($img,135,206,235);  \/\/ sky blue<br \/>\n$ROYAL_BLUE = imagecolorallocate($img,065,105,225);  \/\/<br \/>\n\/\/<br \/>\n$root_x = 9;<br \/>\n$root_y = 1;<br \/>\n\/\/<br \/>\n# now put the text on top of the box<br \/>\nimagestring($img, 2, $root_x, $root_y, \"Weather Report at $time ($day)\", $ROYAL_BLUE);<br \/>\nimagestring($img, 2, $root_x + 10, $root_y + 12, \"Temperature: $temp\", $ROYAL_BLUE);<br \/>\nimagestring($img, 2, $root_x + 10, $root_y + 24, \"Cloud Base : $cloud_base\", $ROYAL_BLUE);<br \/>\nimagestring($img, 2, $root_x + 200, $root_y + 12, \"Dew Point: $dew_point\", $ROYAL_BLUE);<br \/>\nimagestring($img, 2, $root_x + 200, $root_y + 24, \"Relative Humidity: $humidity\", $ROYAL_BLUE);<br \/>\nimagestring($img, 2, $root_x + 10, $root_y + 36, \"Local QFE: $pressure\", $ROYAL_BLUE);<br \/>\nimagestring($img, 2, $root_x + 200, $root_y + 36, \"Wind: $wind_speed $wind_dir (gust $wind_gust)\", $ROYAL_BLUE);<br \/>\n\/\/<br \/>\n\/\/ ok now write the file<br \/>\nimagejpeg($img, \"$sOutputFileName\");<br \/>\n\/\/<br \/>\n\/\/ get rid of the image since we don't need it in memory any more.<br \/>\n\/\/ don't need any memory leaks taking down the server<br \/>\nimagedestroy($img);<br \/>\nimagedestroy($baseimg);<br \/>\n} \/\/ end function imagecenteredtext<br \/>\n\/\/ ########################################################################<br \/>\nfunction  fnCalcDewPoint($faren, $humidity )<br \/>\n{<br \/>\n# lets calc the dew point<br \/>\n$dew_point_F = $faren -((100 - $humidity)\/5); # in farenheight<br \/>\n$dew_point_C = sprintf(\"%.1fC\",($dew_point_F - 32) * (5\/9));<br \/>\n\/\/<br \/>\nreturn $dew_point_C;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\nfunction  fnCalcCloudBase($dew_point_C, $temp_C )<br \/>\n{<br \/>\n\/\/<br \/>\n#estimate the cloud base<br \/>\n$est_cb = ($temp_C - $dew_point_C) * 1000;<br \/>\n\/\/<br \/>\nif ( $est_cb < 600) {<br \/>\n$est_cloud_base = \"<600ft\";<br \/>\n} else {<br \/>\n$est_cloud_base = sprintf(\"%dft\",$est_cb);<br \/>\n}<br \/>\n\/\/<br \/>\n\/\/print \"\\nTemp C = $temp_C\";<br \/>\n\/\/print \"\\nDew Point C = $dew_point_C\";<br \/>\n\/\/print \"\\nCloud Base = $est_cloud_base\";<br \/>\n\/\/<br \/>\nreturn $est_cloud_base;<br \/>\n}<br \/>\n\/\/ ########################################################################<br \/>\n?><br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Weather script from APRS reports global $image_format, $baseimg, $img; $start_pressure = -1; $end_pressure = -1; \/\/ \/\/ handle any script inputs array_shift($argv); if ($argv[0] != null ){ $IMAGEFILE = $argv[0]; } else { $IMAGEFILE = &#8220;\/home\/stratuso\/cgi-bin\/wx_panel_white\/white600x70.jpg&#8221;; } if ($argv[1] != &hellip; <a href=\"https:\/\/blog.stratus.org.uk\/?page_id=168\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":84,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-168","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168"}],"version-history":[{"count":24,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/168\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/168\/revisions\/425"}],"up":[{"embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/84"}],"wp:attachment":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}