mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix Foreign Policy
This commit is contained in:
parent
473ced12de
commit
728668f980
@ -6,40 +6,19 @@ www.foreignpolicy.com
|
|||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class ForeignPolicy(BasicNewsRecipe):
|
class AdvancedUserRecipe1349086293(BasicNewsRecipe):
|
||||||
title = 'Foreign Policy'
|
title = u'Foreign Policy'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = 'International News'
|
description = 'International News'
|
||||||
publisher = 'Washingtonpost.Newsweek Interactive, LLC'
|
publisher = 'Washingtonpost.Newsweek Interactive, LLC'
|
||||||
category = 'news, politics, USA'
|
category = 'news, politics, USA'
|
||||||
oldest_article = 31
|
oldest_article = 31
|
||||||
max_articles_per_feed = 200
|
max_articles_per_feed = 200
|
||||||
no_stylesheets = True
|
auto_cleanup = True
|
||||||
encoding = 'utf8'
|
|
||||||
use_embedded_content = False
|
|
||||||
language = 'en'
|
|
||||||
remove_empty_feeds = True
|
|
||||||
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 = {
|
feeds = [(u'Foreign_Policy', u'http://www.foreignpolicy.com/node/feed')]
|
||||||
'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&page=full'
|
return url + '?print=yes&hidecomments=yes&page=full'
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
|
||||||
for item in soup.findAll(style=True):
|
|
||||||
del item['style']
|
|
||||||
return soup
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user