Using API to generate short link
I want to use a shortcode that generates a short URL from API of Premium URL Shortener script. I added code from API to my template functions: // Main Function function shorten_url($url){ $siteurl=”http://go.mysite.com”; // FOR Example http://gempixel.com/short $apikey=”8jkyA3e7xs1J”; // You can get it from the user account if($apikey && $siteurl){ $short=@file_get_contents(“$siteurl/api?api=$apikey&url=”.strip_tags(trim($url))); $short=json_decode($short,TRUE); if(!$short[“error”]){ return $short[“short”]; … Read more