From 801a40ff23fbf805ad8dab7b30edc35516f7c140 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Jan 2010 10:26:05 -0700 Subject: [PATCH] New recipe for Editor and Publisher by XanthanGum --- Changelog.yaml | 2 ++ resources/recipes/editor_and_publisher.recipe | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 resources/recipes/editor_and_publisher.recipe diff --git a/Changelog.yaml b/Changelog.yaml index 8399532bb1..3d64dd5e4a 100644 --- a/Changelog.yaml +++ b/Changelog.yaml @@ -119,6 +119,8 @@ - title: stuff.co.nz author: Krittika Goyal + - title: Editor and Publisher + author: XanthanGum improved recipes: - Physics Today diff --git a/resources/recipes/editor_and_publisher.recipe b/resources/recipes/editor_and_publisher.recipe new file mode 100644 index 0000000000..e8a42e1f95 --- /dev/null +++ b/resources/recipes/editor_and_publisher.recipe @@ -0,0 +1,34 @@ +import re +from calibre.web.feeds.news import BasicNewsRecipe +class EandP(BasicNewsRecipe): + title = u'Editor and Publisher' + __author__ = u'Xanthan Gum' + description = 'News about newspapers and journalism.' + language = 'en' + no_stylesheets = True + + oldest_article = 7 + max_articles_per_feed = 100 + + # Font formatting code borrowed from kwetal + + extra_css = ''' + body{font-family:verdana,arial,helvetica,geneva,sans-serif ;} + h1{font-size: xx-large;} + h2{font-size: large;} + ''' + + # Delete everything before the article + + remove_tags_before = dict(name='font', attrs={'class':'titlebar_black'}) + + # Delete everything after the article + + preprocess_regexps = [(re.compile(r'.*', re.DOTALL|re.IGNORECASE), + lambda match: ''),] + + feeds = [(u'Breaking News', u'http://feeds.feedburner.com/EditorAndPublisher-BreakingNews'), + (u'Business News', u'http://feeds.feedburner.com/EditorAndPublisher-BusinessNews'), + (u'Newsroom', u'http://feeds.feedburner.com/EditorAndPublisher-Newsroom'), + (u'Technology News', u'http://feeds.feedburner.com/EditorAndPublisher-Technology'), + (u'Syndicates News', u'http://feeds.feedburner.com/EditorAndPublisher-Syndicates')]