I don’t really understand what the problem is here, all URLs on Twitter are since a long time now automatically shortened using Twitters own t.co shortener, so regardless of how long your URL is in the compose window, you will have always the same amount of remaining characters.