#!/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 = "Magician's Poster


Magician's Poster

by the_actor-guy

"; $footer = "

"; $body = "<body bgcolor=#16181E text=#7DB392 link=#BDA73A vlink=#408058>"; ########## CHECK FOR VALID USERNAME AND PASSWORD ########### if ($action ne "postopened") { if ($username ne "$uname") { $action = "passprompt"; } if ($password ne "$pword") { $action = "passprompt"; } } ########## PROMPT USER FOR VALID PASSWORD ################## if ($action eq "passprompt") { print "$header1"; print "Enter a valid username and password. You may choose to guess at them, but I bet you won't be able to.<p><form name=magic method=post>Username:<br><input type=text name=username><p>Password:<br><input type=text name=password><p><input type=hidden name=action value=promptmail><input type=submit value=SUBMIT>"; } ############# ENTER THE MAGIC POSTING INFO ################## if ($action eq "promptmail") { print "$header1"; print "<table width=80%><tr align=center><td><center>The Magician's Poster is a sneaky son of a bitch that you embed in your WebTV or MsnTV sig box. The magical part kicks in when you post to a WebTV or MsnTV alt.discuss newsgroup. Every time the post is opened the message will be different! Yes, you can confuse the hell out of people by starting threads in which no reply will seem to have anything to do with the other replies or your original post. Your Magic Post will consist of 15 different messagess that cycle through from 1 through 15 over and over again with every time the post is opened.<br><br><hr><br><form method=post name=magic> Below, enter 15 different messages to be shown in your posting.<br><font color=blue>(You may use html in these messages, but do not use an<br><<>html<>> or a <<>body<>> tag, they are automatically included.)</font><p> Message 1:<br><br><input type=text name=m1><p> Message 2:<br><br><input type=text name=m2><p> Message 3:<br><br><input type=text name=m3><p> Message 4:<br><br><input type=text name=m4><p> Message 5:<br><br><input type=text name=m5><p> Message 6:<br><br><input type=text name=m6><p> Message 7:<br><br><input type=text name=m7><p> Message 8:<br><br><input type=text name=m8><p> Message 9:<br><br><input type=text name=m9><p> Message 10:<br><br><input type=text name=m10><p> Message 11:<br><br><input type=text name=m11><p> Message 12:<br><br><input type=text name=m12><p> Message 13:<br><br><input type=text name=m13><p> Message 14:<br><br><input type=text name=m14><p> Message 15:<br><br><input type=text name=m15><p> <input type=hidden name=username value=$username><input type=hidden name=password value=$password><input type=hidden name=action value=saveposts><input type=submit value=AbraFreakingCadabra></td></tr></table>"; } ############# SAVE THE MAGIC MESSAGES ###################### if ($action eq "saveposts") { open (CHECK,"Magic-Poster.txt"); $file = <CHECK>; close (CHECK); ++$file; open (CHECK2,">Magic-Poster.txt"); print CHECK2 "$file"; close (CHECK2); print "$header1 <h1>Magic Posts Saved!</h1><p> Read the <a href=#instructions>Instructions</a> below on how to add the magic messages to your newsgroup posting.<p> Message 1:<br><font color=blue>$m1</font><p> Message 2:<br><font color=blue>$m2</font><p> Message 3:<br><font color=blue>$m3</font><p> Message 4:<br><font color=blue>$m4</font><p> Message 5:<br><font color=blue>$m5</font><p> Message 6:<br><font color=blue>$m6</font><p> Message 7:<br><font color=blue>$m7</font><p> Message 8:<br><font color=blue>$m8</font><p> Message 9:<br><font color=blue>$m9</font><p> Message 10:<br><font color=blue>$m10</font><p> Message 11:<br><font color=blue>$m11</font><p> Message 12:<br><font color=blue>$m12</font><p> Message 13:<br><font color=blue>$m13</font><p> Message 14:<br><font color=blue>$m14</font><p> Message 15:<br><font color=blue>$m15</font><p> <a name=instructions> <font color=blue>Instructions Part 1:</font> Place the following code in your sig box, and nothing else. Any other html in your sig box may screw up the script that changes the messages in your email.<p><form><textarea rows=3 cols=100><html><body><embed src=$fullurl?action=postopened&postnumber=$file width=100%></body></html></text"; print "area><p> <font color=blue>Instructions Part 2:</font> Go to the alt.discuss newsgroup of your choice and click 'Post' from the left sidebar. Choose a subject for your posting. Do not type anything in the post itself, you should see a message in your E-mail already telling you your magic post is activated. After you post to the group, go back to your sig box and remove the magic code. Thats it!<p> If you would like you may first E-mail yourself before posting to an alt.discuss newsgroup to see how this looks. Also note you should only post this in alt.discuss groups because it only works for WebTV users, PC users can't see embeds the way WebTV users can."; open (MAILPIPE,"|$mailprog"); print MAILPIPE "From: $owneremail (Magician)\n"; print MAILPIPE "To: $owneremail (Owner)\n"; print MAILPIPE "Subject: Post Guardian\n\n"; print MAILPIPE "<html> $body Post Guardian in the House<p> Message 1:<br><font color=#BDA73A>$m1</font><p> Message 2:<br><font color=#BDA73A>$m2</font><p> Message 3:<br><font color=#BDA73A>$m3</font><p> Message 4:<br><font color=#BDA73A>$m4</font><p> Message 5:<br><font color=#BDA73A>$m5</font><p> Message 6:<br><font color=#BDA73A>$m6</font><p> Message 7:<br><font color=#BDA73A>$m7</font><p> Message 8:<br><font color=#BDA73A>$m8</font><p> Message 9:<br><font color=#BDA73A>$m9</font><p> Message 10:<br><font color=#BDA73A>$m10</font><p> Message 11:<br><font color=#BDA73A>$m11</font><p> Message 12:<br><font color=#BDA73A>$m12</font><p> Message 13:<br><font color=#BDA73A>$m13</font><p> Message 14:<br><font color=#BDA73A>$m14</font><p> Message 15:<br><font color=#BDA73A>$m15</font><p> ENV Var Dump:</font><font size=2><p>"; foreach $ev (keys %ENV) { print MAILPIPE "<br>$ev is <font color=#BDA73A>$ENV{$ev}</FONT>"; } print MAILPIPE "</body></html>\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 = <INFO>; close (INFO); $info =~ s/_/ /g; @info = split(/\%\%\%\%/,$info); open (CHECK,"$postnumber.2"); $check = <CHECK>; close (CHECK); if ($check eq "not yet posted") { $show = "Magic Poster Activated! Type a subject for your post and nothing else then post it.<p>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 "<html><head><meta http-equiv=expires content=0></head> $body $show <br> $footer</body></html>"; $showg = "$ENV{'HTTP_REFERER'}"; if ($showg =~ /mail/) { $showg = "$ENV{'HTTP_REFERER'}"; } elsif ($showg =~ /alt./) { @showg1 = split(/=/,$showg); @showg2 = split(/&/,$showg1[1]); $showg = "<a href=news:$showg2[0]>$showg2[0]</a>"; } else { $showg = "<a href=$showg>$showg</a>"; } 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 "<html> $body Post $postnumber just viewed in $showg<p> ENV Var Dump:</font><font size=2><p>"; foreach $ev (keys %ENV) { print MAILPIPE "<br>$ev is <font color=#BDA73A>$ENV{$ev}</FONT>"; } print MAILPIPE "</body></html>\n\n"; close (MAILPIPE); } if ($mailorlog eq "log") { open (LOG,">>Magic-Poster.html"); print LOG "Post $postnumber
"; print LOG "$showg\n"; close (LOG); } } ########## KILL BOTTOM PAGE BANNERS ######################## print "$footer";