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

Searching for a Tool

Discussion in 'Black Hat SEO' started by jabbidoo, Dec 25, 2008.

  1. jabbidoo

    jabbidoo Junior Member

    Joined:
    Oct 21, 2008
    Messages:
    173
    Likes Received:
    151
    Hi,
    I've a .txt-file in which many urls are. Now, I just want to have the domains of them. For example:
    In the txt-file:
    Code:
    http://www.abc.de/abc/cba.html
    I want to have:
    Code:
    http://www.abc.de/
    Is there a tool?

    Jan
     
  2. cristianraiber

    cristianraiber Regular Member

    Joined:
    Nov 22, 2008
    Messages:
    293
    Likes Received:
    381
    Occupation:
    Onliner
    Location:
    Internet
    well .. if you know a bit of php you could always do this

    Code:
    <?php
    
    $lines = yourtextfile.txt;
    foreach($lines as $line)
    { 
    $new_url=parse_url($line,PHP_URL_HOST);
    }
    array_unique($new_url);
    
    echo $new_url;
    ?>
    
    I hope this helps, i'm not very skilled at php so please don't flame :)
     
    • Thanks Thanks x 1
    Last edited: Dec 25, 2008
  3. jabbidoo

    jabbidoo Junior Member

    Joined:
    Oct 21, 2008
    Messages:
    173
    Likes Received:
    151
    Hmmm...don't work:( but thanks for your help!

    Code:
    Warning: Invalid argument supplied for foreach() in /home/.../urls.php on line 4
    
    Warning: array_unique() [function.array-unique]: The argument should be an array in /home/.../urls.php on line 8
     
  4. Sara

    Sara Registered Member

    Joined:
    Dec 28, 2007
    Messages:
    98
    Likes Received:
    71
    Location:
    Australia
    You could do this using excel, just open the text file from excel using / as the delimiter.
     
    • Thanks Thanks x 1
  5. jabbidoo

    jabbidoo Junior Member

    Joined:
    Oct 21, 2008
    Messages:
    173
    Likes Received:
    151
    Thanks a bunch for this idea!! Works like a charm!!