InstaFix icon indicating copy to clipboard operation
InstaFix copied to clipboard

Remove hashtags and other filler from embeds

Open gahmee opened this issue 1 year ago • 3 comments

It would be beneficial to have only the title and the posting user, without excessive hashtags and filler text, as it occupies excessive space.

example below:

Capture

gahmee avatar Sep 28 '23 14:09 gahmee

Stripping hashtags and spacer lines would be as simple as changing

caption_text = caption.text().strip()

into

caption_text = caption.text().strip()
caption_text = re.sub("#\w+", "", caption_text)
caption_text = re.sub("(?m)^\W+$", "", caption_text)

The first substitution will strip out any single word starting with #, the second will remove lines that have nothing but non-word characters, including any empty whitespace and line breaks left behind by the first substitution. There are a lot of edge cases that might break this though, such as lines with only emojis would likely get stripped or someone using a letter like x as filler wouldn't but it's a start.

mikaelg79 avatar Oct 05 '23 20:10 mikaelg79

I'd also say make it an optional URL Param, default to true, cause sometimes the joke is in the hashtags

GeorgeWL avatar Oct 23 '23 10:10 GeorgeWL

would it be easier to limit to 140 characters? instafix's point is making images and video available for users to see. the commentary is nice, but the imagery is the most important part.

styledliving avatar Feb 01 '24 20:02 styledliving