diesdasdigital / kirby-meta-knight

🔍 Meta Knight – SEO & Social Media Sharing Plugin for Kirby.
MIT License
109 stars 18 forks source link

Twitter character count should be counting down, not up. #44

Open shawninder opened 3 years ago

shawninder commented 3 years ago

The Twitter description field has a counter that helps us know how many characters we are using there.

I think it would make more sense to have a countdown here, indicating not how many characters are in there, but how many characters you can still add before you reach the twitter limit.

With this counting up method, we don't get the information of what that limit might be.

There is also the issue of how Twitter counts characters. If I recall correctly, a URL is always counted as 23 characters, even if it is much longer. Your counter on the twitter description field does not take this into account either.

Combined, these two issues make the existing counter pretty much useless.

Would you consider using a Twitter-specific countdown here instead? If you're not sure how to achieve this I could contribute a bit of code, let me know!

shawninder commented 3 years ago

Apparently Twitter have a helper library for exactly this purpose: https://github.com/twitter/twitter-text