#!/usr/bin/perl -w use CGI::Carp 'fatalsToBrowser'; use strict; use warnings; my $adv = "Advertise your script here!"; # Simple text ad for this script my $sendmail = "/usr/lib/sendmail"; my $scriptname = "Meta Tag Generator"; # Name you want to call this script my $scriptlocation = "http://www.where.com/tags.pl"; # Link send to their email addy use CGI qw/:standard/; print header, start_html('Meta Tag Generator'); print start_form(), table( Tr(td( "Email Address: "), td(textfield(-name=>'usermail', -size=>40)) ), Tr(td("Author: "), td(textfield(-name=>'author', -size=>40)) ), Tr(td("Distributor: "), td(textfield(-name=>'distributor', -size=>40)) ), Tr(td("Copyright: "), td(textfield(-name=>'copyright', -size=>40)) ), Tr(td("Abstract: "), td(textfield(-name=>'abstract', -size=>40)) ), Tr(td("Keywords: "), td(textarea(-name=>'keywords', -rows=>5, -columns=>30)) ), Tr(td("Description: "), td(textarea(-name=>'description', -rows=>5, -columns=>30)) ), Tr(td("Robots: "), td(popup_menu(-name=>'robots', -values=>['','index','noindex','follow','nofollow'])) ), Tr(td("Distribution: "), td(popup_menu(-name=>'distribution', -values=>['','local','global'])) ), Tr(td("Language: "), td(popup_menu(-name=>'language', -values=>['','EN','EN-GB','EN-US','ES','ES-ES','FR','IT','JA','KO','DE'])) ), Tr(td("Rating: "), td(popup_menu(-name=>'rating', -values=>['','kids','general','mature','restricted'])) ), Tr(td(), td(checkbox(-name=>'emailme', -checked=>1, -value=>'ON', -label=>'Email my tags!')) ), Tr(td(), td(submit) ), ), end_form(), hr(); my $abstract = param('abstract'); my $usermail = param('usermail'); my $author = param('author'); my $distributor = param('distributor'); my $keywords = param('keywords'); my $description = param('description'); my $distribution = param('distribution'); my $robots = param('robots'); my $rating = param('rating'); my $language = param('language'); my $copyright = param('copyright'); my $emailme = param('emailme'); my $tags =''; if (param('abstract') ne "") { $tags .= qq(<meta name="abstract" content="$abstract">
); } if (param('author') ne "") { $tags .= qq(<meta name="author" content="$author">
); } if (param('distributor') ne "") { $tags .= qq(<meta name="distributor" content="$distributor">
); } if (param('copyright') ne "") { $tags .= qq(<meta name="copyright" content="$copyright">
); } if (param('keywords') ne "") { $tags .= qq(<meta name="keywords" content="$keywords">
); } if (param('description') ne "") { $tags .= qq(<meta name="description" content="$description">
); } $tags .= qq(<meta name="generator" content="$adv">
); if (param('robots') ne "") { $tags .= qq(<meta name="robots" content="$robots">
); } if (param('language') ne "") { $tags .= qq(<meta name="language" content="$language">
); } if (param('distribution') ne "") { $tags .= qq(<meta name="distribution" content="$distribution">
); } if (param('rating') ne "") { $tags .= qq(<meta name="rating" content="$rating">
); } if (param()) { print "Instructions: To install your brand new meta tags copy and paste your code below between the \ and \ tags of your website!

"; print $tags; print hr; print end_html(); ### Sent their tags via email if ($emailme ne "") { $tags =~ s/<//g; $tags =~ s/
/\n/g; open (MAIL, "|$sendmail -t") or die "Cannot access mail"; print MAIL "To: $usermail\n"; print MAIL "From: $adminmail\n"; print MAIL "Subject: Your Meta Tags\n\n"; print MAIL "This is a copy of the meta tags you designed with '$scriptname' recently.\n\n"; print MAIL "To install these please paste these codes inside the HEAD tags of your website.\n\n"; print MAIL "$tags\n\n"; print MAIL "To make new meta tags please come back to $scriptlocation!\n"; close (MAIL); } }