View Single Post
Old 04-21-2011, 11:56 AM   #7
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 kovidgoyal View Post
Use populate_article_metadata to insert the image into the soup.
Let me make sure I understand this. The soup in populate_article_metadata is the article soup, so it can be changed there, to change the article, while the other feed metadata and/or image is available.

There's code in another recipe (credit_slips) that did this sort of thing:

Code:
    def populate_article_metadata(self, article, soup, first):
        h2 = soup.find('h2')
        h2.replaceWith(h2.prettify() + '<p><em>Posted by ' + article.author + '</em></p>')
Quote:
And override the parsing of the feed to insert the image into the Article object (which means implementing parse_feeds in your recipe)
And here you simply add the image into the Article object to get it into the index page for this feed. I'm going to have to play with this one.
Kovid: thanks for the help.
Starson17 is offline   Reply With Quote