Fix Twitter crossposting by correctly calculating URL shortening

Fixes #2758