I've made a live feed which grabs content off multiple sources, inserts into my database and then spits out the latest 20 articles.
The feed updates every minute, which is where I've run into a design flaw.
Everything worked fine and dandy until I wanted to add day headers.
Adding the headers was fine, it was processed in PHP and added before they were retrieved via jQuery's AJAX.
The problem is, the header script (php) is always run when retrieving data from the database, meaning this:
Page Opens, feed is displayed:
TODAY blah blah2 blah3 YESTERDAY blah4 blah5
When the feed checks for updates (and if there is at least one), it comes out like this:
TODAY blah0 TODAY blah blah1 ...
I've been jotting down a few ideas to go about solving this on the jQuery side, possiby when retriving the data, check to see if the day exists in the feed and prepend the updated items to after that day (<div>) header
or, I could search for and remove the current header in the feed and just prepend the data at the top.
Though, another issue is that I want the feed day headers to update on a new day too, so if one said TODAY at 23:59, it would change to YESTERDAY at 00:00.
That could be solved with some AJAX and a hidden timestamp though, possibly.
Though without rushing ahead of myself, I'm still confronted with the first problem and no definate solution yet, so I'm asking for help here, if possible.
Script/snippets are available on request if needed, just ask.
Any help you can give on this matter is appreciated,
This post has been edited by Bladescope: 16 June 2010 - 08:25 AM