You’re producing a WordPress theme, or plugin, that is related to Twitter and for obvious reasons you want to include url-shortening functionality… How’s it, generally, done?
Just the briefest snippet of PHP, this example for is.gd:-
function shorten_url($url) {
$request = 'http://is.gd/api.php?longurl=' . $url;
return @file_get_contents($request);
}
You might want to do a bit of error-catching on that. We’ve used file_get_contents() on the basis that we write themes and plugins that work on PHP5 – the ‘official’ WordPress way is probably still to use the bundled version of Snoopy. Or there’s always cURL – unless there isn’t on your server…
Any decent url-shortening service will have its own RESTful API location to do this – hunt in their Developer Tools
http://tinyurl.com/api-create.php?url={long_url}
et al… though some require login/password parameters to be passed, and some definitely require urlencoded parameters
But…. your own name
Don’t forget, in the particular case, if you’re customising your own WordPress installation, the possibility of using $_GET urls -these may well be short enough (if your domain name is short enough… obviously….) . Using your own domain name has 2 advantages, 1 significant
1. If third parties quote the link directly on their web pages it’s your site getting the link value.
2. Still works if the url-shortening site happens to die before your blog does…
And even if you have permalinks active, urls will redirect….
http://themocracy.com/?p=188 will redirect you to the pretty permalink version – job done.

