mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-27 18:29:23 +00:00
Added util to parse mastodon toots (very basic, not yet implemented)
This commit is contained in:
11
src/sessions/mastodon/utils.py
Normal file
11
src/sessions/mastodon/utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from html.parser import HTMLParser
|
||||
|
||||
class HTMLFilter(HTMLParser):
|
||||
text = ""
|
||||
def handle_data(self, data):
|
||||
self.text += data
|
||||
|
||||
def html_filter(data):
|
||||
f = HTMLFilter()
|
||||
f.feed(data)
|
||||
return f.text
|
Reference in New Issue
Block a user