November 13th, 2003, 10:05 AM
Need help with table update
I am in the process of re-doing my web site and would like to automatically refresh and incorporate a specific weather table from the NWS web site (Current Conditions) for my area. National Weather Service I am not by any means a HTML master I know just enough to get through with FrontPage 2002, Notepad and some VERY basic HTML and alot of cutting and pasting. How would I be able make my website (using CSS template) go refresh every 50 minutes or so to the NWS weather page and update just the current weather conditions information within that table on the NWS website and then input it automatically onto my website?
I have searched this site ( for hours) and the web for the last couple of days and can not find anything to help (probably asking the wrong type of question)
If someone knows how to do this with and wouldn't mind showing me the code whether it is HTML or whatever that will work within Frontpage 2002 I would appreciate it
Thaniks in advance!!!
November 14th, 2003, 09:55 AM
If you have a scripting engine like PHP or ColdFusion on your web server you could probably do it without too too much trouble.
November 14th, 2003, 11:27 AM
I have a PHP bb on my server space, but I am truely unfamiliar with PHP. How would I do this???
November 14th, 2003, 12:00 PM
Post the URL of the page and describe specifically what part of it you want to pick up. I could tell you how to do it, but I don't know if it's legal or proper.
November 14th, 2003, 12:09 PM
According to the NWS using their information is NOT copyrighted or restricted I ahve already looked at the policies. The remote URL is herehere My site is here BATC The only information I would like to "grab or fetch" at least every thirty minutes is the CURRENT CONDITIONS area of the page. Nothing else. Please let me know if this is possible...Thanks in advance...
Below is the HTML (I think that's all of it) that I want to grab or fetch also:
<td width="326"><img src="/weather/images/fcicons/currentconds.jpg" width="326" height="20" border="0" alt="Current local weather"><br><br><table cellspacing="0" cellpadding="0" border="0" width="100%">
<td><span class="blue1">Knoxville, McGhee Tyson Airport</span><br>
Last Update on Nov 14, 12:53 pm EST<br><br></td>
<td colspan="2"><table cellspacing="0" cellpadding="0" border="0">
<td class="big" width="120" align="center">Mostly Cloudy<br><br>46°F<br>(8°C)</td>
<td rowspan="2" width="200"><table cellspacing="0" cellpadding="2" border="0" width="100%">
<td align="right">35 %</td>
<td align="right">NE 5 MPH</td>
<td align="right" nowrap>30.35" (1028.1 mb)</td>
<td align="right">20°F (-7°C)</td>
<td align="right">44°F (7°C)</td>
<td align="right">10.00 mi.</td>
</tr><tr><td nowrap><b><a href="/obslocal.php?warnzone=TNZ069&local_place=Knox+County&zoneid=EST&offset=18000" class="link">More Local Wx</a></b>:</td><td nowrap align="right"><b><a href="/data/obhistory/KTYS.html" class="link">2 Day History</a></b>:</td></tr>
November 14th, 2003, 01:21 PM
*edit* I forgot about the part about doing it every thirty minutes . . . there's a variety of ways to handle that . . . post in the PHP forum for more on that. The script below will just grab it every time someone accesses the page with the script.
put that script in a .php page and upload it to your web server.
$NWS_page = file_get_contents( 'http://www.srh.noaa.gov/data/forecasts/TNZ069.php?warnzone=tnz069&warncounty=tnc093' );
preg_match( '/(<td[^>]*><img [^>]*src="[^"]*currentconds.+)<img [^>]*src="[^"]*radandsat/s', $NWS_page, $matches );
$current_conditions = $matches;
Last edited by JMM; November 14th, 2003 at 01:25 PM.
November 14th, 2003, 03:54 PM
JMM< I appreciate the code but is there any way to make it work on a HTML page? Namely my index.htm page??? Just thought I would ask...
November 15th, 2003, 07:10 PM
I true newbie asking here!!
November 18th, 2003, 08:45 AM
This is all assuming you do in fact have PHP running on your web server, but it sounds like you do. If you really can not rename the index.htm file but want to display the weather table in it, there are a variety of things you could do, such as having a PHP script write new versions of index.htm incorporating the updated weather table, or use an iframe in index.htm that loads a PHP script with the code I posted.