Giter VIP home page Giter VIP logo

Comments (3)

mikaelg79 avatar mikaelg79 commented on June 18, 2024

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.

from instafix.

GeorgeWL avatar GeorgeWL commented on June 18, 2024

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

from instafix.

styledliving avatar styledliving commented on June 18, 2024

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.

from instafix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.