This commit is contained in:
SpudGunMan
2025-10-23 12:41:37 -07:00
parent 1250479219
commit 97a0ff3112
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -4,8 +4,8 @@ Mesh Bot is a feature-rich Python bot designed to enhance your [Meshtastic](http
* [Getting Started](#getting-started)
![Example Use](etc/pong-bot.jpg "Example Use")
#### TLDR
* [install.sh](INSTALL.md)
* [Configuration Guide](modules/README.md)
+7 -3
View File
@@ -4,6 +4,7 @@ import urllib.request
import xml.etree.ElementTree as ET
import html
from html.parser import HTMLParser
from bs4 import BeautifulSoup # Add this import
class MLStripper(HTMLParser):
def __init__(self):
@@ -16,9 +17,12 @@ class MLStripper(HTMLParser):
return ''.join(self.fed)
def strip_tags(html_text):
s = MLStripper()
s.feed(html_text)
return s.get_data()
# use BeautifulSoup to strip HTML tags
if not html_text:
return ""
soup = BeautifulSoup(html_text, "html.parser")
text = soup.get_text(separator=" ", strip=True)
return ' '.join(text.split())
RSS_FEED_URLS = rssFeedURL
RSS_FEED_NAMES = rssFeedNames