Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hashtags and other filler from embeds #35

Open
gahmee opened this issue Sep 28, 2023 · 3 comments
Open

Remove hashtags and other filler from embeds #35

gahmee opened this issue Sep 28, 2023 · 3 comments

Comments

@gahmee
Copy link

gahmee commented Sep 28, 2023

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

@mikaelg79
Copy link

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.

@GeorgeWL
Copy link

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

@styledliving
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants