PDA

View Full Version : Pausing RSS scroller - Show only fresh last news



Corsari
01-02-2010, 10:12 AM
1) Script Title:
Pausing RSS scroller

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/index.htm

3) Describe problem:
This is a request, not a problem and it does concern the RSS concept itself

Talking about the RSS source: a news site or either a blog, it may be alive since ages and for this reason its articles are getting older. In other words (as example) it does not make sense to read such a news "Firefox 1.5 is available for download" while Firefox is now version 3.5.x...

The request is about how to limit the feed items listing on an amount base or (more sophisticate) on the publishing date.
I mean as examples that the RSS feed box should scroll/read/list only the last 10 news (10 should be a variable to set in the script) or scroll only news that have a publishing date not older than 6 months (having as reference date server TODAY date and again posts age should be a variable).

Thank you for any suggestion, answer or thank you to DD if you implement this feature. This suggestion/request could apply to any RSS box "reader".

Kind regards

Ciao

Robert

jscheuer1
01-02-2010, 03:38 PM
The documentation for lastRSS has moved, it is now here:

http://lastrss.oslab.net/index.php?q=doc

and may be of some interest. Please note that there have probably been several updates to lastRSS since the version that comes with the DD script.

Anyways, in the version that comes with the script, it has (near the beginning):


// -------------------------------------------------------------------
// Public properties
// -------------------------------------------------------------------
var $default_cp = 'UTF-8';
var $CDATA = 'nochange';
var $cp = '';
var $items_limit = 0;
var $stripHTML = False;
var $date_format = '';

You may set that to like 10 and it will only fetch 10. I believe these are already sorted by default in most cases on the remote RSS server by date, so these would probably be the most recent 10 items.

There doesn't appear to be any simple way via the lastRSS to limit the date range though. If you feel you still need that, I think something can probably be worked out on the javascript side. It would require that the date info be fetched from the feed (I think that's the default), and, if you've changed the date format, I would need to know the format your dates are in.