User Control Panel
Advertisements

HELP US, HELP YOU!

Leviathan: Origin and Meaning of First Name

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Sun Jul 10, 2005 12:37 am    Post subject: Leviathan: Origin and Meaning of First Name Reply with quote

Command Name: !name
Description: Origin and Meaning of First Name
Usage: !name <first name>

Example:
Quote:
Kirsle: !name Noah
RiveCKS: Origin and Meaning of First Name Noah

What is the ethnic origin?
Biblical
What does it mean?
That quavers or totters (Zelophehad's daughter).
What's the gender (commonly)?
Female

Quote:
Kirsle: !name Kirsle
RiveCKS: Sorry, no matches were found for that name.


The Code:
Code:
#      .   .               <Leviathan>
#     .:...::     Command Name // !name
#    .::   ::.     Description // Origin and meaning of first name.
# ..:;;. ' .;;:..        Usage // !name <first name>
#    .  '''  .     Permissions // Public.
#     :;,:,;:         Listener // All
#     :     :        Copyright // 2005 AiChaos Inc.

sub name {
     my ($self,$client,$msg) = @_;

     # Command created by Cerone Kirsle, (C) 2005. Leave this copyright
     # completely intact if you port this command to a different
     # template. Thanks!

     # See if there's a name to check.
     if (length $msg > 0) {
          $msg = lc($msg);
          $msg =~ s/ //g;

          # Get the name site.
          my $src = LWP::Simple::get "http://www.weddingvendors.com/baby-names/meaning/$msg/";
          $src =~ s/\n//g;

          # No matches?
          if ($src =~ /Sorry\, no matches were found/) {
               return "Sorry, no matches were found for that name.";
          }

          my ($name,$origin,$mean,$gender) = ($msg,'undefined','undefined','undefined');

          # Data patterns.
          my %pattern = (
               name   => '<h1>Origin and Meaning of First Name (.*?)<\/h1>',
               origin => '<h2 class=\"question\">What is the ethnic origin\?<\/h2><p>(.*?)<\/p>',
               mean   => '<h2 class=\"question\">What does it mean\?<\/h2><p>(.*?)<\/p>',
               gender => '<h2 class=\"question\">What\'s the gender \(commonly\)\?<\/h2><p>(.*?)<\/p>',
          );

          # Get the data.
          if ($src =~ /$pattern{name}/) {
               $name = $1;
          }
          if ($src =~ /$pattern{origin}/) {
               $origin = $1;
          }
          if ($src =~ /$pattern{mean}/) {
               $mean = $1;
          }
          if ($src =~ /$pattern{gender}/) {
               $gender = $1;
          }

          # Return it.
          return "Origin and Meaning of First Name $name\n\n"
               . "<b>What is the ethnic origin?</b>\n"
               . "   $origin\n"
               . "<b>What does it mean?</b>\n"
               . "   $mean\n"
               . "<b>What's the gender (commonly)?</b>\n"
               . "   $gender";
     }
     else {
          return "Give me a first name to check, i.e.\n\n"
               . "!name Michael";
     }
}
{
     Category    => 'Fun Stuff',
     Description => 'Origin and meaning of first name.',
     Usage       => '!name <first name>',
     Listener    => 'All',
};

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Sun Jul 10, 2005 12:30 pm    Post subject: Reply with quote

Quote:
What's the gender (commonly)?
Female


You're female Surprised Surprised Surprised!

Nice command, although I'm not too sure about that example, seeing as Noah is mainly male, as far as I know.

_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
purcelly
God Like
God Like


Joined: 10 Jun 2004
Posts: 560
Location: North West, England
Reputation: 35.1Reputation: 35.1Reputation: 35.1Reputation: 35.1

PostPosted: Sun Jul 10, 2005 1:01 pm    Post subject: Reply with quote

nice cer

and yes i agree with darkmonkey
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Sun Jul 10, 2005 1:13 pm    Post subject: Reply with quote

darkmonkey wrote:
Quote:
What's the gender (commonly)?
Female


You're female Surprised Surprised Surprised!

Nice command, although I'm not too sure about that example, seeing as Noah is mainly male, as far as I know.


Quote:
Kirsle: !gender Noah
RiveCKS: It's a girl!

Based on popular usage, it is 2.083 times more likely for Noah to be a girl's name.

The popularity of Noah is: 3.809
(Where 0 = extremely rare and 6 = extremely common)


Apparently in some parts of the world (more parts than others) it's moe commonly a girl's name. Rolling Eyes

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group