help with RSS feeds

This is the place for queries that don't fit in any of the other categories.

help with RSS feeds

Postby » Tue Sep 24, 2013 7:00 pm

I get the error message:

##### here is the error message ##########
Code: Select all
File "", line 25, in <module>
fo.write( feed.entries[1].description);
IndexError: list index out of range

When i try to make an RSS feed reader for my robot.

My code is:

Code: Select all
import feedparser
import subprocess
import sys

rss_url = ""
feed = feedparser.parse( rss_url )
posts = []

for i in range(1,len(feed['entries'])):
'title': feed['entries'][i].title,
'description': feed['entries'][i].summary,
'url': feed['entries'][i].link,
'content': feed['entries'][i].link,

#print feed.entries[1].title
# add a file to your directory and relist its path here
fo = open("", "wb")
#fo.write( feed.entries[1].title);
fo.write(" ")
fo.write( feed.entries[1].description);
fo.close()'echo ''|festival --tts qbo_rss.txt', shell=True)'python', shell=True)

**Note: I have tried 20 different feeds and they all do the same thing.

Any body know what is going on? I am retired and just playing with Python and my robot. I wish for it to do RSS feeds and say the joke, etc.
Last edited by micseydel on Tue Sep 24, 2013 7:06 pm, edited 1 time in total.
Reason: Code tags, first post lock.
Posts: 1
Joined: Tue Sep 24, 2013 6:58 pm

Re: help with RSS feeds

Postby ochichinyezaboombwa » Tue Sep 24, 2013 8:17 pm

what is len(feed['entries'])? Is there a reason for having "1" in range(1,len(feed['entries'])) ?
Posts: 203
Joined: Tue Jun 04, 2013 7:53 pm

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 6 guests