View Single Post
Old 12-21-2010, 09:40 AM   #4
tbaac
Member
tbaac began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2009
Device: Sony PRS505
Thanks for that. I ended up with this:

def parse_feeds (self):
feeds = BasicNewsRecipe.parse_feeds(self)
for feed in feeds:
for article in feed.articles[:]:
feedps = feed.title + ' '
newtitle = feedps + article.title
article.title = newtitle
print 'New article title is: ', article.title
return feeds

Edit: The indenting looks correct in the above code segment but not when its shown in the post...

Unfortunately it seems to have no effect and the print line doesn't seem to get run.

I've noticed that in the existing Guardian recipe and in the Wikileaks recipe that someone nicely posted I get an error:

Parsing feed_1/index.html ...
Initial parse failed:
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/ebooks/oeb/base.py", line 816, in first_pass
data = etree.fromstring(data, parser=parser)
File "lxml.etree.pyx", line 2532, in lxml.etree.fromstring (src/lxml/lxml.etree.c:48634)
File "parser.pxi", line 1545, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:72245)
File "parser.pxi", line 1417, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:71041)
File "parser.pxi", line 898, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:67581)
File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:64257)
File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:65178)
File "parser.pxi", line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64521)
XMLSyntaxError: Opening and ending tag mismatch: hr line 38 and div, line 39, column 7

I'm running the latest version on Ubuntu linux. Anyone had this error and know a solution?
The recipes still create output.

Thanks.

Last edited by tbaac; 12-21-2010 at 09:42 AM.
tbaac is offline   Reply With Quote