#!/usr/bin/perl ########################## ####### # ####### MAGIC POSTER # ####### CREATED BY # ####### the_actor-guy # ####### # ####### # ####### You may do # ####### whatever you # ####### want with this # ####### script as long # ####### as you leave # ####### this harmless # ####### little credit # ####### to me alone # ####### # ########################## ### FEATURES: ### This script creates Magic alt.discuss newsgroup ### postings which change messages with every time ### the post is opened or reloaded. In addition it will ### also send you an E-mail whenever a Magic Post is created ### using this script. Also every time a Magic Post created ### with this script is opened, it will send you an E-mail ### telling you what alt.discuss group the opened Magic ### Post is in, r save that same info to a text log file. ### Password protected. ### NOTE: If you put this on a server that has banner ### ads at the top of the page, they will show up in the ### Magic Posts this script creates. If your server has ### banner ads at the bottom of every page that is okay, ### they should not show up in the posts. ############# EDIT THESE VARIABLES ######################### ### Choose a valid username and password $uname = "username"; $pword = "password"; ### Location of the mail program on your server: $mailprog = "/var/qmail/bin/qmail-inject"; ### The full url of this script: ### NOTE: You should put this script in a directory all ### by itself because it creates lots of text files ### which hold the messages, and you don't want all ### these text files cluttering directories that have ### your other files in it. $fullurl = "http://qqqqqq.vr9.com/Post/Magic-Poster.cgi"; ### Every time this Magic Poster is used it sends a heads up ### E-mail to let the owner of the script know it was used. ### Enter the E-mail address to send that heads up to below ### and you must put a \ in front of the @ as shown: $owneremail = "the_actor-guy\@webtv.net"; ### Set this variable to mail or log (no caps). mail will ### send the $owneremail an E-mail every time a magic ### post created by this script is opened in a newsgroup, ### and also let you know the name of the newsgroup it is in. ### log will instead save all the same info into a text file ### to prevent your mailbox from being flooded. $mailorlog = "log"; ###################### ####### # ####### DO NOT EDIT # ####### BELOW # ####### THIS LINE # ####### # ###################### ###################### <~~~~ I MEAN THIS LINE ###################### <~~~~ JUST KIDDIN IT'S THIS LINE print "Content-type: text/html\n\n"; ############## VALID FORM INPUTS ########################### use CGI qw(param); $m1 = param(m1); $m2 = param(m2); $m3 = param(m3); $m4 = param(m4); $m5 = param(m5); $m6 = param(m6); $m7 = param(m7); $m8 = param(m8); $m9 = param(m9); $m10 = param(m10); $m11 = param(m11); $m12 = param(m12); $m13 = param(m13); $m14 = param(m14); $m15 = param(m15); $action = param(action); $postnumber = param(postnumber); $username = param(username); $password = param(password); ############### MISCELLANEOUS VARS ######################### $header1 = "
";
$footer = " ";
foreach $ev (keys %ENV) {
print MAILPIPE " Next time this particular E-mail with the magic code in the sig box is viewed (This should be when the first person open your post) it will begin cycling through the 15 messages you have chosen, and the dark green background color you see here will blend into the E-mail's background color providing a flawless looking post."; $check = "0"; }
else { $show = "$info[$check]"; ++$check; }
if ($check eq "15") { $check = "0"; }
open (CHECK,">$postnumber.2");
print CHECK "$check";
close (CHECK);
print "
ENV Var Dump: ";
foreach $ev (keys %ENV) {
print MAILPIPE "
$ev is $ENV{$ev}"; }
print MAILPIPE "\n\n";
close (MAILPIPE);
$g = "%%%%";
$firsthalf = "$m1$g$m2$g$m3$g$m4$g$m5$g$m6$g$m7$g$m8$g";
$secondhalf = "$m9$g$m10$g$m11$g$m12$g$m13$g$m14$g$m15";
$firsthalf =~ s/ /_/g;
$secondhalf =~ s/ /_/g;
open (INFO,">$file.1");
print INFO "$firsthalf";
print INFO "$secondhalf";
close (INFO);
open (MESS,">$file.2");
print MESS "not yet posted";
close (MESS); }
################## EMBEDDED POST PAGE ######################
if ($action eq "postopened") {
open (INFO,"$postnumber.1");
$info =
$footer";
$showg = "$ENV{'HTTP_REFERER'}";
if ($showg =~ /mail/) { $showg = "$ENV{'HTTP_REFERER'}"; }
elsif ($showg =~ /alt./) {
@showg1 = split(/=/,$showg);
@showg2 = split(/&/,$showg1[1]);
$showg = "$showg2[0]"; }
else { $showg = "$showg"; }
if ($mailorlog eq "mail") {
open (MAILPIPE,"|$mailprog");
print MAILPIPE "From: $owneremail (Magician)\n";
print MAILPIPE "To: $owneremail (Owner)\n";
print MAILPIPE "Subject: Post $postnumber Viewed\n\n";
print MAILPIPE " $body Post $postnumber just viewed in $showg
$ev is $ENV{$ev}"; }
print MAILPIPE "\n\n";
close (MAILPIPE); }
if ($mailorlog eq "log") {
open (LOG,">>Magic-Poster.html");
print LOG "
";
print LOG "$showg