mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Updated Ars Technica recipe
This commit is contained in:
parent
2a3fe21cf7
commit
b7ca8da79d
@ -1,50 +1,60 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008-2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
arstechnica.com
|
arstechnica.com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class ArsTechnica(BasicNewsRecipe):
|
class ArsTechnica2(BasicNewsRecipe):
|
||||||
title = 'Ars Technica'
|
title = u'Ars Technica'
|
||||||
description = 'The art of technology'
|
|
||||||
oldest_article = 7
|
|
||||||
language = _('English')
|
language = _('English')
|
||||||
no_stylesheets = True
|
__author__ = 'Darko Miletic'
|
||||||
__author__ = 'Michael Warner'
|
description = 'The art of technology'
|
||||||
|
publisher = 'Ars Technica'
|
||||||
|
category = 'news, IT, technology'
|
||||||
|
language = _('English')
|
||||||
|
oldest_article = 2
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
extra_css = """
|
no_stylesheets = True
|
||||||
body {
|
encoding = 'utf8'
|
||||||
font: normal 19px/180% Times, serif;
|
remove_javascript = True
|
||||||
}
|
use_embedded_content = False
|
||||||
|
|
||||||
|
html2lrf_options = [
|
||||||
|
'--comment', description
|
||||||
|
, '--category', category
|
||||||
|
, '--publisher', publisher
|
||||||
|
]
|
||||||
|
|
||||||
|
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||||
|
|
||||||
|
keep_only_tags = [dict(name='div', attrs={'id':['news-item-info','news-item']})]
|
||||||
|
|
||||||
h1, h2, h3, h4 {
|
|
||||||
font: bold 28px/100% Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
margin-top: 19px
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(id="Masthead"),
|
dict(name=['object','link','embed'])
|
||||||
dict(id="Banner"),
|
,dict(name='div', attrs={'class':'related-stories'})
|
||||||
dict(id="Nav"),
|
]
|
||||||
dict(name='div', attrs={'class':'ContentHeader'}),
|
|
||||||
dict(name='img'),
|
|
||||||
dict(name='div', attrs={'class':'Inset RelatedStories'}),
|
feeds = [
|
||||||
dict(name='div', attrs={'class':'Tags'}),
|
(u'Infinite Loop (Apple content)' , u'http://feeds.arstechnica.com/arstechnica/apple/' )
|
||||||
dict(name='div', attrs={'class':'PostOptions flat'}),
|
,(u'Opposable Thumbs (Gaming content)' , u'http://feeds.arstechnica.com/arstechnica/gaming/' )
|
||||||
dict(name='div', attrs={'class':'ContentFooter'}),
|
,(u'Gear and Gadgets' , u'http://feeds.arstechnica.com/arstechnica/gadgets/' )
|
||||||
dict(id="Sidebar"),
|
,(u'Chipster (Hardware content)' , u'http://feeds.arstechnica.com/arstechnica/hardware/' )
|
||||||
dict(id="LatestPosts"),
|
,(u'Uptime (IT content)' , u'http://feeds.arstechnica.com/arstechnica/business/' )
|
||||||
dict(id="Footer")]
|
,(u'Open Ended (Open Source content)' , u'http://feeds.arstechnica.com/arstechnica/open-source/')
|
||||||
feeds = [(u'News and Features', u'http://feeds.arstechnica.com/arstechnica/BAaf'),
|
,(u'One Microsoft Way' , u'http://feeds.arstechnica.com/arstechnica/microsoft/' )
|
||||||
(u'Nobel Intent (Science)', u'http://arstechnica.com/journals/science.rssx'),
|
,(u'Nobel Intent (Science content)' , u'http://feeds.arstechnica.com/arstechnica/science/' )
|
||||||
(u'Infinite Loop (Apple)', u'http://arstechnica.com/journals/apple.rssx'),
|
,(u'Law & Disorder (Tech policy content)' , u'http://feeds.arstechnica.com/arstechnica/tech-policy/')
|
||||||
(u'M-Dollar (Microsoft)', u'http://arstechnica.com/journals/microsoft.rssx'),
|
]
|
||||||
(u'Open Ended (Linux)', u'http://arstechnica.com/journals/linux.rssx'),
|
|
||||||
(u'Opposable Thumbs (Games)', u'http://arstechnica.com/journals/thumbs.rssx'),
|
def preprocess_html(self, soup):
|
||||||
(u'Kit (Hardware)', u'http://arstechnica.com/journals/hardware.rssx'),
|
ftag = soup.find('div', attrs={'class':'news-item-byline'})
|
||||||
(u'Journals', u'http://arstechnica.com/journals.rssx')]
|
if ftag:
|
||||||
|
ftag.insert(4,'<br /><br />')
|
||||||
|
for item in soup.findAll(style=True):
|
||||||
|
del item['style']
|
||||||
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user