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


Is it possible to incorporate the shortened url from another service ( 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?



I got one work-around.

  1. Via javascript: get the shortened url via 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 :