@anywhere tweetbox with shortening URL

219 views Asked by At

I use Twitter for my blog's trackbacks. I put the tweetbox from @anywhere application to every of my posts. It has default content, that is the URL of the post. I would like to make it shortened, how can it be done? Using the service of t.co?

2

There are 2 answers

0
pinaldesai On

You can use services of bit.ly. API is very handy and easy to integrate.

refer below documentation and explore more.

http://code.google.com/p/bitly-api/wiki/ApiDocumentation

0
Chamilyan On

Unfortunately, T.co is not available as an API to developers. It's an internal shortner used by Twitter to automatically shorten long links.

Check out this post by Raffi, Twitter developer, to learn more about it.

You won't be able to control how the links get shortened. But all URL's over 20 characters are automatically shortened and you can control what get's shortened by including wrap_links=true on the POST you send to Twitter for new messages.

If you enable entities in the response you'll see the following attributes for your links.

"urls": [
        {
          "url": "http://t.co/0JG5Mcq",
          "display_url": "blog.twitter.com/2011/05/twitte…",
          "expanded_url": "http://blog.twitter.com/2011/05/twitter-for-mac-update.html",
          "indices": [
            84,
            103
          ]
        }
      ],

For further reference :

Twitter's t.co URL wrapper is now on for all URLs 19 characters and greater

Next steps with the t.co link wrapper