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

Can u create this script/software

Discussion in 'General Programming Chat' started by Ayomav, Dec 27, 2011.

  1. Ayomav

    Ayomav Regular Member

    Joined:
    Nov 23, 2011
    Messages:
    250
    Likes Received:
    19
    Hello,

    I have list of links, these links redirect to some other site.I have list of links in column A in csv file, I want the script to generate list of links that it redirects to in column B.

    Anyone knows any script or imacros that can do this or anyone willing to create and share in this thread ? Thanks and rep will be given.

    Thanks
     
  2. zelma143

    zelma143 Power Member

    Joined:
    Jun 25, 2010
    Messages:
    571
    Likes Received:
    37
    Occupation:
    PHP programmer,Bot maker,iMacro script maker
    PHP:
    <?php
    $file 
    file('file of ruls');
    foreach(
    $file as $single)
    {
    $get = array(get_headers($single));
    foreach(
    $get[0] as $done)
    {
        
    preg_match('/Location:(.*)/is',$done,$red_url);
        echo 
    trim($red_url[1]);
    }
    }

    ?>
    enjoy it ;)
     
    • Thanks Thanks x 1
  3. Ayomav

    Ayomav Regular Member

    Joined:
    Nov 23, 2011
    Messages:
    250
    Likes Received:
    19
    Hey, it's showing me this error -

    Warning: file(file of ruls) : failed to open stream: No such file or directory in /home/user/public_html/domain.com/a.php on line 2

    Warning: Invalid argument supplied for foreach() in /home/user/public_html/domain.com/a.php on line 3
     
  4. ~divinci

    ~divinci Registered Member

    Joined:
    Sep 23, 2009
    Messages:
    51
    Likes Received:
    11
    Occupation:
    Infastructure Reverse Engineer
    Location:
    Liverpool UK
    place the csv file in this location

    /home/user/public_html/domain.com/

    or use the fill path in $file = file('file of ruls');