Skip to content

Fixed the length of t.co; 22 for http and 23 for https#24

Open
nosuz wants to merge 1 commit into
co-meeting:masterfrom
nosuz:fix_tco_length
Open

Fixed the length of t.co; 22 for http and 23 for https#24
nosuz wants to merge 1 commit into
co-meeting:masterfrom
nosuz:fix_tco_length

Conversation

@nosuz
Copy link
Copy Markdown

@nosuz nosuz commented Dec 3, 2013

Crowyを大変便利に使わせていただいています。
Twitterにツイートする時、短縮したURLの文字数カウントに間違いを見つけましたので修正致しました。この変更を取り込んでいただけると幸いです。

変更内容
Tweetに含まれるURLは全てt.coに短縮されるので、URLの長さを判断する分岐を削除した。
極端に短いURLは、t.coで短縮されることで元より長くなる。

HTTPとHTTPS共に20文字のt.coに短縮されるとなっているが、HTTPは22文字、HTTPSは23文字に短縮される。
そこでHTTPとHTTPSをそれぞれ22文字と23文字とカウントするように修正した。

参照
URLは、長さに関係なくt.coに短縮される。
https://dev.twitter.com/docs/tco-url-wrapper
HTTPは22文字、HTTPSは23文字に短縮される。
https://dev.twitter.com/blog/upcoming-tco-changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant