In my WordPress Blog I’m currently using an integrated http://U.nu url-shortener.
For this I’ve got in functions.php
function getunuUrl($url) {
$unuurl = file_get_contents("http://u.nu/unu-api-simple?url=".$url);
return $unuurl;
}
and in my post.php
<?php $uurl = getunuUrl(get_permalink($post->ID));
echo '<a href="'.$uurl.'">Short Url</a>' ?>
I can’t find a way to integrate j.mp the same way. Anyone able to help me out?
Looks like j.mp is a mirror of bit.ly
According to bitly API:
I shoul change function getunuUrl (or add a new one):
Don’t forget to change login & apiKey to your own.