|
|
|
|
|
|
about search post article Documentation Mailing Lists Bug Tracking Development Installation Upgrading Download admin rdf |
Posted by on Tuesday August 08, 07:16AM, 2000from the somebody elses problem dept. I just brought up a quake site- clan No Problem site with the aid of squishdot. Many thanks to the developers it is a great app. I did a little LWP coding to automate a post when a new member joins and thought I'd post it to save someone else a little time if they need a CGI script to talk to their Squishdot site. Basically you just call squish_post with a hash containg the stuff you need to send in the message. You can get this from a CGI object like so:
@updatefields=$CGIQuery->param();
my %realhash;
foreach $updatefields(@updatefields){
$temp = $CGIQuery->param($updatefields);
if (substr($updatefields, 0 , 2) eq 'ZZ'){
}
else {
$realhash{$updatefields} = $temp;
};
};
I use values starting with ZZ as a "hidden" value in some of my CGI scripts. Then take that hash, which now contains your CGI variables and names and pass it to squish_post.
squish_post(%info);
sub squish_post{
my %args = @_;
my $ua = LWP::UserAgent->new;
my $e1 ="addPosting:method";
my $req = POST 'http://your.suishdot.server:8888/your_site_id/addPostingForm/.',
[author=>"The automation bot.",
email=>"$args{EmailAddress}",
title=>"$args{UserName} Joins Clan {NP}!",
subject=>"No Problem",
dept=>"Robotic Problem Solution",
summary=>"Please welcome $args{UserName} to Clan {NP} by sending a reply. (So go ahead and click the Read More...)",
body=>"$args{UserName}
Web page: $args{WebPage}
Email Address:$args{EmailAddress}
ICQ: $args{ICQ}
Notes: $args{Notes}
",
file=>"",
$e1=>" Add "
];
$req->referer("http://your_serv:888/your_site/addPostingForm");
$ua->request($req);
};
Notes:
Happy Hacking and Fragging Killbossa {NP} < | >
|
|
||||
|
||||||