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

Create usernames - based on FIRST & LAST name

Discussion in 'Black Hat SEO Tools' started by bigleftie, Nov 5, 2010.

  1. bigleftie

    bigleftie Junior Member

    Joined:
    Jun 15, 2010
    Messages:
    135
    Likes Received:
    34
    Occupation:
    Senior Software Engineer
    Location:
    NJ, USA
    I cranked out this little Perl script to create usernames based on the first and last name associated with the account.

    Currently, I use it only for creating bookmark accounts with Bookmarking Demon, but expect it will be helpful for creating other types of accounts in the future.

    Having the username "look like" it wasn't randomly generated should decrease the likelihood of your account being detected as a spam account.

    Save the file below to a file (make_usernames.pl) and run it like

    perl make_usernames.pl FIRST_NAME LAST_NAME NUM_TO_MAKE

    Enjoy.

    Code:
    #!/usr/local/ActivePerl-5.6/bin/perl -w
    
    #
    # make_usernames FIRST LAST NUM_USERNAMES
    # 
    # FIRST : First name
    # LAST  : Last name
    # NUM   : A maximum number of usernames to create
    #
    # Note : NUM usernames will not always be created because
    #        the usernames are guaranteed to be unique.  So, if a 
    #        duplicate username is generated, it is ignored
    #        and not added to the list again.
    #
    
    
    $first = $ARGV[0];
    $last = $ARGV[1];
    $num_names = $ARGV[2];
    
    $max_username_len = 10;
    
    $num=0;
    while($num < $num_names)
    {
        # Flip a coin for first or last name
        $rnd = int(rand(2));
        if ($rnd == 0) {
            $username = $first;
                   $other = $last;
        } else {
            $other = $first;
            $username = $last;
        }
    
        # Append or prepend
        $rnd = int(rand(2));
    
        while (length $username < $max_username_len)
        {
            # Retrieve a random character from the unchosen name
            $k = int(rand(length $other));
        
            if($rnd == 0)
            {
                # Append it to the user name
                $username = $username . substr($other, $k, 1);
            } else {
                # Prepend it to the user name
                $username = substr($other, $k, 1) . $username;
            }
        }
        $users{$username} = $num++;
    }
    
    # Get the keys - they are the usernames
    @unique = keys(%users);
    
    # Pring them in a list of commas
    $with_commas = join(",", @unique);
    print "$with_commas\n";
    exit(0)
    
     
  2. zzuum

    zzuum Newbie

    Joined:
    Nov 5, 2010
    Messages:
    13
    Likes Received:
    1
    nice work dude! respect!
     
  3. bigleftie

    bigleftie Junior Member

    Joined:
    Jun 15, 2010
    Messages:
    135
    Likes Received:
    34
    Occupation:
    Senior Software Engineer
    Location:
    NJ, USA
    Ha :) "respect" - haven't heard that in a while... always loved it.

    It was a little difficult to document exactly what the NUM value was - so I'll write it another way in case it confuses people...

    Using BMD as an example, I have about 80 sites I want to create an account on.

    I wanna try to use as many different usernames as possible - to decrease the likelihood that they get flagged for same username and similar bookmarks.

    The NUM is the maximum number of usernames the script will generate.

    It will actually loop through NUM times, creating a username each time.

    However, it will not include duplicate usernames in the output list.

    So, if it gets lucky and does not generate any duplicates, it will have NUM usernames in the output list. More likely, it will have less than NUM because it will have generated the same name more than once.

    Hope this helps - enjoy!