Quote:
Originally Posted by kovidgoyal
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.