Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-11-2007, 11:21 PM   PM User | #1
zone-5
New to the CF scene

 
Join Date: Jun 2007
Location: Okanogan
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
zone-5 is an unknown quantity at this point
Smile 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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
try
{
doc.Load("http://www.weather.gov/data/current_obs/KOMK.xml");
Xml1.Document = doc;
}
catch
{
Xml1.DocumentSource = "css/Weather.xml";
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Local Weather Conditions</title>
</head>
<body>
<form id="form1" runat="server">
<div style="font-family: Arial, 'Microsoft Sans Serif';font-size: 10pt;">
<asp:Xml ID="Xml1"
runat="server" TransformSource="css/Weatherall.xsl"
EnableViewState="false"></asp:Xml>
</div>
</form>
</body>
</html>


SOMEONE proposed
15 * * * * GET http://www.nws.noaa.gov/data/current_obs/KOMK.xml >
$HOME/public_html/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
zone-5 is offline   Reply With Quote
Old 06-15-2007, 03:53 PM   PM User | #2
miranda
Senior Coder

 
Join Date: Dec 2002
Location: Arlington, Texas USA
Posts: 1,062
Thanks: 4
Thanked 8 Times in 8 Posts
miranda is an unknown quantity at this point
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.
miranda is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:21 AM.


Advertisement
Log in to turn off these ads.