0

I have the code below that will grab an RSS feed and display it as a custom html feed shows these as scrolling text on a page.

" I would like to know how to make a timed call back to the RSS URL to display new information and drop out non current information. " Basically refresh the page on a timer..

function OnLoad() {
   // Create a feed instance that will grab Digg's feed.
  var feed = new google.feeds.Feed("http://131940.qld.gov.au/DMR.Modules/TTIEvents/RSS/RSS.aspx?regionid=0&eventcause=Incident");
   feed.setNumEntries(15);
    feed.includeHistoricalEntries();
    // Calling load sends the request off.  It requires a callback function.
feed.load(feedLoaded);
}

any help would be great.

Thanks in advance.

adroit18
  • 1
  • 1

1 Answers1

0

You need to use window.setInterval. Here's an example:

window.setInterval(OnLoad, 1000);

The first parameter is the name of your function, and the second parameter is the number of milliseconds that the browser should wait before calling that function again.

This example would call the function OnLoad once a second.

LonelyWebCrawler
  • 2,866
  • 4
  • 37
  • 57
  • Seems like you hit enter prematurely. Did you have a question about the code above? – LonelyWebCrawler Jul 01 '13 at 17:37
  • Hey Web Crawler, the link that is now being called via the timer does not refresh with the correct data. It will eventually update with the same data as the URL. But not immediately. The URL is linked to an RSS feed I see the data change on the links feed page but this takes some time to reflect via my feed widget. ANy ideas..why.. – adroit18 Jul 03 '13 at 03:33