Skip to content

Instantly share code, notes, and snippets.

@SpEcHiDe
Created July 25, 2016 11:16
Show Gist options
  • Save SpEcHiDe/ebdd1bf89ccc2a76daacd8b41c0f9484 to your computer and use it in GitHub Desktop.
Save SpEcHiDe/ebdd1bf89ccc2a76daacd8b41c0f9484 to your computer and use it in GitHub Desktop.
BULK bit.ly generator
<?php
if(isset($_REQUEST['d'])){
if($_REQUEST['d'] == 1){
ini_set('display_errors', 1);
error_reporting(-1);
}
}
$longurls = array(
"array",
"of long",
"U.R.L.s",
);
$API_URL = "https://api-ssl.bitly.com/v3/shorten?format=txt&access_token=APIKEY&longUrl=";
foreach ($longurls as $key => $value) {
echo $value;
echo "<br>";
$url = $API_URL . urlencode($value);
$ch = curl_init($url);
$res = curl_exec($ch);
//echo $res;
curl_close($ch);
echo "<hr>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment