Quantcast
Channel: Active questions tagged feedparser - Stack Overflow
Viewing all articles
Browse latest Browse all 106

Python Feedparser: How can I check for new RSS data?

$
0
0

I'm using the feedparser python library to pull RSS data from a feed continuously. I've written my python code in such a way that I can ask for a single instance of the RSS data. Here's my code currently:

import feedparserrssPR = feedparser.parse('http://www.prnewswire.co.uk/rss/consumer-technology/wireless-      communications-news.rss')rssDataList = []for index, item in enumerate(rssPR.entries):    rssDataList.append([item.published.encode('utf-8'), item.title.encode('utf-8')])print rssDataList[0]  #for debugging purposesprint rssPR.modified #for testing purposes
  1. What can I add to my code so that it will only check for new RSS data if and only if the RSS has been modified?

  2. Let's say I have a list of 10 RSS items, and the RSS feed has been updated with 2 new RSS items. How can I only add those 2 items to the rssDataList I've created? I don't want to keep adding the same RSSs to my database.


Viewing all articles
Browse latest Browse all 106

Trending Articles