Skip to content

Instantly share code, notes, and snippets.

@dchomicz
Created January 16, 2014 19:29
Show Gist options
  • Save dchomicz/8461719 to your computer and use it in GitHub Desktop.
Save dchomicz/8461719 to your computer and use it in GitHub Desktop.
Shorte.st Sample API usage
<?php
$curl_url = "https://api.shorte.st/s/CHANGE_TO_YOUR_TOKEN/facebook.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $curl_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$array = json_decode($result);
$shortest = $array->shortenedUrl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment