1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

bulk bit.ly script

Discussion in 'HTML & JavaScript' started by amberlamps, Oct 6, 2010.

  1. amberlamps

    amberlamps BANNED BANNED

    Joined:
    Jun 24, 2010
    Messages:
    331
    Likes Received:
    142
    im looking for one that will do bulk url shorternings

    perferbly one that will allow text to remain and only convert the "http://" link into a bit.ly

    i cant find no script, no service online and i cant believe it lol. i found one site that offers bulk bit.ly shorterning. you can see here
    http://www.fwdlinks.com/

    i like this cause it works but only thing is im looking for one that will keep the text intact and only convert the url

    example

    some text
    "http://"
    some text
    "http://"

    and turn into just the same just the http:// now is a bit.ly link

    some text
    ":bit.ly"
    some text
    "bit.ly

    hope you undertsand what i mean
     
  2. wacked

    wacked Newbie

    Joined:
    Jul 17, 2010
    Messages:
    19
    Likes Received:
    2
    Make a RegExp that gets all URLs into an array.
    Then create an bit.ly URL for every URL.
    PHP:
    if(isset($_POST['UseBitLy']) && $_POST['UseBitLy'] == 'DoIt')
                    {
                        
    $BitLyData=explode(':',$_POST['BitLyAccount']);
                        
    $bit=curl_init('ht???tp:/??/api?.?bit?.?ly?/v3/shorten?login='.$BitLyData[0].'&apiKey='.$BitLyData[1].'&longUrl='.$LongURL.'&format=txt');
                        
    curl_setopt($bitCURLOPT_RETURNTRANSFER1);
                        
    $ShortURL=curl_exec($bit);
                        
    curl_close($bit);
                    }
    Then do a str_replace()
     
  3. fanthomas

    fanthomas Registered Member

    Joined:
    Jan 25, 2010
    Messages:
    98
    Likes Received:
    31
    you could buy a generic domain name. some random name you think of and just create your own shortener's with Meta Refresh's