From 4e16eef4e1ec88e06f988c0055351743f84a994c Mon Sep 17 00:00:00 2001 From: io Date: Tue, 17 Aug 2021 05:55:47 +0000 Subject: [PATCH] add TODOs --- generators/markov.py | 1 + third_party/utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/generators/markov.py b/generators/markov.py index bea9268..5bf7a0e 100644 --- a/generators/markov.py +++ b/generators/markov.py @@ -40,6 +40,7 @@ def make_sentence(cfg): nlt = markovify.NewlineText if cfg['overlap_ratio_enabled'] else nlt_fixed + # TODO support replicating \n in output posts instead of squashing them together model = nlt("\n".join(toot[0].replace('\n', ' ') for toot in toots)) db.close() diff --git a/third_party/utils.py b/third_party/utils.py index 3680530..77e8175 100644 --- a/third_party/utils.py +++ b/third_party/utils.py @@ -79,7 +79,8 @@ def extract_post_content(text): for ht in soup.select("a.hashtag, a.mention"): # convert hashtags and mentions from links to text ht.unwrap() - for link in soup.select("a"): # convert example.com to just https://example.com if 'href' in link: # apparently not all a tags have a href, # which is understandable if you're doing normal web stuff, but on a social media platform??