Comments (3)
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.
I'd also say make it an optional URL Param, default to true, cause sometimes the joke is in the hashtags
from instafix.
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)
- Support for facebook? HOT 2
- If I use the Instafix API for my Telegram bot, will my Telegram bot face limitations due to high request volumes?
- Automatically ignore query string
- A docker version of the service doesn't response outside a container
- A docker version of the service can't find binary `instafix` on running HOT 2
- A self-hosted version of the service doesn't process video properly
- The ddinstagram.com is down HOT 3
- Website is down: server returns 502
- Some link are not embedded properly (?) HOT 2
- Website is down: server returns 502 HOT 1
- Problem with the `/grid/` endpoint HOT 4
- Gallery View HOT 2
- How to embed just a single image? HOT 1
- When a instagram reel or video have thumbnail it only shows the picture/thumbnail not the video HOT 3
- [Feature Request] Reels Audio
- Unicode Replacement Character (�) Appears When Preview Text is Sliced at an Unlucky Index HOT 1
- chore: Update Docker-compose and K8s deployment files to support `{d,g}.ddinstagram.com`
- Video returns Invalid Handle
- Reels do not embed, but can be embedded with simple url fix HOT 2
- "Post Might Not Be Available" for every post on specific public account HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instafix.