Created
July 25, 2016 11:16
-
-
Save SpEcHiDe/ebdd1bf89ccc2a76daacd8b41c0f9484 to your computer and use it in GitHub Desktop.
BULK bit.ly generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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