#!/usr/bin/perl
use warnings;
use strict;
################################
# By: Ventz Petkov             #
# Date: 11-05-05               #
# Advertising Slogan Generator #
################################
if (@ARGV != 1) {
    print "\t\tUsage: ./adgenerator.pl name\n";
    print "\t\tEx: ./adgenerator.pl ventz\n"; exit();
}


use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
my $name = $ARGV[0];
my $url = "http://www.thesurrealist.co.uk/slogan.cgi?word=$name";

$mech->agent_alias( 'Mac Safari' );
$mech->get( $url );
my $page = $mech->content;
$page =~ s/.*<CENTER><FONT SIZE=7 FACE="impact, verdana">(.*)<\/FONT><\/CENTER>.*/$1/s;
print "$page\n";

