View Single Post
Old 12-21-2010, 10:44 AM   #5
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by tbaac View Post
Thanks for that. I ended up with this:

Code:
    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...
It's correct now. Use the hash/pound mark to apply CODE tags around and preserve indenting.
Quote:

Unfortunately it seems to have no effect and the print line doesn't seem to get run.
I pasted your code into a working recipe and it worked perfectly. The article titles had the feed title prepended, and the print worked.

Quote:
I've noticed that in the existing Guardian recipe and in the Wikileaks recipe that someone nicely posted I get an error:
Quote:
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.
It looks like a bad page with bad html, not a recipe error.

Last edited by Starson17; 12-21-2010 at 10:46 AM.
Starson17 is offline   Reply With Quote