Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Putting a 24 Hour Time Delay on an RSS Reader

Options
  • 01-03-2013 12:01pm
    #1
    Registered Users Posts: 325 ✭✭


    Hi

    I am looking to build a very basic RSS reader that takes news stories from a site (say RTE Sports), and displays them 24 hours later.

    I came across this code which works perfectly for building the reader, but can anyone tell me how difficult it would be to add the 24 hour delay? And if its possible, how I might go about doing it?


    Cheers


Comments

  • Registered Users Posts: 795 ✭✭✭tawfeeredux


    Something like:

    var itemdate=new Date(datestr);
    itemdate.setDate(itemdate.getDate()-1);


  • Registered Users Posts: 325 ✭✭doyler442



    var itemdate=new Date(datestr);
    itemdate.setDate(itemdate.getDate()-1);

    Thanks for the reply - I'm just wondering where abouts would I put this code? Does it replace itemdate in the javascript?


    Thanks Again


  • Registered Users Posts: 795 ✭✭✭tawfeeredux


    Well just add the second line under the existing itemdate declaration. The available methods for the javascript Date object are here.


  • Registered Users Posts: 325 ✭✭doyler442


    After a bit of messing about with the code I got it working, but all that does is change the date to a day before but not the actual news story.

    I reckon I'm going to have to get the RSS news story, save it to a DB, and then display that 24 hours later.


Advertisement