|03-11-2011, 02:02 PM||#1|
Join Date: Mar 2011
Device: Kindle 3
Calibre rss recipe -- <em> tag in article titles?
This is my first time posting and I'm fairly new to writing recipes. I'm having a problem with a recipe that I'm using to download an rss feed to my Kindle3.
The recipe itself works fine except that the article titles sometimes contain <em> and </em> tags (for example, the article title on the Kindle and Calibre v. 0.7.48 will show "<em>Godzilla</em> vs. Real Life"). This was also occurring in the main title once you opened the article but I was able to remove that via "preprocess_html".
Since the "preprocess_html" did not affect the article title, can someone provide me some direction as to how to remove the <em> and </em> tags from the article title?
I've included the recipe that I'm using below.
import re from calibre.web.feeds.recipes import BasicNewsRecipe class AdvancedUserRecipe1288623850(BasicNewsRecipe): title = u'Hit and Run Blog' oldest_article = 1 max_articles_per_feed = 100 timefmt = '' encoding= 'cp1252' preprocess_regexps = [ (re.compile(r"<em>"),lambda match: ''), (re.compile(r"</em>"),lambda match: '') ] feeds = [(u'Hit and Run Blog', 'http://feeds.feedburner.com/reason/HitandRun')]
Last edited by Starson17; 03-11-2011 at 03:04 PM.
|03-11-2011, 03:03 PM||#2|
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
def populate_article_metadata(self, article, soup, first): print "Pop article title is: ", article.title article.title = article.title return
Last edited by Starson17; 03-11-2011 at 03:14 PM.
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|RSS article - page 1 of N||MarcinJunger||Recipes||0||03-06-2011 05:50 PM|
|Recipe for a RSS with a Hodgepodge of Sources?||spedinfargo||Recipes||1||03-01-2011 10:28 AM|
|Changing article titles in recipes||tbaac||Recipes||8||12-22-2010 01:03 PM|
|Help with Recipe inserting tag||TonytheBookworm||Recipes||1||09-25-2010 12:05 PM|
|Downloading and Converting Print version of RSS article||Daanish87||Calibre||1||06-11-2010 03:08 AM|