mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Create Sonar21
This commit is contained in:
parent
5f429c3a2d
commit
cf4821cc5f
BIN
recipes/icons/sonar21.png
Normal file
BIN
recipes/icons/sonar21.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
42
recipes/sonar21.recipe
Normal file
42
recipes/sonar21.recipe
Normal file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||
|
||||
|
||||
class Sonar21(BasicNewsRecipe):
|
||||
title = 'Sonar21'
|
||||
__author__ = 'unkn0wn'
|
||||
oldest_article = 7
|
||||
language = 'en_US'
|
||||
max_articles_per_feed = 100
|
||||
use_embedded_content = False
|
||||
masthead_url = 'https://sonar21.com/wp-content/uploads/2024/10/logo_999999_720x216.png'
|
||||
cover_url = 'https://sonar21.com/wp-content/uploads/2024/09/sonar21_backplate_vertical.jpg'
|
||||
encoding = 'utf-8'
|
||||
browser_type = 'webengine'
|
||||
no_stylesheets = True
|
||||
remove_attributes = ['style', 'height', 'width']
|
||||
extra_css = '.entry-meta, .wp-element-caption, .wp-block-image { font-size: small; }'
|
||||
|
||||
keep_only_tags = [classes('entry-header entry-content')]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['iframe', 'svg']),
|
||||
classes('addtoany_share_save_container wpd-avatar'),
|
||||
]
|
||||
|
||||
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)
|
||||
|
||||
feeds = ['https://sonar21.com/feed']
|
Loading…
x
Reference in New Issue
Block a user