Question about renchat2 [message #89203] |
Fri, 21 May 2004 11:58 |
|
snipesimo
Messages: 764 Registered: February 2003
Karma:
|
Colonel |
|
|
I am yet to attempt to script this, but I will paste the PERL code Blazer uses to retrieve the info. If he doesn't want it posted, he can remove it.
[20:22] [Blazer]: wol rank is a bit more difficult
[20:22] [Blazer]: you have to POST info to their server, and parse the output
[20:22] [Blazer]: not just a get
[20:23] [Blazer]: my $req = HTTP::Request->new(POST => 'http://renchat2.westwood.com/cgi-bin/reneg
[20:23] [Blazer]: ade/individual/carpenter');
[20:23] [Blazer]: @data = split(/\n\n\n\n\n\n/,$content);
[20:23] [Blazer]: $lines = (@data);
[20:23] [Blazer]: #print "Data contains $lines lines.\n";
[20:23] [Blazer]: for $line (@data) {
[20:23] [Blazer]: if ( $line =~ m/(\d+)\s\n(.+)\n\s(\w+)\n(\d+)wins\/(\d+)losses\n([\d\,]+)/ )
[20:23] [Blazer]: {
[20:23] [Blazer]: $name=lc($3);
[20:23] [Blazer]: if ($name eq $user) {
[20:23] [Blazer]: # print "Found $3!\n";
[20:23] [Blazer]: $kernel->post($pci, 'privmsg', ReplyTo($env), "WOL Rank: $1 WOL Titl
[20:23] [Blazer]: e: $2 WOL Name: $3\n");
[20:23] [Blazer]: $kernel->post($pci, 'privmsg', ReplyTo($env), "Wins: $4 Losses: $
[20:23] [Blazer]: 5 Ladder Points: $6\n");
[20:23] [Blazer]: return;
|
|
|