Quantcast
Channel: Is there a way in feedparser to retrieve only X number of entries from a feed URL? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Is there a way in feedparser to retrieve only X number of entries from a feed URL?

$
0
0

I need to fetch the last 3 feeds from a feed url and display. The code that i'm currently using is :

import feedparserfeedUrl = ""feed = feedparser.parse( feedUrl )length = len(feed['entries']) stop =  (length-4) if length > 3 else -1for i in range(length-1, stop, -1):    print feed['items'][i]['title'] +""+ feed['items'][i]['link']

Is there a way using ETags and/or Last-Modified headers to accomplish this?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images