Updating t.co links wrapping opt-in options?

rno
@rno Arnaud Meunier

Hey Developers,

We’re considering adding the new Twitter Text linking strategy to the two opt-in developer features we introduced a month ago, so you could simulate how URLs without protocol linking and t.co URLs wrapping will look like on October 10:

  • Per-tweet basis: Using the wrap_links=true parameter to the POST statuses/update and POST direct_messages/new.
  • Application basis: Visiting your application settings and configuring this option globally for your application.

Would it be useful if we provided early functionality via these paramaters, or would you prefer that we keep the current behavior of these two opt-in options?

1 year 51 weeks ago

Replies

robinvw1
@robinvw1 Robin v Wijngaarden

I think it would be useful. I see a lot of people forgetting to put http:// before their links and the text library doesn't wrap it up to a link.

1 year 51 weeks ago
TvdW
@TvdW Tom van der Woerdt

I completely agree. It would mean that I have to remove certain code from my application that already did this, but really, this change is awesome :-)

BUT
Does this only affect the entities or also change the actual tweet text? After all, with the upcoming change of shortening all URLs with t.co, there'll be a big difference between "twitter.com" (11 chars) and http://t.co/ (21 chars).

1 year 51 weeks ago
episod
@episod Taylor Singletary

This will, in fact, alter tweet text as well. The original "almost a URL and likely meant to be a URL by context & intention" string will be replaced with a "t.co"-based link in the tweet body. If you were building a tweet box with a character counter, you would want to consider any strings that match a URL-like regular expression in twitter-text to be the current maximum length of t.co URLs and present that adjusted count to the user.

1 year 51 weeks ago
tapbot_paul
@tapbot_paul Paul Haddad

Yes it would be useful to have opt-in options prior to the date, probably better if they are separate options from the current wrap_links but either way it'd be useful.

1 year 51 weeks ago
idibidiSays
@idibidiSays Mr. idi.bidi

Questions:

  1. What is the max length of t.co links?
  2. If tweet contains bit.ly/abcdef and it is 140 chars long incl. the bit.ly string then when you wrap it into http://t.co you're adding 5 extra chars (not counting the diff between the number of chars following bit.ly/ and the number of chars following t.co/ which I assume are equal for the purpose of this question) So if you're adding 5 extra chars do you trim 5 chars from the rest of the tweet to make it fit into the 140 limit? Or how do u do it ?
1 year 51 weeks ago
episod
@episod Taylor Singletary

The new maths are this:

  • The maximum t.co length is available from GET help/configuration -- the field "short_url_length" will indicate the current maximum t.co length -- today this is "20"
  • If a tweet contains bit.ly/abcdef you would count that string as 20 characters. Same as if it were bit.ly/abc or http://bit.ly/abcdef or http://bit.ly/a -- all variations of the URL would equal the same resultant t.co string: 20 characters (at this time).

I'd recommend preventing the submission of a tweet that would be longer than 140 characters on the application level rather than sending it off to Twitter.

Essentially:

  1. characters_remaining = 140 - ( number_of_urls * maximum_tco_length) - remaining_character_count_of_non_urls_including_spaces

Where URLs will soon be defined as both fully qualified URLs as well as these "protocolless" URLs.

1 year 51 weeks ago
idibidiSays
@idibidiSays Mr. idi.bidi

My concern as far as my app goes is addressed by your recommendation.

However, my concern for how the Twitter API may behave in the case I outlined remains valid, i.e.: what if some app sends you a tweet with 140 characters length containing shortened, protocol-less URL. What do you do in that case? Reject the tweet or trim it down to 140 after adding the http:// part ? If you trim then where do you trim from, start or end? So my guess is that you'll reject the tweet or may be ignore the protocol-less URL (i.e. not apply the new scheme) ??

1 year 51 weeks ago
episod
@episod Taylor Singletary

What will happen is very similar to what happens today, in that the tweet will be rejected if, after interpretation, it exceeds 140 characters. In this new case, interpreting the link as 140 characters will happen after a "no-protocol URL" is re-evaluated as a t.co link (20 characters at this time).

1 year 51 weeks ago
idibidiSays
@idibidiSays Mr. idi.bidi

Cool. That's what I thought.

1 year 51 weeks ago
ShanghaiTimes
@ShanghaiTimes ♫ ShanghaiTimes 上海时报

I'm sending tweets to the timeline from my iPhone app. The tweets arrive at twitter.com as t.co links and are displayed on the timeline as hints. That is, instead of showing up as http://t.co/PJ9hzUI it shows up as exactly maps.google.com/maps?q=-27.348...
When I click on that link, it does not work, just presenting a blank screen.
I have to press the Tweet itself, and it shifts right, where I have to hold my finger on the link, and then it displays the full t.co url, and gives me the option of Opening or Copying the link, or Cancelling.
If I press Open, I am presented with a blank screen, withe the up-to-right arrow in the bottom right. If i then press that option , I am presented with the full expanded link on display, and the options to:
Open in Safari
Mail Link
Repost Link
Read Later
Cancel.

So what's happening? really. For all other shortened links, I just click the link in the timeline and it opens.
Can someone tell me what is happening please?
thanks
Robert

1 year 50 weeks ago
rno
@rno Arnaud Meunier

Dear Developers,

We unfortunately won't be able to provide the "URLs without protocol linking" opt-in option prior to date.

These options (per-tweet basis using the wrap_links=true parameter, and per-application basis from your app settings) are going to be kept unchanged: wrapping all links regardless of their size (but URL without protocols won't be converted to links before October 10th).

Note that in the meantime the new version of twitter-text has been published, in 3 different languages:

Be sure to upgrade if you're using one of these official libraries.

If you're not using twitter-text, you can still check the RegExp we're using there. As an example, here is a simplified version of the twitter-text-java one: (?: SUBDOMAIN+ DOMAIN ccTLD) | (?: SUBDOMAIN* DOMAIN gTLD) | (?: DOMAIN ccTLD (?=/) )

For more details on the t.co URL Wrapper, please check that dedicated documentation page: The t.co URL Wrapper

As usual, if you had any question, please let us know through this thread!

1 year 49 weeks ago
CitiesDev
@CitiesDev Cities Development

Is a .NET version of the twitter-text library available anywhere?

29 weeks 4 days ago
sickp
@sickp Adrian B. Danieli

Hi Arnaud,

It appears the new URL regex's no longer accept URLs immediately prefixed by a period:

  1. require 'regex.rb'
  2. Twitter::Regex[:valid_url] =~ 'This URL no longer matches…http://example.com/'
  3.  => nil
  4. require 'extractor.rb'
  5. Twitter::Extractor.extract_urls('test…http://www.twitter.com/')
  6.  => []

This is a pretty common case, and the live site currently extracts these properly. Is this a bug in twitter-text-* or intended behavior going forward?

Cheers,
Adrian ---- -- -

1 year 49 weeks ago
Alltopstartups
@Alltopstartups Thomas Oppong

My twitter button on my blog -Alltopstartups.com has stopped counting for about two weeks now. Links shortened via twitter are not being counted. I have reported this about four times already with no response from Twitter.

1 year 48 weeks ago
theodric
@theodric Þéodriċ Æðelfriþ

This is the most horrible, pointless and annoying new feature Twitter has added EVER. If I want to tweet a URL, I want to tweet THAT URL and not some arbitrarily-shortened nonsense t.co garbage. If I want it shortened, I'll bloody shorten it myself.

I want an opt-out!

1 year 48 weeks ago
NameBio
@NameBio NameBio

We need an opt out as well. We tweet information about domain name sales, on twitter it looks fine but off twitter it appears like this:

"The top reported sale of the day is: http://t.co/pHNrDEct - $1,205 - http://t.co/mQJrJeCW"

This makes it entirely useless for us and beyond breaking the domain name so it isn't an actual domain we're at a loss as to what we can do.

Suggestions? Opt-out? Help?

1 year 26 weeks ago
episod
@episod Taylor Singletary

All the data to render those as originally intended is available in the Tweet response object. When rendering off-Twitter, make use of the data and the problem resolves itself. If you encounter a case where an integration is not rendering the t.co as intended, reach out to the site owner and encourage them to make use of the data available in the API.

1 year 26 weeks ago
_jk
@_jk jk

twitter might die (hopefully not in the nearer future!) at some day. after this day there won't be any chance to click on wrapped hyperlinks included in archived tweets, right?

is there any plan to offer an opt-out of link wrapping or a chance in the near future for users to backup their tweets including their unwrapped hyperlinks (a backup like fb.com/download)?

wrapping urls might be very useful for real-time tracking and phishing prevention but for the long-term public tweets and their hyerplinks should be archivable with unwrapped hyperlinks for the archives of future generations. see also http://joshua.schachter.org/2009/04/on-url-shorteners.html.

1 year 48 weeks ago
episod
@episod Taylor Singletary

As mentioned before, entities are available as part of tweet data responses. Those entities include everything you need to identify the actual URL wrapped by t.co. Wise archivers would include the entire JSON tweet object (for that is a what a tweet "is") in their archives.

It's up to client applications to display URLs in a user-friendly way that is also in tune with the intention of the user. Users who want to use a URL because that's the URL they want to use are honored by clients unwrapping t.co links using tweet entities and displaying to the proper context for the link. User safety is better secured by utilizing t.co for the redirect.

1 year 48 weeks ago
anshumanansu
@anshumanansu anshuman ansu

how can i get the Expanded Url from a shortened Url..is there any api supporting this?

1 year 20 weeks ago
OnTheRunNO
@OnTheRunNO Per Nilsen

....I am...we are...living to day...!
...Sunshine and afterski ...!
...Time willlllllllllllll ....

46 weeks 2 days ago
sirdiccalot
@sirdiccalot sirdiccalot

How do i go behind a picture to see a picture that the real picture

28 weeks 6 days ago