Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
06-12-2007, 12:21 AM #1
- Join Date
- Jun 2007
- Thanked 0 Times in 0 Posts
need asp to check xml once an hour
I think I need something in my asp (calls xsl that pulls in National Weather Service xml) that works once an hour. I think what I need is something that will save the root xml document on my Internet server where I can access it all I want for those visiting my site. Does this make sense?
I am trying to pull in NWS xml and use it to show weather conditions. NWS asks users to only pull once an hour, otherwise it eats bandwidth and they will show access denied.
I have googled and learned of something called a cron?
Any help at code and where to put it in the apsx would be helpful.
script that works right now but I think calls each time is:
<%@ Page Language="C#" %>
<%@ OutputCache Location="None" VaryByParam="None" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
protected void Page_Load(object sender, EventArgs e)
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
Xml1.Document = doc;
Xml1.DocumentSource = "css/Weather.xml";
<html xmlns="http://www.w3.org/1999/xhtml" >
<title>Local Weather Conditions</title>
<form id="form1" runat="server">
<div style="font-family: Arial, 'Microsoft Sans Serif';font-size: 10pt;">
15 * * * * GET http://www.nws.noaa.gov/data/current_obs/KOMK.xml >
but did not say where it went in the script. I tried a couple different ways and it did not work. wonder abut that ">" dealy, too.
I am new at this. Please be genle
06-15-2007, 04:53 PM #2
- Join Date
- Dec 2002
- Arlington, Texas USA
- Thanked 8 Times in 8 Posts
Cron jobs are part of the Linux world and used with Apache and PHP. When you are using Microsoft O/S use a Scheduled task to run the code every hour. Just rewrite the code so that it will run outside of a web environment and then schedule it to run every hour.