Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Putting a 24 Hour Time Delay on an RSS Reader

  • 01-03-2013 12:01PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2, Paid Member Posts: 817 ✭✭✭tawfeeredux


    Something like:

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


  • Registered Users, Registered Users 2 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, Registered Users 2, Paid Member Posts: 817 ✭✭✭tawfeeredux


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


  • Registered Users, Registered Users 2 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