#!/usr/bin/perl
#SubmitD3k.pl (c)2005-6 ビequency Software.
###
#ビequency Software - http://frequencysoftware.com
#Adult ビequency - Adult software - http://adultfrequency.com
#Dream ビequency - Useful software - http://dreamfrequency.com
###
#Download 3k SPW PAD Submitter; Submits PADs to Download 3k software
#promotional website.  Download 3k polls PADs therefore only one
#submittal per PAD is required.
#
#This Perl script is freeware and may be freely redistributed unchanged.
###
#PAD (Portable Application Description) (c)1996-2006 Association of
#Shareware Professionals, Inc
###

$VERSION='1.0.3'; #965231
use HTTP::Request::Common;
use LWP::UserAgent;

$Result='';
$UA=new LWP::UserAgent;
$UA->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.7 (ax)");
$UA->cookie_jar({});
$UA->requests_redirectable(['GET', 'POST']);
$Webpage='';

###
#Input the URIs of your PADs in the following array
###
@PADURIs=qw(
http://adultfrequency.com/AWPPAD.xml
http://adultfrequency.com/PlayboyFMPAD.xml
http://software.dreamfrequency.com/PADs/FactorsPAD.xml
http://software.dreamfrequency.com/PADs/GooglePAD.xml
http://software.dreamfrequency.com/PADs/HextoASCIIPAD.xml
http://software.dreamfrequency.com/PADs/InterestPAD.xml
http://software.dreamfrequency.com/PADs/ICQPAD.xml
http://software.dreamfrequency.com/PADs/IMDbPAD.xml
http://software.dreamfrequency.com/PADs/NotePAD.xml
http://software.dreamfrequency.com/PADs/PMGPAD.xml
http://software.dreamfrequency.com/PADs/PrimePAD.xml
http://software.dreamfrequency.com/PADs/PrimesPAD.xml
http://software.dreamfrequency.com/PADs/UptimePAD.xml
http://software.dreamfrequency.com/PADs/UtilitiesPAD.xml
);

$UA->agent("Dream ビequency D3k PAD Submitter/1.0.0");

print "Frequency Software Download 3k SPW PAD Submitter (SubmitD3k.pl) v$VERSION\n(c)2005-6 Frequency Software\n\nSubmitting PADs to Download 3k at http://download3k.com:\nNote: Download 3k polls PADs therefore only one submittal per PAD is required.\n";
foreach $PADURI (@PADURIs) {
	$Result=$UA->request(
		POST 'http://www.download3k.com/submit.php',
		Content_Type=>'form-data',
		Content=>{'url', $PADURI}
	);
	if ($Result->is_success) {
		$Webpage=$Result->content;
		if ($Webpage=~/Thank you/) { print "PAD submitted: $PADURI.\n"; }
		else {
			print "Error during PAD submission.  See Download 3k website.\n";
		}
	}
	else { print "Error during PAD submission:", $Result->status_line, "\n"; }
}
$_=@PADURIs;
print "$_ PAD URIs processed.\nVisit Frequency Software at http://frequencysoftware.com.\nExitting...\n";
