[GET] Bit.ly API Mass Url Generator

kelvin.thechamp

Senior Member
Joined
Apr 4, 2011
Messages
931
Reaction score
356
bit.ly don't allow generation of short url of the same url,
following script bypass their check
simply when you enter url value like http://blackhatworld.com/ its become
http://blackhatworld.com//#8149719
(# +some random number)
after redirect it looks like

http://blackhatworld.com/#8149719#5680541#2008972

so each time bit.ly get new domain link and makes new shorten on the fly

here you go

PHP:
<?php

set_time_limit(0);

define("BiTLY_APi_USER", "willylo");
define("BiTLY_APi_KEY", "R_bfd64fcf72e0d7bcbad3c9f7425fb1cjkg4");

function bit_ly_url($url){
    $format = 'xml';
    $version = '2.0.1';
    $bitly = 'http://api.bit.ly/shorten?version='.$version.'&longUrl='.urlencode($url).'&login='.BiTLY_APi_USER.'&apiKey='.BiTLY_APi_KEY.'&format='.$format;
    $response = file_get_contents($bitly);
    if(strtolower($format) == 'json'){
        $json = @json_decode($response,true);
        return $json['results'][$url]['shortUrl'];
    }else{
        $xml = simplexml_load_string($response);
        return 'http://bit.ly/'.$xml->results->nodeKeyVal->hash;
        }
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bit.ly [APi] Mass Url Generator</title>
<style type="text/css">
html {
    background: #f1f1f1;
}
body {
    background: #fff;
    margin: 22px auto;
    width: 764px;
    padding: 22px;
    text-align: center;
    font-family: Georgia, "Times New Roman", Times, serif;
    color: #464646;
}
h2 {
    font-size: 3em;
    font-weight: normal;
}
</style>
</head>

<body>

<h2>Bit.ly [APi] Mass Url Generator</h2>
<?php
if (isset($_POST['doit'])&&($_POST['doit']==1)){
    $tocreate = $_POST['tocreate'];
    $url = $_POST['url'];
    echo "<textarea cols='30' rows='15'>";
    for ($i=0;$i<$tocreate;$i++){
        $url = $url."#".rand(0,9999999);
        $link = bit_ly_url($url);
        echo $link."\r\n";
        }
    echo "</textarea><br /><br />";
    echo "<a href=''>Create More Links</a>";
    exit;
    }
echo "<form action='' method='post'><input type='hidden' name='doit' value='1' />";
echo "URL: <input type='text' name='url' size='50' value='' /><br /><br />";
echo "Create X Bit.ly: <input type='text' size='1' name='tocreate' value='10' /><br /><br />";
echo "<input type='submit' value='Create Links' />";
echo "</form><br /><br />";
?>
</body>
</html>

usage are simple
edit

define("BiTLY_APi_USER", "willylo"); (change "willylo" => "yourusername")
define("BiTLY_APi_KEY", "R_bfd64fcf72e0d7bcbad3c9f7425fb1c4"); (change "R_bfd64fcf72e0d7bcbad3c9f7425fb1c4" => "yourkey")

Key can be found simply navigate to
Code:
https://bitly.com/a/settings/advanced
after login into bit.ly account and click Show legacy API key

save the file to some name like shorten.php upload into your shot and make mass shortens :)

Now enjoy and make some money

Regards
 
Last edited:
Thanks , you own this code, script ?
 
bit.ly don't allow generation of short url of the same url,
following script bypass their check
simply when you enter url value like http://blackhatworld.com/ its become
http://blackhatworld.com//#8149719
(# +some random number)
after redirect it looks like

http://blackhatworld.com/#8149719#5680541#2008972

so each time bit.ly get new domain link and makes new shorten on the fly

here you go

PHP:
<?php

set_time_limit(0);

define("BiTLY_APi_USER", "willylo");
define("BiTLY_APi_KEY", "R_bfd64fcf72e0d7bcbad3c9f7425fb1cjkg4");

function bit_ly_url($url){
    $format = 'xml';
    $version = '2.0.1';
    $bitly = 'http://api.bit.ly/shorten?version='.$version.'&longUrl='.urlencode($url).'&login='.BiTLY_APi_USER.'&apiKey='.BiTLY_APi_KEY.'&format='.$format;
    $response = file_get_contents($bitly);
    if(strtolower($format) == 'json'){
        $json = @json_decode($response,true);
        return $json['results'][$url]['shortUrl'];
    }else{
        $xml = simplexml_load_string($response);
        return 'http://bit.ly/'.$xml->results->nodeKeyVal->hash;
        }
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bit.ly [APi] Mass Url Generator</title>
<style type="text/css">
html {
    background: #f1f1f1;
}
body {
    background: #fff;
    margin: 22px auto;
    width: 764px;
    padding: 22px;
    text-align: center;
    font-family: Georgia, "Times New Roman", Times, serif;
    color: #464646;
}
h2 {
    font-size: 3em;
    font-weight: normal;
}
</style>
</head>

<body>

<h2>Bit.ly [APi] Mass Url Generator</h2>
<?php
if (isset($_POST['doit'])&&($_POST['doit']==1)){
    $tocreate = $_POST['tocreate'];
    $url = $_POST['url'];
    echo "<textarea cols='30' rows='15'>";
    for ($i=0;$i<$tocreate;$i++){
        $url = $url."#".rand(0,9999999);
        $link = bit_ly_url($url);
        echo $link."\r\n";
        }
    echo "</textarea><br /><br />";
    echo "<a href=''>Create More Links</a>";
    exit;
    }
echo "<form action='' method='post'><input type='hidden' name='doit' value='1' />";
echo "URL: <input type='text' name='url' size='50' value='' /><br /><br />";
echo "Create X Bit.ly: <input type='text' size='1' name='tocreate' value='10' /><br /><br />";
echo "<input type='submit' value='Create Links' />";
echo "</form><br /><br />";
?>
</body>
</html>

usage are simple
edit

define("BiTLY_APi_USER", "willylo"); (change "willylo" => "yourusername")
define("BiTLY_APi_KEY", "R_bfd64fcf72e0d7bcbad3c9f7425fb1c4"); (change "R_bfd64fcf72e0d7bcbad3c9f7425fb1c4" => "yourkey")

Key can be found simply navigate to
Code:
https://bitly.com/a/settings/advanced
after login into bit.ly account and click Show legacy API key

save the file to some name like shorten.php upload into your shot and make mass shortens :)

Now enjoy and make some money

Regards
Excuse me from grave digging, but this script is still working, but the thing is that it doesn't show any stats on those shorten url's, unless i visit them myself, anyone had the same issue?
 
I find out C# program ShortBot to generate shortened links for your URLs that you load:
github -> ShortBot
 
this is awesome. It works after 6 years too. Its a wonderful script for those working with cpa so bumping with a purpose so it can come handy for many.
 
Back
Top