This commit is contained in:
Kovid Goyal 2025-02-17 22:54:55 +05:30
parent f76b8307a5
commit 03cc258c25
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 5 additions and 6 deletions

View File

@ -77,7 +77,6 @@ class TheWire(BasicNewsRecipe):
now = datetime.now(datetime.timezone.utc) # Ensure 'now' is offset-aware
post_date = datetime.strptime(b['post_date'], '%Y-%m-%d %H:%M:%S').replace(tzinfo=datetime.timezone.utc) # Make 'post_date' offset-aware
if (now - post_date).days > self.oldest_article:
self.log('Skipping', title, 'as it is too old')
continue
title = b['post_title']
desc = b['post_excerpt']

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python
"""
'''
zaobao.com.sg
"""
'''
from calibre.web.feeds.news import BasicNewsRecipe, classes
@ -23,10 +23,10 @@ class ZAOBAO(BasicNewsRecipe):
resolve_internal_links = True
remove_empty_feeds = True
extra_css = """
extra_css = '''
.calibre-nuked-tag-figcaption {font-size:small; text-align:center; }
img {display:block; margin:0 auto;}
"""
'''
def get_cover_url(self):
soup = self.index_to_soup(

View File

@ -389,7 +389,7 @@ class FFMLProcessor:
if tree.node_kind() == NodeKinds.BLANK_LINE:
result += '\n\n'
elif tree.node_kind() == NodeKinds.BOLD_TEXT:
indent_text(("\\ " if result.endswith("?") else "") + f'**{tree.text()}**')
indent_text(('\\ ' if result.endswith('?') else '') + f'**{tree.text()}**')
elif tree.node_kind() == NodeKinds.CHARACTER:
result += tree.text()
elif tree.node_kind() == NodeKinds.CODE_BLOCK: