View Single Post
Old 11-26-2009, 09:38 AM   #3
JayCeeEll
Connoisseur
JayCeeEll doesn't litterJayCeeEll doesn't litterJayCeeEll doesn't litter
 
JayCeeEll's Avatar
 
Posts: 87
Karma: 204
Join Date: Dec 2007
Location: Exeter, Devon, UK
Device: PRS-300
I have been playing around with trying to do this and I think that I need to reverse the entries within the feed.

As far as I can tell the best place to do this would be populate_from_feed in __init__.py from web.feeds

Currently populate_from_feed is:
PHP Code:
    def populate_from_feed(selffeedtitle=Noneoldest_article=7,
                           
max_articles_per_feed=100):
        
entries feed.entries
        feed 
feed.feed
        self
.title        feed.get('title'_('Unknown feed')) if not title else title
        self
.description  feed.get('description''')
        
image             feed.get('image', {})
        
self.image_url    image.get('href'None)
        
self.image_width  image.get('width'88)
        
self.image_height image.get('height'31)
        
self.image_alt    image.get('title''')

        
self.articles = []
        
self.id_counter 0
        self
.added_articles = []

        
self.oldest_article oldest_article

        
for item in entries:
            if 
len(self.articles) >= max_articles_per_feed:
                break
            
self.parse_article(item
I have tried adding entries.reverse before the for item in entries but this does not work.

In VB I could just replace the for with a loop from entries.count -1 to 0, but I am not sure how to do this in Python.

Any suggestions?
JayCeeEll is offline   Reply With Quote