From cf4821cc5fc85f18b30bdb2d02d91cb5f346dfa1 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:30:21 +0530 Subject: [PATCH] Create Sonar21 --- recipes/icons/sonar21.png | Bin 0 -> 1237 bytes recipes/sonar21.recipe | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 recipes/icons/sonar21.png create mode 100644 recipes/sonar21.recipe diff --git a/recipes/icons/sonar21.png b/recipes/icons/sonar21.png new file mode 100644 index 0000000000000000000000000000000000000000..cf89748e32ba2a45adf89698bebcbcca10f81c4e GIT binary patch literal 1237 zcmV;`1SNklfJSes$*?EaNy+p{pS46 z;rF|sQ3cQkECBMHd10ki1%~3$7f?8xqdkFz7NCLvt{LR8L4ItIpT+7F6*7DdOaWVg?+yBLgRDMl0Q>gs z!|iqxi9{F}7+_Ge4Lx$?2zI-jpRQiz(B!1%+|)$$=1sVFkH*GEqR}X0V`G}_;6W%Y zg=^OUsHmu*p`ig0AsUS`G&DpelhNx6Am!!dqN=LgzkgqzJb5B*ZEXU`*|TRQl}brC z9G3L*vPgBcHe{+QJv}`Fh~MuQpU)?NG=RvZOCo`QK7=lpOEQ^^jE|4Y^768Dc6R0t z;jv@KNF);2Y&P23+VFTh0C+qey1Kfs*=&TvVK{zVM}FeO35tu0bNlLag53^QtFB6? z)6~?|;PrYrefqSn*8wPsf{0)?o9XWE#_e_kV6j+u^ym?G5o`}1g2lowz(b(4w3Noi z#z3Au)j}o{=gytu!i5X?{r+44v$L~QS69>9+spa$=jrb5)}3Aj zRvZ5%5L}V_`}=XZTAixd-07X$ab?OxL_4R9xK;HtB$;86K0v9h{ zBp#3B^?G%uHw^#qZ-YEBF~RuwI1YzH*EyX|C@F#c`>D0tQ4|HxX5i@2qr_q{s;a8= z4(lCgX=&lkojU-S&1RCxq#j6dF(KfOk`hv>)S8y}_4Vnp#bV*`;lmILK`=;JSs9g; zmAXA1k25qh#L1H<*W?gDYHMpHnM}&{>(@n9Rq5#HkZm9jT3STnaf#fxA*obK>gwtQ z5LH#hm3GcY_njMZx8^5x64x3}|dI?ZvvpRXekZY2`5wze`lI;wZZ@AnglM2JSC1Ofr# z@i-+D6C4~F0pPc}Ilh^lB^(YjH#f(~$OzNZ(_}Ikg25n5OH2QDAe;AqEP;$^D0A!| zfxMkZ-|(z%!}o!gfRBM~Xb-qmt_NCyx;$~F0`k)+2bBV%=6PUb^JiIc7LYFt_8_@0 zr)#i%Rwbib8Sy00000NkvXXu0mjfqoiC9 literal 0 HcmV?d00001 diff --git a/recipes/sonar21.recipe b/recipes/sonar21.recipe new file mode 100644 index 0000000000..3750b1a065 --- /dev/null +++ b/recipes/sonar21.recipe @@ -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']