Skip to content

Instantly share code, notes, and snippets.

@jmilum
Created September 15, 2010 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jmilum/580208 to your computer and use it in GitHub Desktop.
Save jmilum/580208 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
my $agent;
my $from;
my $passwd;
my $to;
my $subject;
my $body;
my %login;
my %message;
my $login_url='http://boardgamegeek.com/login';
my $mail_url='http://boardgamegeek.com/geekmail_controller.php';
die "\nUsage $0 from passwd to \"subject\" \"body\"\n\n" unless ($#ARGV == 4);
$from = shift;
$passwd = shift;
$to = shift;
$subject = shift;
$body = shift;
$agent = LWP::UserAgent->new(cookie_jar => {});
$login{username}=$from;
$login{password}=$passwd;
$login{B1}='Submit';
$message{action}='save';
$message{B1}='Send';
$message{touser}=$to;
$message{subject}=$subject;
$message{body}=$body;
$agent->post($login_url, \%login);
$agent->post($mail_url, \%message);
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment