Why is this tweet considered over 140 characters when Twitter displays (8) left?


#1

When I copy and paste this in Twitter’s compose it tells me I have 8 characters left:

“Download this new HubSpot guide to access ten quick ways to start building inbound links using social media ~ http://www.jdoqocy.com/click-5585028-11079226

But when I go to tweet it, I get: “Your Tweet was over 140 characters. You’ll have to be more clever.”

I’ve also noticed the same error message being returned via the Twitter API.


#2

Strange. When you issue the request to the API, what does that request look like? How are you encoding the URL in the status body? What’s the exact error message you’re getting from the API?


#3

We use Twitter4J to make all our compose requests, but it’s not only failing in the API it’s also failing if you do it directly on Twitter’s site (with Twitter reporting you have 8 characters left and then getting the over 140 message). Here is an example of the DEBUG output using Twitter4j, I removed the oauth tokens.

INFO 2013-03-22 09:43:37,546 [pool-84-thread-1] TwitterClientImpl.java,23 | Sending status: StatusUpdate{status=‘Download this new HubSpot guide to access ten quick ways to start building inbound links using social media ~ http://www.jdoqocy.com/click-5585028-11079226’, inReplyToStatusId=-1, location=null, placeId=‘null’, displayCoordinates=true, possiblySensitive=false, mediaName=‘null’, mediaBody=null, mediaFile=null}
DEBUG 2013-03-22 09:43:37,572 [pool-84-thread-1] SLF4JLogger.java,67 | Request:
DEBUG 2013-03-22 09:43:37,572 [pool-84-thread-1] SLF4JLogger.java,75 | POST https://api.twitter.com/1.1/statuses/update.json
DEBUG 2013-03-22 09:43:37,573 [pool-84-thread-1] SLF4JLogger.java,75 | OAuth base string: POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fstatuses%2Fupdate.json&include_entities%3D1%26include_rts%3D1%26oauth_consumer_key%%26oauth_nonce%%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1363963417%26oauth_token%3D288979192-y7YAIyDm4o8cwdCv6fkqfdakiMVqVkdTRCCyO3hu%26oauth_version%3D1.0%26status%3DDownload%2520this%2520new%2520HubSpot%2520guide%2520to%2520access%2520ten%2520quick%2520ways%2520to%2520start%2520building%2520inbound%2520links%2520using%2520social%2520media%2520~%2520http%253A%252F%252Fwww.jdoqocy.com%252Fclick-5585028-11079226
DEBUG 2013-03-22 09:43:37,718 [pool-84-thread-1] SLF4JLogger.java,75 | OAuth signature: *****
DEBUG 2013-03-22 09:43:37,718 [pool-84-thread-1] SLF4JLogger.java,75 | Authorization: *******************************************************************************************************************************************************************************************************************************************************************************
DEBUG 2013-03-22 09:43:37,719 [pool-84-thread-1] SLF4JLogger.java,67 | X-Twitter-Client-URL: http://twitter4j.org/en/twitter4j-3.0.2.xml
DEBUG 2013-03-22 09:43:37,719 [pool-84-thread-1] SLF4JLogger.java,67 | X-Twitter-Client: Twitter4J
DEBUG 2013-03-22 09:43:37,719 [pool-84-thread-1] SLF4JLogger.java,67 | Accept-Encoding: gzip
DEBUG 2013-03-22 09:43:37,719 [pool-84-thread-1] SLF4JLogger.java,67 | User-Agent: twitter4j http://twitter4j.org/ /3.0.2
DEBUG 2013-03-22 09:43:37,719 [pool-84-thread-1] SLF4JLogger.java,67 | X-Twitter-Client-Version: 3.0.2
DEBUG 2013-03-22 09:43:37,719 [pool-84-thread-1] SLF4JLogger.java,75 | Post Params: status=Download%20this%20new%20HubSpot%20guide%20to%20access%20ten%20quick%20ways%20to%20start%20building%20inbound%20links%20using%20social%20media%20~%20http%3A%2F%2Fwww.jdoqocy.com%2Fclick-5585028-11079226&include_entities=1&include_rts=1
DEBUG 2013-03-22 09:43:38,241 [pool-84-thread-1] SLF4JLogger.java,67 | Response:
DEBUG 2013-03-22 09:43:38,242 [pool-84-thread-1] SLF4JLogger.java,67 | HTTP/1.1 403 Forbidden
DEBUG 2013-03-22 09:43:38,242 [pool-84-thread-1] SLF4JLogger.java,67 | content-type: application/json; charset=utf-8
DEBUG 2013-03-22 09:43:38,242 [pool-84-thread-1] SLF4JLogger.java,67 | x-frame-options: SAMEORIGIN
DEBUG 2013-03-22 09:43:38,242 [pool-84-thread-1] SLF4JLogger.java,67 | x-mid: 8d3282e7fc476719a3747da7d41b06c06050bbc1
DEBUG 2013-03-22 09:43:38,242 [pool-84-thread-1] SLF4JLogger.java,67 | last-modified: Fri, 22 Mar 2013 14:44:17 GMT
DEBUG 2013-03-22 09:43:38,242 [pool-84-thread-1] SLF4JLogger.java,67 | status: 403 Forbidden
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | x-transaction-mask: a6183ffa5f8ca943ff1b53b5644ef1148ae7a68f
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | content-encoding: gzip
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | date: Fri, 22 Mar 2013 14:44:17 GMT
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | x-transaction: 456855a1d968eb00
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | vary: Accept-Encoding
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | pragma: no-cache
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | x-runtime: 0.07266
DEBUG 2013-03-22 09:43:38,243 [pool-84-thread-1] SLF4JLogger.java,67 | expires: Tue, 31 Mar 1981 05:00:00 GMT
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: guest_id=v1%3A136396345739089971; Domain=.twitter.com; Path=/; Expires=Sun, 22-Mar-2015 14:44:17 UTC
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: _twitter_sess=
***************; domain=.twitter.com; path=/; HttpOnly
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: twid=u%3D288979192%7CoM2P58hKezbEBhYYRU973BmBZD4%3D; domain=.twitter.com; path=/; secure
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: lang=en; path=/
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: lang=en; path=/
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: lang=en; path=/
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: dnt=; domain=.twitter.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | set-cookie: k=10.40.68.106.1363963457437285; path=/; expires=Fri, 29-Mar-13 14:44:17 GMT; domain=.twitter.com
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | content-length: 84
DEBUG 2013-03-22 09:43:38,244 [pool-84-thread-1] SLF4JLogger.java,67 | server: tfe
DEBUG 2013-03-22 09:43:38,245 [pool-84-thread-1] SLF4JLogger.java,67 | x-access-level: read-write-directmessages
DEBUG 2013-03-22 09:43:38,254 [pool-84-thread-1] SLF4JLogger.java,67 | {“errors”:[{“code”:186,“message”:“Status is over 140 characters”}]}


#4

I’m not sure if you got my last response so I am trying again. We use Twitter4j to post tweets.

Here is the output from my logs running the same tweet through it. It consistently fails using both the API and Twitter’s webapp natively.

INFO 2013-03-22 13:15:53,538 [pool-88-thread-1] TwitterClientImpl.java,23 | Sending status: StatusUpdate{status=‘Download this new HubSpot guide to access ten quick ways to start building inbound links using social media ~ http://www.jdoqocy.com/click-5585028-11079226’, inReplyToStatusId=-1, location=null, placeId=‘null’, displayCoordinates=true, possiblySensitive=false, mediaName=‘null’, mediaBody=null, mediaFile=null}
DEBUG 2013-03-22 13:15:53,538 [pool-88-thread-1] SLF4JLogger.java,67 | Request:
DEBUG 2013-03-22 13:15:53,538 [pool-88-thread-1] SLF4JLogger.java,75 | POST https://api.twitter.com/1.1/statuses/update.json
DEBUG 2013-03-22 13:15:53,540 [pool-88-thread-1] SLF4JLogger.java,75 | OAuth base string: POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fstatuses%2Fupdate.json&include_entities%3D1%26include_rts%3D1%26oauth_consumer_key%3DejhMWa4qjIjFBQj4NIMDyg%26oauth_nonce%3D2760804792%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1363976153%26oauth_token%3D288979192-y7YAIyDm4o8cwdCv6fkqfdakiMVqVkdTRCCyO3hu%26oauth_version%3D1.0%26status%3DDownload%2520this%2520new%2520HubSpot%2520guide%2520to%2520access%2520ten%2520quick%2520ways%2520to%2520start%2520building%2520inbound%2520links%2520using%2520social%2520media%2520~%2520http%253A%252F%252Fwww.jdoqocy.com%252Fclick-5585028-11079226
DEBUG 2013-03-22 13:15:53,540 [pool-88-thread-1] SLF4JLogger.java,75 | OAuth signature: 66R6l6sB4rtn88M5p6RZFOjwavw=
DEBUG 2013-03-22 13:15:53,541 [pool-88-thread-1] SLF4JLogger.java,75 | Authorization: ********************************************************************************************************************************************************************************************************************************************************************************
DEBUG 2013-03-22 13:15:53,541 [pool-88-thread-1] SLF4JLogger.java,67 | X-Twitter-Client-URL: http://twitter4j.org/en/twitter4j-3.0.2.xml
DEBUG 2013-03-22 13:15:53,541 [pool-88-thread-1] SLF4JLogger.java,67 | X-Twitter-Client: Twitter4J
DEBUG 2013-03-22 13:15:53,541 [pool-88-thread-1] SLF4JLogger.java,67 | Accept-Encoding: gzip
DEBUG 2013-03-22 13:15:53,541 [pool-88-thread-1] SLF4JLogger.java,67 | User-Agent: twitter4j http://twitter4j.org/ /3.0.2
DEBUG 2013-03-22 13:15:53,541 [pool-88-thread-1] SLF4JLogger.java,67 | X-Twitter-Client-Version: 3.0.2
DEBUG 2013-03-22 13:15:53,542 [pool-88-thread-1] SLF4JLogger.java,75 | Post Params: status=Download%20this%20new%20HubSpot%20guide%20to%20access%20ten%20quick%20ways%20to%20start%20building%20inbound%20links%20using%20social%20media%20~%20http%3A%2F%2Fwww.jdoqocy.com%2Fclick-5585028-11079226&include_entities=1&include_rts=1
DEBUG 2013-03-22 13:15:54,046 [pool-88-thread-1] SLF4JLogger.java,67 | Response:
DEBUG 2013-03-22 13:15:54,046 [pool-88-thread-1] SLF4JLogger.java,67 | HTTP/1.1 403 Forbidden
DEBUG 2013-03-22 13:15:54,046 [pool-88-thread-1] SLF4JLogger.java,67 | content-type: application/json; charset=utf-8
DEBUG 2013-03-22 13:15:54,046 [pool-88-thread-1] SLF4JLogger.java,67 | x-frame-options: SAMEORIGIN
DEBUG 2013-03-22 13:15:54,046 [pool-88-thread-1] SLF4JLogger.java,67 | x-mid: 9bc363477303c3a61b9617ba660ab1f24a604bf8
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | last-modified: Fri, 22 Mar 2013 18:16:39 GMT
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | status: 403 Forbidden
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | x-transaction-mask: a6183ffa5f8ca943ff1b53b5644ef1148ae7a68f
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | content-encoding: gzip
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | date: Fri, 22 Mar 2013 18:16:39 GMT
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | x-transaction: aa20356a1560c836
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | vary: Accept-Encoding
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | pragma: no-cache
DEBUG 2013-03-22 13:15:54,047 [pool-88-thread-1] SLF4JLogger.java,67 | cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | x-runtime: 0.08020
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | expires: Tue, 31 Mar 1981 05:00:00 GMT
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: guest_id=v1%3A136397619985979788; Domain=.twitter.com; Path=/; Expires=Sun, 22-Mar-2015 18:16:39 UTC
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: _twitter_sess=BAh7CToPY3JlYXRlZF9hdGwrCMUeUZM9AToMY3NyZl9pZCIlMjIxNTczZjNj%250AY2FlNmQxYTlmMzIzYWU4ODY4YmUzN2U6B2lkIiVkYjgwZGE3NmRjNjQxZGRi%250AYTlhNDlkNWYyN2I3ZWI2NSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6%250ARmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D–3594f50acf005202b7ab6e5e0db15daeb5895b38; domain=.twitter.com; path=/; HttpOnly
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: twid=u%3D288979192%7CoM2P58hKezbEBhYYRU973BmBZD4%3D; domain=.twitter.com; path=/; secure
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: lang=en; path=/
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: lang=en; path=/
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: lang=en; path=/
DEBUG 2013-03-22 13:15:54,048 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: dnt=; domain=.twitter.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
DEBUG 2013-03-22 13:15:54,049 [pool-88-thread-1] SLF4JLogger.java,67 | set-cookie: k=10.35.34.113.1363976199860775; path=/; expires=Fri, 29-Mar-13 18:16:39 GMT; domain=.twitter.com
DEBUG 2013-03-22 13:15:54,049 [pool-88-thread-1] SLF4JLogger.java,67 | content-length: 84
DEBUG 2013-03-22 13:15:54,049 [pool-88-thread-1] SLF4JLogger.java,67 | server: tfe
DEBUG 2013-03-22 13:15:54,049 [pool-88-thread-1] SLF4JLogger.java,67 | x-access-level: read-write-directmessages
DEBUG 2013-03-22 13:15:54,049 [pool-88-thread-1] SLF4JLogger.java,67 | {“errors”:[{“code”:186,“message”:“Status is over 140 characters”}]}

ERROR 2013-03-22 13:15:54,049 [pool-88-thread-1] TwitterClientImpl.java,26 | Twitter library failed
403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
message - Status is over 140 characters
code - 186


#5

I am also seeing a similar issue with a tweet such as this:

“Dinos cuantos goles nos llevaran al triunto y disfruta esta promo! #Vivelaroja #viveavanzado http://bit.ly/11gKAXD pic.twitter.com/FBeLFs29kl

When copy/pasted into twitter.com I see (2) characters left, but yet I get the over 140 error. I think there are algorithmic differences in your Ruby/JavaScript versions of twitter-text, and the question is should ‘pic.twitter.com/FBeLFs29kl’ be treated as 22 characters or not.


#6

Any update on this?


#7

having the exact same issue here, even though no url’s are included. Ex:
Consistently one of the best coffees one can buy - Sipping on La Esmeralda Gesha Special (Panama) by @ghowellcoffee via @CaffeineApp

132 characters, Twitter4j Twitter API response: Status is over 140 characters


#8

Same issue here. I’m seeing an issue in API 1.1 and on Twitter’s compose. I try to enter the following below:

Get iPad/iPhone app and pubs from @pva1946 at http://nxtbk.co/8pi. Check out this great spinal cord injury/disease pub http://bit.ly/ZtPsdb

Character count is 140 characters and I receive the aforementioned error: “Status creation failed: The text of your tweet is too long.”

Is there any update?


#9