diff --git a/browser.py b/browser.py index 97c0fec..93a59d5 100755 --- a/browser.py +++ b/browser.py @@ -898,6 +898,14 @@ if __name__ == "__main__": # Filter out short noise paragraphs (ads, nav links) if len(p_clean) > 85 and not p_clean.startswith("Follow ") and not p_clean.startswith("Read more") and not "click here" in p_clean.lower() and not "twitter" in p_clean.lower(): + # Standard library blocklist to discard site global header/footer navigation items + ignore_terms = [ + "British Broadcasting Corporation", "Watch Live", "HomeNewsSport", + "Special Series", "Up First", "All Up First Stories", "hide caption", + "LISTEN & FOLLOW", "Morning Edition", "Morning news brief", "Podcast" + ] + if any(term in p_clean for term in ignore_terms): + continue paragraphs.append(p_clean) # Keep top 8 substantial paragraphs