Skip to content

Instantly share code, notes, and snippets.

@spoletto
Created May 15, 2012 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spoletto/2705528 to your computer and use it in GitHub Desktop.
Save spoletto/2705528 to your computer and use it in GitHub Desktop.
<?php
include('bitly.php');
$bitly = new bitly('username', 'apikey');
$expanded = $bitly->expand('http://bit.ly/'.htmlspecialchars($_GET['id']));
if (substr($expanded, 0, 30) == 'http://billr.s3.amazonaws.com/') {
echo '<img src="'.$expanded.'" id="sharedbill" width="640px" />';
} else {
echo '<img src="/images/missing.png" id="sharedbill" width="640px" />';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment