I’ve been trying formatting the White Pass NWAC snotel data in a compact form for my Palm Pilot, but I’ve had some problems.
For some reason the output from http://www.nwac.us/products/OSOWPS has a .txt extension on it, so my Palm Pilot PDA browser, Blazer, doesn’t want to display it. Instead I have to save the file and figure out some way to view it off line. I thought it would be an interesting exercise in php to take output from NW Avalanche Center for the White Pass snow pack and reformat it a little more compact for my PDA. I can screen scrape the file with curl and get the relevant data, but I’m having a hard time getting the Blazer browser to process my formatting tags correctly, and without a non proportional font, the columns get out of line. It looks good on my desktop in Firefox (see http://ykfp.org/php/nwac/getwhitepass.php, but Blazer is funny. It has two font size options that are set with pull down menus, small or large, and although some of my formatting tabs like bold seem to work, neither of the font choices seem to be monospace. I’ve tried monospace font specifications in the CSS setting and inside the
tags, but it’s not working.
There are other browsers for Palm available, and so far Opera mini has worked best. ISilo seems to be more of a html reader, and Xiino gives me line wrap problems. Although Opera and Xiino seem to display the text as non-proportional, both of these browsers seem to have a small set of font sizes and ignore my font-size settings.White Pass snow<?php // Paul Huffman, 1-2-2008
//retrieve the White Pass text file from NWAC
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $theurl);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$contents = curl_exec($ch);
//Trim feed to useful data
$cStartStr = “MM”;
$cEndStr= " ";
$cPageTail = stristr($contents, $cStartStr);
$nUsefulDataEndPos = strpos($cPageTail, $cEndStr);
$cUsefulData = substr($cPageTail, 0, $nUsefulDataEndPos);
// display file
echo “White Pass Ski Area, Washington
This signature line intentionally blank.