In Twitter, if you post a link in tweet, for example, http://stackoverflow.com/questions/8699459/get-title-content-via-link-in-rails
the URL automatically changes to a shorten one:
And the correspongding Html is:
<span class="invisible">http://</span>
<span class="js-display-url">stackoverflow.com/questions/8699</span>
<span class="invisible">459/get-title-content-via-link-in-rails</span>
(the http://
and long part
is hidden)
So How can I achieve this? I believe it's something with JS? or How should I approach this with Rails?
Many Thanks!!!