Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 13th, 2003, 10:05 AM
joeschmoe joeschmoe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Land of Oz (East Tennessee)
Posts: 16 joeschmoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!!!

Reply With Quote
  #2  
Old November 14th, 2003, 09:55 AM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
If you have a scripting engine like PHP or ColdFusion on your web server you could probably do it without too too much trouble.

Reply With Quote
  #3  
Old November 14th, 2003, 11:27 AM
joeschmoe joeschmoe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Land of Oz (East Tennessee)
Posts: 16 joeschmoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have a PHP bb on my server space, but I am truely unfamiliar with PHP. How would I do this???

Reply With Quote
  #4  
Old November 14th, 2003, 12:00 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
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.

Reply With Quote
  #5  
Old November 14th, 2003, 12:09 PM
joeschmoe joeschmoe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Land of Oz (East Tennessee)
Posts: 16 joeschmoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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%">
<tr align="center">
<td><span class="blue1">Knoxville, McGhee Tyson Airport</span><br>
Last Update on Nov 14, 12:53 pm EST<br><br></td>
</tr>
<tr>
<td colspan="2"><table cellspacing="0" cellpadding="0" border="0">
<tr>
<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%">
<tr bgcolor="#b0c4de">
<td><b>Humidity</b>:</td>
<td align="right">35 %</td>
</tr>
<tr bgcolor="#ffefd5">
<td><b>Wind Speed</b>:</td>
<td align="right">NE 5 MPH</td>
</tr>
<tr bgcolor="#b0c4de">
<td><b>Barometer</b>:</td>
<td align="right" nowrap>30.35" (1028.1 mb)</td>
</tr>
<tr bgcolor="#ffefd5">
<td><b>Dewpoint</b>:</td>
<td align="right">20°F (-7°C)</td>
</tr><tr bgcolor="#b0c4de">
<td><b>Wind Chill</b>:</td>
<td align="right">44°F (7°C)</td>
</tr><tr bgcolor="#ffefd5">
<td><b>Visibility</b>:</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>
</table></td></tr>

Reply With Quote
  #6  
Old November 14th, 2003, 01:21 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
voila

*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.

PHP Code:
<?php

$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[1];

echo 
$current_conditions;

?>


put that script in a .php page and upload it to your web server.

Last edited by JMM : November 14th, 2003 at 01:25 PM.

Reply With Quote
  #7  
Old November 14th, 2003, 03:54 PM
joeschmoe joeschmoe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Land of Oz (East Tennessee)
Posts: 16 joeschmoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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...

Reply With Quote
  #8  
Old November 15th, 2003, 07:10 PM
joeschmoe joeschmoe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Land of Oz (East Tennessee)
Posts: 16 joeschmoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Is there a way to this with some javascript so I can place the information on my index.htm page? Or am I asking for the moon

I true newbie asking here!!

Reply With Quote
  #9  
Old November 18th, 2003, 08:45 AM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
There's no way to do it with just HTML / JavaScript. And there's not going to be an easy way to get the PHP code to run in your index.htm file. But it may be very easy to rename it index.php and use the code in that.

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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Need help with table update


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway