mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Update ars_technica.recipe
This commit is contained in:
parent
13c8ee358c
commit
47acb8f1d4
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008-2012, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2008-2012, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
@ -27,6 +28,8 @@ class ArsTechnica(BasicNewsRecipe):
|
|||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
|
ignore_duplicate_articles = {'url', 'title'}
|
||||||
|
masthead_url = 'https://upload.wikimedia.org/wikipedia/commons/5/51/Ars_Technica_logo_%282016%29.svg'
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
body {font-family: Arial,sans-serif}
|
body {font-family: Arial,sans-serif}
|
||||||
.heading{font-family: "Times New Roman",serif}
|
.heading{font-family: "Times New Roman",serif}
|
||||||
@ -38,6 +41,20 @@ class ArsTechnica(BasicNewsRecipe):
|
|||||||
.image { display: block }
|
.image { display: block }
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(itemprop=['headline', 'description']),
|
dict(itemprop=['headline', 'description']),
|
||||||
classes('post-meta article-guts standalone'),
|
classes('post-meta article-guts standalone'),
|
||||||
@ -58,19 +75,14 @@ class ArsTechnica(BasicNewsRecipe):
|
|||||||
('Technology Lab', 'http://feeds.arstechnica.com/arstechnica/technology-lab'),
|
('Technology Lab', 'http://feeds.arstechnica.com/arstechnica/technology-lab'),
|
||||||
('Gear & Gadgets', 'http://feeds.arstechnica.com/arstechnica/gadgets'),
|
('Gear & Gadgets', 'http://feeds.arstechnica.com/arstechnica/gadgets'),
|
||||||
('Ministry of Innovation', 'http://feeds.arstechnica.com/arstechnica/business'),
|
('Ministry of Innovation', 'http://feeds.arstechnica.com/arstechnica/business'),
|
||||||
('Risk Assessment', 'http://feeds.arstechnica.com/arstechnica/security'),
|
|
||||||
('Law & Disorder', 'http://feeds.arstechnica.com/arstechnica/tech-policy'),
|
('Law & Disorder', 'http://feeds.arstechnica.com/arstechnica/tech-policy'),
|
||||||
('Infinite Loop', 'http://feeds.arstechnica.com/arstechnica/apple'),
|
('Infinite Loop', 'http://feeds.arstechnica.com/arstechnica/apple'),
|
||||||
('Opposable Thumbs', 'http://feeds.arstechnica.com/arstechnica/gaming'),
|
('Opposable Thumbs', 'http://feeds.arstechnica.com/arstechnica/gaming'),
|
||||||
('Scientific Method', 'http://feeds.arstechnica.com/arstechnica/science'),
|
('Scientific Method', 'http://feeds.arstechnica.com/arstechnica/science'),
|
||||||
('The Multiverse', 'http://feeds.arstechnica.com/arstechnica/multiverse'),
|
|
||||||
('Cars Technica', 'http://feeds.arstechnica.com/arstechnica/cars'),
|
('Cars Technica', 'http://feeds.arstechnica.com/arstechnica/cars'),
|
||||||
('Staff', 'http://feeds.arstechnica.com/arstechnica/staff-blogs'),
|
('Staff', 'http://feeds.arstechnica.com/arstechnica/staff-blogs'),
|
||||||
('Open Source', 'http://feeds.arstechnica.com/arstechnica/open-source'),
|
('Microsoft', 'http://feeds.arstechnica.com/arstechnica/microsoft'),
|
||||||
('microsoft', 'http://feeds.arstechnica.com/arstechnica/microsoft'),
|
('Others', 'https://feeds.arstechnica.com/arstechnica/index')
|
||||||
('software', 'http://feeds.arstechnica.com/arstechnica/software'),
|
|
||||||
('telecom', 'http://feeds.arstechnica.com/arstechnica/telecom'),
|
|
||||||
('Internet', 'http://feeds.arstechnica.com/arstechnica/web'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
recursions = 1
|
recursions = 1
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user