Login Register






[RELEASE] URL Shortener API Script filter_list
Author
Message
[RELEASE] URL Shortener API Script #1
Today I'm releasing an API script to shorten URLS. You can make keys and distribute them to whomever.

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

Reply





Messages In This Thread
[RELEASE] URL Shortener API Script - by Xanii - 07-22-2013, 08:47 PM