48h article window, add CISA feeds, remove dead feeds
This commit is contained in:
+5
-5
@@ -219,12 +219,12 @@ class RSSFeedManager:
|
||||
'canonical_url': canonical_url,
|
||||
}
|
||||
|
||||
def is_article_from_today(self, published_dt: datetime) -> bool:
|
||||
"""Allow only items published on today's UTC date."""
|
||||
now_utc = datetime.now(timezone.utc).date()
|
||||
def is_article_recent(self, published_dt: datetime) -> bool:
|
||||
"""Allow articles published within the last 48 hours."""
|
||||
if published_dt.tzinfo is None:
|
||||
published_dt = published_dt.replace(tzinfo=timezone.utc)
|
||||
return published_dt.astimezone(timezone.utc).date() == now_utc
|
||||
age = datetime.now(timezone.utc) - published_dt.astimezone(timezone.utc)
|
||||
return age.total_seconds() <= 48 * 3600
|
||||
|
||||
def is_duplicate_article(self, article: Dict) -> bool:
|
||||
"""Check URL/content fingerprint duplicates against sent-history."""
|
||||
@@ -309,7 +309,7 @@ class RSSFeedManager:
|
||||
published_dt = datetime(*published[:6], tzinfo=timezone.utc)
|
||||
|
||||
# Strict real-time gate: today's UTC articles only.
|
||||
if not self.is_article_from_today(published_dt):
|
||||
if not self.is_article_recent(published_dt):
|
||||
continue
|
||||
|
||||
# Get content/description
|
||||
|
||||
Reference in New Issue
Block a user