WD for iPhone

That should be possible, it has been possible here in Norway for years… Forward to another number when 1. no answer, 2. no coverage/network

anyone besides me wants the iPhone app that reads Clientraw data? Come on, surely it can not be so few?

88 views, 25 votes, only 5 interested, 3 of those want it for free. I guess this forum’s not big on iphones.

It’s not the phone per say, it’s that it’s stuck on the “wrong” network. :wink:

It looks like I might get an iPhone app for my weatherstation data after all :slight_smile: A small Norwegian iPhone app developper company http://www.polleo.no/ is looking into it now :slight_smile: they have two app’s at the moment, one for sports, and one for weather, connected to the Norwegian weatherservice YR www.yr.no

I have done some research
yes, its actualy a program that needs to be written with a cocoa interface and to run on a ARM processor
its possible I can get that compiled with Lazarus for the Mac, which has some cocoa widget bindings
but I would need a ARM processor to compile it onk, runnning OSX, and with the Lazarus installed

We did a quick iphone version of the ajax template for our WD page:

http://www.casa.ucl.ac.uk/weather/wxindex.php

Its a quick and dirty job but formatted to fit on the iphone screen in landscape. I personally normally just tap to zoom in and then leave the iPhone in its dock providing me with a live weather feed direct from WD (note the windspeed has just stopped working due to a faulty reed switch).

When i have time I’ll perhaps create a template document in a more standard iphone layout and upload it if people are interested?

I’ve found the iPhone linked with WD to be fantastic, i love the fact i can check the live feed on the bus (although perhaps thats just me?)

Andy

Hey Andy

That sounds nice, I’ll check it out.

And no, it is not just you .-)

there are 2 things here:
having a web page formated that can be viewed OK on the small iphone screen, like Smithee posted

or

actualy having a application running on the iphone that then shows the weather data ,but is interactive with the user for what to do , fancy graphics, buttons, etc (alot more complicated and harder to achieve)

if the first one does the job, then great!

it is the second thing that would be the ideal thing. Should not use to much bandwidth either

Hi Brian, have you been able to look more into this?

Geir

That looks very nice. I’d like to offer something like that on my web site. Would you care
to share the source for it?

-Keith

Here is another one (that I don’t take all the credit for) that uses a variation of the wapindex.php (that can be found on this forum) and is formatted for the iPhone. BTW it only looks good on a mobile device should you happen to view it…

http://stillweather.com/iPhone.php

Here is the code…

<!--   /////////////////     START CALL PHP DATA FOR CURRENT CONDITIONS       /////////////    -->

<?php 
include("testtags.php");
?>

<!--   /////////////////     END CALL PHP DATA FOR CURRENT CONDITIONS       /////////////    -->
    

<!--   /////////////////     START 7 DAY FORECAST SCRIPT       /////////////    -->

<?php
/*------------------------------------------------
//import NOAA Forecast info
//data ends up in three different arrays:
//$forecasticons[x]  x = 0 thru 9   This is the icon and text around it
//$forecasttitles[x]  x = 0 thru 12   This is the title word for the time period
//$forecasttext[x]  x = 0 thru 12  This is the detail text for the forecast
//
//And one more variable - $lastupdate  This is the time of last update
//
//Also, in order for this to work correctly, you need the NOAA icons (or make your own... 
//there are over 200!). These need to be placed in the path \ifps\text\images\ to work 
//properly (so make a folder in your web HTML root called "ifps", then make a folder in it 
//called "text", then make a folder in it called "images" and place the icons in this folder)
//
//http://members.cox.net/carterlakeweather/forecasticons.zip (380K)
//
//URL below --MUST BE-- the Printable Point Forecast from the NOAA website
//
//Not every area of the US has a printable point forecast
//
//This script will ONLY WORK with a printable point forecast!
//
//To find yours in your area:
//
//Go to www.noaa.gov
//Click on the Storm Watch map (middle lower left of page)
//Click on your state
//Click on  your area of the state
//Scroll down to the "Additional Forecasts & Info"
//Click on Printable Forecast
//The title of the page should say "Point Forecast (Printable)"
//------------------------------------------------*/

$html = implode('', file('http://forecast.weather.gov/MapClick.php?CityName=Branford&state=CT&site=OKX&textField1=41.28&textField2=-72.81&e=1&TextType=2;'));

    // Just get the top of the NWS page for editing

    preg_match('|<tr valign ="top" align="center">(.*)<table width="670"|s', $html, $betweenspan);
    $forecastop  = $betweenspan[1];

    // Chop up each icon html and place in array
    preg_match_all("/<td.*>(.*)<\/td>/Uis", $forecastop, $headers);
    $forecasticons = $headers[1];

    // Now get just the bottom of the NWS page for editing
    preg_match('|</table>(.*)<hr>|s', $html, $betweenspan);
    $forecast  = $betweenspan[1];

    // Chop up each title text and place in array
    preg_match_all('|<b>(.*): </b>|Ui', $forecast, $headers);
    $forecasttitles = $headers[1];

    // Chop up each forecast text and place in array
    preg_match_all('|</b>(.*)
|Ui', $forecast, $headers);
    $forecasttext = $headers[1];

    // Grab the Last Update date and time.
    preg_match('|Last Update: (.*)|', $html, $betweenspan);
    $lastupdate  = $betweenspan[1];

?>

<!--   /////////////////     END 7 DAY FORECAST SCRIPT       /////////////    -->

<!--   /////////////////     START DATE/TIME ZONE SET FOR GRAPH CALL       /////////////    -->

<?php 
date_default_timezone_set('America/New_York');
$d = date('j');
$m = date('n');
$y = date('Y');
?>


<!--   /////////////////     END DATE/TIME ZONE SET FOR GRAPH CALL       /////////////    -->





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Weather for iPhone</title>
    <meta name="description" content="Branford iPhone Weather" />
    <meta name="keywords" content="iPhone weather, forecast, current conditions, radar, warnings, apple, iphone" />
    <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
    <link rel="stylesheet" type="text/css" href="http://stillweather.com/iphone_iui.css?v17" />
    <link rel="stylesheet" type="text/css" href="http://stillweather.com/iPhone_base.css?v=23" />
  </head>
  <body>
    <div class="panel" selected="true">
    <a name="top"></a>
    <fieldset>
    <table cellspacing="0" cellpadding="5" class="center" id="searchTable">
<tr>
<td>
<center>Branford CT Weather Center

For The iPhone</center>
</td>
</tr>
    </table>
    </fieldset>
    <script language="javascript">
  function ShowCustomDateSelect()
  {
    document.getElementById("custom_date_select").style.visibility="visible";
    document.getElementById("normal_date_select").style.visibility="hidden";
  }
</script>
<a name="current"></a>
<h2>Current Conditions</h2>
<fieldset>
  <div class="barMenu">
    <span class="button">Current</span>
    <a href="#graph" class="button">Radar</a>
    <a href="#webcam" class="button">Webcam</a>
    <a href="#severe" class="button">Forecast</a>
  </div>

  <div id="pwsSelect"></div>
    
  <table cellspacing="0" cellpadding="5" class="full taL">



<tr>
<td align=center>




<?php
// dynamically builds a wap page using Weather Display provided data
// By Jim McMurry - [email protected] - jcweather.us
// Original format by Kevin Reed of tnetweather.com - Support functions by Tom Chaplin of carterlake.org and Ken True of saratoga-weather.org
// Graphics by the above plus Anole.
// This page requires that Ken True's advforecast2 script be installed and functional on the site.
// Version 1.2 October 2007
//

include("wapdata.php");   // fills the array for use below and provides support functions
echo '<?xml version="1.0" encoding="UTF-8"?>';lf();  // lf(); just a function to provide a linefeed so the code produced is more readable
echo '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">';lf();
echo '<html xmlns="http://www.w3.org/1999/xhtml">';lf();
echo '<head>';lf();
echo '<meta name="keywords" content="wap, wml, xml, weather" />';lf();
echo '<meta name="description" content="Branford Live Weather" />';lf();
echo '<meta name="author" content="Based upon original output from WD, modified by Kevin Reed TNET then jmcmurry" />';lf();
echo '<meta http-equiv="Expires" content="-1" />';lf();
echo '<meta http-equiv="Pragma" content="no-cache" />';lf();
echo '<meta http-equiv="Cache-Control" content="no-cache" />';lf();
echo '<meta http-equiv="refresh" content="120" />';lf();                  // 120 = 2 minute refresh
echo '<title>Branford Weather</title>';lf();
echo '<style type="text/css">';lf();                                      // Begin CSS
echo 'body { color: black; background-color: white; margin: 0; padding: 0; }';lf(); 
echo '.top { color: black; background: rgb(190,190,190); margin: 0; padding: 0; text-align: "center"}';lf();
echo '.logo { font-size: 1.5em; }';lf();
echo 'a { color: rgb(168,140,83); background-color: transparent; text-decoration: none; }'; lf();
echo 'a:hover { text-decoration: underline; }';lf();
echo '.highlight { color: rgb(168,140,83); background-color: transparent; }';lf();
echo 'table { background-color: white; border-style: None }';lf();
echo 'div.centered {text-align: center;}';lf();
echo 'div.centered table {margin: 0 auto; text-align: left;}';lf();
echo 'tr.hdr { color: black; font-size: 1.25em;  font-style: italic;  background-color: white; border-color: white }';lf();
echo 'tr.lt { background-color: rgb(243,242,235); border-color: rgb(243,242,235) }';lf();
echo 'tr.dk { background-color: #EBE9ED; border-color: #EBE9ED }';lf();
echo 'td { border-style: none }';lf();
echo '</style>';lf();                                                     // End CSS
echo '</head>';lf();
echo '<body>';lf();
echo '<div class="centered">  <!-- class="centered" -->';lf();
echo '<div class="top">';lf();
echo '<div class="logo">';lf();
echo 'Branford
';lf();
echo 'Weather
';lf();
echo '</div>  <!-- class="logo" -->';lf();
echo $wdtg[204] . " at " . $wdtg[1] . "
";lf();

echo '</div>  <!-- class="top" -->';lf();
echo '<table>';lf();
echo '<tr class="hdr"><td>Current</td><td>' . ajax_wxIcon (trim($wdtg[350])) . '</td></tr>';lf();
echo '<tr class="dk"><td>Temperature:</td><td>' . $wdtg[5] .    gen_difference( $wdtg[23], $wdtg[216]) . ' </td></tr>';lf();
echo '<tr class="lt"><td>Dewpoint:</td><td>' . $wdtg[10] .  gen_difference( $wdtg[57], $wdtg[58]) . ' </td></tr>';lf();
echo '<tr class="dk"><td>Humidity:</td><td>' . $wdtg[9] . ' % ' .  gen_difference( $wdtg[59], $wdtg[60]) . ' </td></tr>';lf();
echo '<tr class="lt"><td>Wind:</td><td>' . $wdtg[109] . 'mph ' . get_windarrow(trim($wdtg[212])) . $wdtg[219] . '</td></tr>';lf();
echo '<tr class="dk"><td>Gusts:</td><td>' . $wdtg[208 ] . '</td></tr>';lf();
echo '<tr class="lt"><td>Barometer:</td><td>' . strip_units ($wdtg[12]) . ' in ' .  gen_difference( $wdtg[214], $wdtg[221]) . ' </td></tr>';lf();
echo '<tr class="lt"><td></td><td>' . $wdtg[191] . '</td></tr>';lf();
echo '<tr class="lt"><td>Wind Chill:</td><td>' . $wdtg[352] . ' </td></tr>';lf();
echo '<tr class="dk"><td>Feels Like:</td><td>' . $wdtg[7] . ' F</td></tr>';lf();
echo '<tr class="hdr"><td>Rain</td></tr>';lf();
echo '<tr class="dk"><td>Amount:</td><td>' . $wdtg[200] . ' in
</td></tr>';lf();
echo '<tr class="dk"><td>Rate:</td><td>' . $wdtg[205] . ' hr ' .  gen_difference( $wdtg[215], $wdtg[222]) . '</td></tr>';lf();
echo '<tr class="lt"><td>Yesterday:</td><td>' . $wdtg[208] . ' in</td></tr>';lf();
echo '<tr class="dk"><td>Month:</td><td>' . $wdtg[169] . ' in</td></tr>';lf();
echo '<tr class="lt"><td>Year:</td><td>' . $wdtg[170] . ' in</td></tr>';lf();
echo '<tr class="dk"><td>Sunrise:</td><td>' . $wdtg[130] . '</td></tr>';lf();
echo '<tr class="lt"><td>Sunset:</td><td>' . $wdtg[131] . '</td></tr>';lf();
echo '<tr class="dk"><td>Poss Sun:</td><td>' . $wdtg[144] . ' hrs</td></tr>';lf();
echo '<tr class="lt"><td>Change:</td><td>' . $wdtg[176] . ' min</td></tr>';lf();
echo '<tr class="hdr"><td>Moon</td></tr>';lf();
echo '<tr class="dk"><td>Rise:</td><td>' . $wdtg[132] . '</td></tr>';lf();
echo '<tr class="lt"><td>Set:</td><td>' . $wdtg[133] . '</td></tr>';lf();
echo '<tr class="dk"><td><img alt="Moon" src="./ajax-images/moon' . preg_replace('|^Moon age: (\d+)\s.*$|i',"\$1",$wdtg[134]) . '.gif"  height="48px" width="48px"/></td><td>' . $wdtg[135] . '</td></tr>';lf();
echo '<tr class="lt"><td>' .  preg_replace("/Moon/", "", $wdtg[351]) . '</td><td>Moon</td></tr>';lf();
echo '<tr class="hdr"><td>Today</td><td>Hi/Low</td></tr>';lf();
echo '<tr class="dk"><td>Max Temp:</td><td>' . $wdtg[22] . ' </td></tr>';lf();
echo '<tr class="dk"><td></td><td>at ' . strtolower($wdtg[23]) . '</td></tr>';lf();
echo '<tr class="lt"><td>Min Temp:</td><td>' . $wdtg[24] . ' </td></tr>';lf();
echo '<tr class="lt"><td></td><td>at ' . strtolower($wdtg[25]) . '</td></tr>';lf();
echo '<tr class="dk"><td>Hi Baro:</td><td>' . $wdtg[32] . ' </td></tr>';lf();
echo '<tr class="dk"><td></td><td>at ' . strtolower($wdtg[33]) . '</td></tr>';lf();
echo '<tr class="lt"><td>Lo Baro:</td><td>' . $wdtg[34] . ' </td></tr>';lf();
echo '<tr class="lt"><td></td><td>at ' . strtolower($wdtg[35]) . '</td></tr>';lf();
echo '<tr class="dk"><td>Max gust:</td><td>' . $wdtg[199] . ' </td></tr>';lf();
echo '<tr class="hdr"><td>Console</td></tr>';lf();
echo '<tr class="dk"><td>Server Temp:</td><td>' . $wdtg[349] . ' F</td></tr>';lf();
echo '</tr>';lf();
echo '</table>';lf();
echo '<div class="top">';lf();

echo '</body>';lf();
echo '</html>';lf();
?>

</td>
</tr>


  </table>
  </fieldset>
<a name="graph"></a>
<h2>GR3 Radar</h2>
<fieldset>
  <div class="barMenu">
    <a href="#current" class="button">Current</a>
    <span class="button">Radar</span>
    <a href="#webcam" class="button">Webcam</a>
    <a href="#severe" class="button">Forecast</a>
  </div>

  <div class="taC tm10 bm10"><img src="http://stillweather.com/GR3/animategr3.php"></div>
</fieldset>
  <a name="webcam"></a>
  <h2>Webcam</h2>
  <fieldset>
    <div class="barMenu">
    <a href="#current" class="button">Current</a>
    <a href="#graph" class="button">Graphs</a>
    <span class="button">Webcam</span>
    <a href="#severe" class="button">Forecast</a>
    </div>
    <div class="taC bm10"><img src="http://stillweather.com/webcamimage.jpg" id="camImage" /></div>
  </fieldset>

<a name="severe"></a>
<h2>Forecast for Branford</h2>
<fieldset>
  <div class="barMenu">
    <a href="#current" class="button">Current</a>
    <a href="#graph" class="button">Radar</a>
    <a href="#webcam" class="button">Webcam</a>
    <span class="button">Forecast</span>
  </div>
  <table cellspacing="0" cellpadding="5" class="full taL">
    <tr>
    <td>
    
<?
//include("wapdata.php");   // fills the array for use below and provides support functions
$doPrintNWS = false;
require("advforecast2.php");
echo '<tr><td>
</td></tr>';lf();
echo '<td>' . $forecasticons[0] . '</td><td>' . $forecasticons[1] . '</td>';lf();
echo '</tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasttemp[0] . '</td><td>' . $forecasttemp[1] . '</td>';lf();
echo '</tr>';lf();
echo '<tr><td>
</td></tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasticons[2] . '</td><td>' . $forecasticons[3] . '</td>';lf();
echo '</tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasttemp[2] . '</td><td>' . $forecasttemp[3] . '</td>';lf();
echo '</tr>';lf();
echo '<tr><td>
</td></tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasticons[4] . '</td><td>' . $forecasticons[5] . '</td>';lf();
echo '</tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasttemp[4] . '</td><td>' . $forecasttemp[5] . '</td>';lf();
echo '</tr>';lf();
echo '<tr><td>
</td></tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasticons[6] . '</td><td>' . $forecasticons[7] . '</td>';lf();
echo '</tr>';lf();
echo '<tr>';lf();
echo '<td>' . $forecasttemp[6] . '</td><td>' . $forecasttemp[7] . '</td>';lf();
echo '</tr>';lf();
echo '</table>';lf();
echo '<div class="top">';lf();
?>
    </td>
    </tr>
  </table>
  </fieldset>        




<a name="about"></a>
<h2>About</h2>
<fieldset>
    <table cellspacing="0" cellpadding="5" class="full taL">
    <tr>
    <td class="full">
    <div><span class="b">Lat:</span> N 41 &deg; 30 ' 23 '' <span class="nobr">(41.302 &deg;)</span></div>
    <div><span class="b">Lon:</span> W -72 &deg; 79 ' 59 '' <span class="nobr">(-72.795 &deg;)</span></div>
    <div><span class="b">Elevation:</span> 120 ft</div>
    <div><span class="b">Hardware:</span> Davis Vantage Pro 2</div>
    <div><span class="b">Software:</span> Weather Display</div>
    </td>
    </tr>
  </table>
    <p style="padding: 0 9px;"><a href="http://stillweather.com" class="whiteButton">Branford Connecticut Weather Website</a></p>
</fieldset>        

<p class="taC"><a href="#top" class="grayButton" style="color: #FFF;">Top of Page</a></p>
      </body>
</html>

Thanks! Actually, it doesn’t look bad even in a full size browser window.

Question: where is wapdata.php found?

-Keith

Question: where is wapdata.php found?

Jack

Thank, Jack.

-Keith

Time has gone by, and lots of new iPhone’s have been sold, are there still no hope of an iPhone app for WD/WDL? iWDL would still be lovely in my mind.

Geir

I also would love–and pay for–a native iPhone app that pulled my Weather Display data.

Bill

The problem with iWDL is that it would need to be a total re-write. Mobile phone devices aren’t yet powerful enough to run a full version of Flash Player. My Nokia E71 has a valiant attempt, but it’s still pretty much unusable. The style would also need a fair bit of work to run on such small screens.

Why not create a simple web page designed for the iPhone screen to display your data instead? Assuming the iPhone caches web images you may find that the traffic to view such a page isn’t a lot more that downloading the clientraw.txt files a local app would need to download.

The whole point with making a native iPhone app for instance called iWDL is to access the clientraw files and display them in iPhone’s UI, just like MyWeather does or the Norwegian YR.no does with official weather data.