mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5525 ("The Nation" recipe not working)
This commit is contained in:
parent
9301385505
commit
a96002fa1b
@ -1,37 +1,40 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2008 - 2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
thenation.com
|
thenation.com
|
||||||
'''
|
'''
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Thenation(BasicNewsRecipe):
|
class Thenation(BasicNewsRecipe):
|
||||||
title = u'The Nation'
|
title = 'The Nation'
|
||||||
__author__ = u'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = u'Unconventional Wisdom Since 1865'
|
description = 'Unconventional Wisdom Since 1865'
|
||||||
|
publisher = 'The Nation'
|
||||||
|
category = 'news, politics, USA'
|
||||||
oldest_article = 120
|
oldest_article = 120
|
||||||
|
encoding = 'utf-8'
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
language = 'en'
|
language = 'en'
|
||||||
|
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
simultaneous_downloads = 1
|
|
||||||
delay = 1
|
delay = 1
|
||||||
timefmt = ' [%A, %d %B, %Y]'
|
masthead_url = 'http://www.thenation.com/sites/default/themes/thenation/images/logo-main.gif'
|
||||||
|
exra_css = ' body{font-family: Arial,Helvetica,sans-serif;} .print-created{font-size: small;} .caption{display: block; font-size: x-small;} '
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher' : publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
keep_only_tags = [ dict(name='div', attrs={'class':'main'}) ]
|
keep_only_tags = [ dict(attrs={'class':['print-title','print-created','print-content','print-links']}) ]
|
||||||
remove_tags = [
|
remove_tags = [dict(name='link')]
|
||||||
dict(name='div', attrs={'class':'mod tools'})
|
|
||||||
,dict(name='div', attrs={'class':'inset' })
|
|
||||||
,dict(name='div', attrs={'class':'share' })
|
|
||||||
,dict(name='ol' , attrs={'id' :'comments' })
|
|
||||||
,dict(name='p' , attrs={'class':'info' })
|
|
||||||
,dict(name='a' , attrs={'class':'comments' })
|
|
||||||
,dict(name='ul' , attrs={'class':'important'})
|
|
||||||
,dict(name='object')
|
|
||||||
]
|
|
||||||
|
|
||||||
feeds = [(u"Top Stories", u'http://feedproxy.google.com/TheNationEdPicks')]
|
feeds = [(u"Editor's Picks", u'http://www.thenation.com/rss/editors_picks')]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
return url.replace('.thenation.com/','.thenation.com/print/')
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
return self.adeify_images(soup)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user