Reputation: 1646
I'm using the goo.gl link shortener API in my app to send urls to twitter along with a link. I've been allowing users to submit 119 characters, appending a space, and then the URL because I was under the impression that they were always 19 characters. This should leave me with one to spare.
Unfortunately I've been getting some "tweet is too long" errors and I can't seem to find any documentation about the possible range of goo.gl url lengths. Does anyone know what the max is or know where some reliable documentation on it is?
Upvotes: 0
Views: 2571
Reputation: 4092
Twitter now automatically shortens all links by itself, using t.co
. Don't do it by yourself.
If you are not using the opt-in features, only links shorter in length than a t.co URL will be wrapped by t.co. All links t.co-length or longer should be considered as t.co's maximum length. For example, if help/configuration reports 20 characters as the maximum length, and a user posts a link that is 125 characters long, it should be considered as 20 characters long instead. If they post a link that is 18 characters long, it's still only 18 characters long.
At the moment short_url_length
is equal 22
(https://api.twitter.com/1/help/configuration.json)
Upvotes: 2