[RELEASE] URL Shortener API Script 07-22-2013, 08:47 PM
#1
Today I'm releasing an API script to shorten URLS. You can make keys and distribute them to whomever.
Just edit the "keys" array with the keys you would like other people to use, then call the API like:
Code:
<?php
$keys = array("key1", "key2", "key3");
error_reporting(0);
if ( !isset($_GET['url'], $_GET['key'])){
echo "Please provide all required variables!";
exit();
}
// Check to see if provided key is not valid
if ( !in_array($_GET['key'], $keys) ) {
echo "Please provided a valid API key!";
exit();
}
// Shorten URL
$ur = @file_get_contents("http://my-x-api.tk/us/short.php?url=" . $_GET['url']);
echo $ur;
?>Just edit the "keys" array with the keys you would like other people to use, then call the API like:
Code:
http://yoursite.tld/phpfile.php?url=http://urlhere.com&key=APIKEY
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)





![[Image: xlbdwZT.png]](http://i.imgur.com/xlbdwZT.png)
![[Image: WV5eQ42.jpg]](http://i.imgur.com/WV5eQ42.jpg)
![[Image: tumblr_m73y8go3jd1rb7u8co1_500.gif]](http://24.media.tumblr.com/tumblr_m73y8go3jd1rb7u8co1_500.gif)
![[Image: 76561198073343560.png]](http://steamsignature.com/profile/default/76561198073343560.png)
