in reply to PerlMonksChat module via proxy
choocroot is right on target. Coincidentally, I did download the modules a few days back, and added that patch and few others that prevented them to work correctly with the latest format changes on perlmonks. I did /msg zzamboni about them. If anybody's too impatient to wait for the true official version, these is the diff file I came up with:
*** PerlMonks.pm Fri Jun 07 15:11:41 2002 --- PerlMonks.pm.ORIG Mon Jun 10 16:08:03 2002 *************** *** 61,67 **** my $class=shift; my $self={}; $self->{ua}=new LWP::UserAgent; - $self->{ua}->env_proxy(); #ALF bless $self, $class; return $self; } --- 61,66 ---- *** Chat.pm Fri Jun 07 15:21:52 2002 --- Chat.pm.ORIG Sat Oct 28 00:47:22 2000 *************** *** 58,65 **** # Get general chat messages if ($c=$self->getpage(CHAT_URL)) { $c=~s/[\r\n\t]//g; ! #my @msgs=($c=~/message\s+author="([^\"]+)"[^>]+>\s*(.*?)\s*<\/m +essage>/g); ! my @msgs=($c=~/message(?:\s+user_id=\"\d+\")\s+author="([^\"]+)" +[^>]+>\s*(.*?)\s*<\/message>/gx); #ALF if (@msgs) { while (@msgs) { my ($author, $msg)=(shift(@msgs),shift(@msgs)); --- 58,64 ---- # Get general chat messages if ($c=$self->getpage(CHAT_URL)) { $c=~s/[\r\n\t]//g; ! my @msgs=($c=~/message\s+author="([^\"]+)"[^>]+>\s*(.*?)\s*<\/me +ssage>/g); if (@msgs) { while (@msgs) { my ($author, $msg)=(shift(@msgs),shift(@msgs)); *** Users.pm Mon Jun 10 14:51:24 2002 --- Users.pm.ORIG Mon Sep 04 22:44:10 2000 *************** *** 63,74 **** my $self=shift; if ( (time() - $self->{cache_users_ts}) > USERS_REFRESH) { if (my $c=$self->getpage(USERS_URL)) { ! #my %users=($c=~/user\s+username="([^\"]+)"\s+user_id="(\d+)"/ +g); ! my %users; ! my @uids=($c=~/user\s+.*user_id="(\d+)"/g); ! my @unames=($c=~/user\s+.*username="([^\"]+)"/g); ! my $count=0; ! %users=map {($_,$uids[$count++])} @unames; $self->{cache_users}=\%users; $self->{cache_users_ts}=time(); } --- 63,69 ---- my $self=shift; if ( (time() - $self->{cache_users_ts}) > USERS_REFRESH) { if (my $c=$self->getpage(USERS_URL)) { ! my %users=($c=~/user\s+username="([^\"]+)"\s+user_id="(\d+)"/g +); $self->{cache_users}=\%users; $self->{cache_users_ts}=time(); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: PerlMonksChat module via proxy
by Courage (Parson) on Jun 12, 2002 at 12:55 UTC | |
by alien_life_form (Pilgrim) on Jun 13, 2002 at 08:23 UTC |