zigdon / twirssi

An irssi script allowing the use of Twitter from within the IRC client.
http://twirssi.com
134 stars 26 forks source link

request - shorten links before testing against the 140 character limit #73

Open SonOfSunTzu opened 10 years ago

SonOfSunTzu commented 10 years ago

If the user cut and pastes a URL into twirssi it counts towards the 140 character limit in full, whereas only the shortened version will be used in the actual tweet.

If possible the original URL should be shortened to a t.co URL, or other service, before the number of characters is counted against the 140 character limit.

Thank you.

zigdon commented 10 years ago

It's not that we need to shorten the urls ourselves, but we should just adjust the counting so that we assume the current length of t.co urls (23 characters, currently).

tsibley commented 10 years ago

Alternatively, just recognize the error codes from Twitter's API for a too-long tweet. Since t.co shortening only happens upon status update, just ignore counting chars and simply try to update the status. If it works, you're done! Otherwise, tell the user "tweet too long" if that's the error cause.

Unless there's a need for an active char count in the status bar, it's easier just to avoid char counting all together.