4 ms·
If all you want is shortening, then there shouldn't be a problem: if the t.co link is longer, just don't use it. This is different from data compression because
by philh 15y ago
If all you want is shortening, then there shouldn't be a problem: if the t.co link is longer, just don't use it. This is different from data compression because "pointers are automatically dereferenced": there's no functional difference between t.co/foo sending you to google.com and t.co/bar sending you to t.co/foo. (If I'm wrong about this, then it's still possible to not-make-longer everything that isn't a t.co link.)
A similar case with data compression would be if you can guarantee that the decompressed data is never a valid compressed file. In this case, compress something iff that makes it shorter, and decompress something iff it's compressed.