Yes, you can. There are a few ways to do it. First, any existing plug-in that hooks into the WordPress ‘wp_get_shortlink’ function should work automatically.
Second, you can attach a function to the WP to Twitter filter ‘wptt_shorten_link’, which accepts 3 required arguments: the full URL, the post title, and the post ID. There’s also a 4th argument, but it’s unlikely you’ll use it; it just toggles between test mode and live.
I’m terribly sorry, I must admit I feel quite out of my depth here.
I have a domain, which currently I use to shorten URLs using dlvr.it – but I don’t know how that’s actually happening. I just followed their directions and it works.
Do you have any demo code or anything I could look at to try to learn from?
I’ll try to place an example of how this might work in my GitHub extensions library. But the demo wouldn’t necessarily help you much; I can show you how to set up a custom URL shortener, but I can’t show you how to set up *your* custom URL shortener.
With the latest version of WP to Twitter, the process for adding a new URL shortener is much easier, and I’ve got an example of it available in my GitHub library:
https://github.com/joedolson/plugin-extensions/blob/master/wp-to-twitter/readability-custom-url-shortener.php