Annoying Website Name Generator in VBA and PHP

I don't know about you, but when I see a website name cashing in on the latest social media trend, I shake my head.

So one day I was really bored and came up with this piece of code. It takes the buzzwords that annoy me the most and outputs a random website name. You may notice there is a WordPress slant on some of these.

VBA Version

Function annoyingWebsiteNameGenerator() As String

Dim annoyingName As String
Dim nameslist() As String
Dim i As Long, j As Long

' list of annoying buzzwords
nameslist = _
 Split("Crunch,Buddy,Press,Tech,WP,Smashing,Buzz,Media,Post,Book,Wiki,Pedia,Social", ",")

' choose two at random but don't duplicate
Randomize Timer
Do Until j = 2
  ' I like a one-based loop, YMMV
  i = Int(((UBound(nameslist) + 1) - (LBound(nameslist) + 1) + 1) * _
    Rnd + (LBound(nameslist) + 1))

  ' if existing name does not match randomly chosen name, 
  ' append it and increment loop counter
  If annoyingName <> nameslist(i - 1) Then
    annoyingName = annoyingName & nameslist(i - 1)
    j = j + 1
  End If
Loop

annoyingWebsiteNameGenerator = annoyingName

End Function

+1 if you can run this only three times and come up with a website name that actually exists.

PHP Version

I also wrote a PHP version of this function which you can try here:

Annoying Website Name Generator

<?php

echo 'Your annoying website name is: ' . annoyingWebsiteNameGenerator();

function annoyingWebsiteNameGenerator() {

  // list of annoying buzzwords
  $names = "Crunch Buddy Press Tech WP Smashing Buzz Media Post Book Wiki Pedia Social";
  $nameslist = explode(" ", $names);

  // choose two at random but don't duplicate
  for($i = 1; $j <= 1; $i++) {
    // choose one at random
    $index = array_rand($nameslist, 1);
    
    // if existing name does not match randomly chosen name, 
    // append it and increment loop counter
    if ($annoyingName != $nameslist[$index]) {
      $annoyingName = $annoyingName . $nameslist[$index];
      $j++;
    }
  }

 return $annoyingName;
}
?>

Simply reload the page to re-run the function.

Any suggestions for improvement or additional buzzwords are welcome.

About JP

I'm just an average guy who writes VBA code for a living. This is my personal blog. Excel and Outlook are my thing, with a sprinkle of Access and Word here and there. Follow this space to learn more about VBA. Keep Reading »


Related Articles:


Share This Article:

Share and bookmark this articledelicious buttonfacebook buttonlinkedin buttonstumbleupon buttontwitter button

comment bubble 5 Comment(s) on Annoying Website Name Generator in VBA and PHP:

  1. Wow… how about running it just once? Try CrunchPedia. It routes to a .org address.

  2. You know, it's not too late to change your site name to JPedia.

  3. Spoke too soon, guess I should have googled it first!

This article is closed to new comments. Why?
learn excel dashboards