Use DMs FP recipe

This commit is contained in:
Kovid Goyal 2010-07-02 11:15:45 -06:00
parent dbf0a42b2d
commit 1d80839b54

View File

@ -1,28 +1,45 @@
__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
www.foreignpolicy.com
'''
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
class AdvancedUserRecipe1278059020(BasicNewsRecipe): class ForeignPolicy(BasicNewsRecipe):
title = u'Foreign Policy' title = 'Foreign Policy'
pubisher = 'http://www.foreignpolicy.com' __author__ = 'Darko Miletic'
category = 'Magazine, USA Foreign Policy' description = 'International News'
__author__ = 'rty' publisher = 'Washingtonpost.Newsweek Interactive, LLC'
oldest_article = 7 category = 'news, politics, USA'
max_articles_per_feed = 100 oldest_article = 31
masthead_url = 'http://www.foreignpolicy.com/images/fp_logo.jpg' max_articles_per_feed = 200
feeds = [(u'Feed', u'http://www.foreignpolicy.com/node/feed')] no_stylesheets = True
remove_javascript = True encoding = 'utf8'
use_embedded_content = False use_embedded_content = False
no_stylesheets = True language = 'en'
language = 'en' remove_empty_feeds = True
encoding = 'utf-8' extra_css = ' body{font-family: Georgia,"Times New Roman",Times,serif } img{margin-bottom: 0.4em} h1,h2,h3,h4,h5,h6{font-family: Arial,Helvetica,sans-serif} '
conversion_options = {'linearize_tables':True}
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
keep_only_tags = [dict(attrs={'id':['art-mast','art-body','auth-bio']})]
remove_tags = [dict(name='iframe'),dict(attrs={'id':['share-box','base-ad']})]
remove_attributes = ['height','width']
feeds = [(u'Articles', u'http://www.foreignpolicy.com/node/feed')]
def print_version(self, url): def print_version(self, url):
return url + '?print=yes&hidecomments=no&page=full' return url + '?print=yes&page=full'
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return soup
remove_tags = [
dict(name='div', attrs={'id':'share-box'}),
]
keep_only_tags = [
# dict(name='div', attrs={'class':'cxArticleHeader'}),
dict(name='div', attrs={'id':['art-mast','art-body']}),
]