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

Filter/delete only root domains?

Discussion in 'Black Hat SEO Tools' started by beolion, Dec 22, 2010.

  1. beolion

    beolion Junior Member

    Joined:
    Aug 10, 2010
    Messages:
    113
    Likes Received:
    9
  2. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    Not near my laptop to test this out at the moment, but write a 2 minute PHP script using parse_url and you are good to go.

    If you haven't sorted it in an hour or so drop me a PM and I will crank one out for you.

    FB
     
  3. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    Infact give something like the below a whirl - should work and only print out the urls:

    Code:
    <?php
    
            $domains = file("domains"); //change this to the name of your list of domains
    
            foreach($domains as $d)
            {
                    if(parse_url(trim($d), PHP_URL_PATH))
                    {
                            print $d;
                    }
            }
    
    ?>
    

    If you run this like:

    Code:
    php scriptname.php > list.txt
    
    it will spit all the non-root domains to list.txt
     
    Last edited: Dec 22, 2010
  4. beolion

    beolion Junior Member

    Joined:
    Aug 10, 2010
    Messages:
    113
    Likes Received:
    9
    All domains and pages are displayed. Not working for me.
     
  5. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    Mmmm, worked fine for me - see attached pics.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      23.4 KB
      Views:
      3
    • 2.png
      2.png
      File size:
      11.8 KB
      Views:
      3
  6. beolion

    beolion Junior Member

    Joined:
    Aug 10, 2010
    Messages:
    113
    Likes Received:
    9
    Probably because I tried the script on localhost, php, without running:

    php scriptname.php > list.txt
    Can you make it to work when I upload it to the server?