Pass bit.ly shortened url with custom short domain to Tweet buttons on a website


#1

Is it possible to incorporate the shortened url from another service (bit.ly in my case) to the Tweet button on my site, for each specific article?

Recently, my company registered for a custom short domain we use for our shortened URLs and we would like these to be available for people who share our content to Twitter via our site.

What the steps, API tweaks, if any, and server-side code we should be looking for to make this work?

Thanks.


#2

I got one work-around.

  1. Via javascript: get the shortened url via bit.ly in JSON with the API (e.g. with jQuery.getJSON);

  2. Extract the shortened URL string.

  3. Pass the URL to twitter button widget and voilĂ !

Inspired by the article : http://stackoverflow.com/questions/4760538/using-only-javascript-to-shrink-urls-using-the-bit-ly-api


#3

#4