Wrong estimation of the maximum length of a tweet resulting in missing hashtags / wrong content
Closed this issue · 2 comments
Until commit ff852be, the maximum "usable" length of a tweet was calculated by removing 22 from the maximum length (280), because twitter counted embedded links as 22 characters (or maybe 20, with a small margin, I don't remember), as URLs are wrapped with t.co
(see here). (code is here).
The commit c1d6499 introduced a change, by also removing the full length of the link URL to post. Posting long links consequently drastically reduces the number of available characters for the post content and associated hashtags. (code is here).
Since Twitter automatically wraps links with t.co
, and unless I am missing something, I think this is a bug that should be fixed by removing len(post_url)
. Moreover, the old value of 22 for self._link_cost
(here) should be updated to 23, see here (I assume this document is up to date, I haven't called the API directly).
@wilddeej Any thoughts about this?