New recipe for Editor and Publisher by XanthanGum

This commit is contained in:
Kovid Goyal 2010-01-22 10:26:05 -07:00
parent 427061d5b8
commit 801a40ff23
2 changed files with 36 additions and 0 deletions

View File

@ -119,6 +119,8 @@
- title: stuff.co.nz
author: Krittika Goyal
- title: Editor and Publisher
author: XanthanGum
improved recipes:
- Physics Today

View File

@ -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'<!--endclickprintinclude-->.*</body>', re.DOTALL|re.IGNORECASE),
lambda match: '</body>'),]
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')]