How to use the is.gd URL shortener with leenk.me

I've written about using bit.ly and su.pr before, but this is how you can use the is.gd URL shortener -- if that's your cup of tea. To use the is.gd URL shortener, simply add this code to your theme's functions.php file:

function custom_leenkme_url_shortener( $api_url, $url ) {  
  
	$isgd_api ="http://is.gd/create.php";  
  
	$isgd_args = array(  
				'url' => $url,
				'format' => 'simple'
			);  
  
	return $isgd_api . '?' .  http_build_query( $isgd_args );  
  
}  
add_filter( 'leenkme_url_shortener', 'custom_leenkme_url_shortener', 10, 2 );  

And that's it. By the way, I'm working on a big update for the leenk.me plugin, so you won't have to use this code anymore. It will be integrated right into the plugin's user interface.

Let me know if you run into any trouble.

This entry was posted in Custom URL Shorteners, plugin. Bookmark the permalink.


2 Responses to How to use the is.gd URL shortener with leenk.me

  1. Joseph says:

    Lew – I wonder if one might use the same coding for goo.gl – I’m assuming Google’s URL shortener does not have an API.

    • Lew Ayotte says:

      goo.gl does have an API, but it only supports JSON calls, not plain text like most of the other URL shorteners. I will be adding goo.gl to the next major release of the plugin though, all the URL shortener stuff will be built into the leenk.me plugin User Interface.

      Lew