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.
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)