Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

PerlMonksChat module via proxy

by Courage (Parson)
on Jun 11, 2002 at 17:08 UTC ( #173568=monkdiscuss: print w/ replies, xml ) Need Help??

I have a question: does PerlMonks* set of modules allows access via proxy?

I tried to use Tk-based chatterbox, and it seems to hang for me, most probably because it can not get access to this site.

Also, does chatterbox logged/saved somewhere? How can I browse messages that already scrolled away?

Courage, the Cowardly Dog.

Comment on PerlMonksChat module via proxy
Re: PerlMonksChat module via proxy
by choocroot (Friar) on Jun 11, 2002 at 18:01 UTC
    PerlMonks module does not handle proxies, so you need to edit the PerlMonks.pm file, and add a $self->{ua}->env_proxy() call in the new() method, like this :
    sub new { my $class=shift; my $self={}; $self->{ua}=new LWP::UserAgent; $self->{ua}->env_proxy(); bless $self, $class; return $self; }
    Then, define your proxy by setting the environment variable http_proxy before launching the client :
    http_proxy=http://your.proxy.net:8001 export http_proxy
    (LWP::UserAgent)
      Thank you a lot, I have no experience with libwww modules, so, while usually I tend to go inside module and look by myself, in this particular case I'll follow your advice.

      How do you think, isn't it a good idea to /msg your code to author, so that proxies support will be built in?

      Courage, the Cowardly Dog.
      PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.

Re: PerlMonksChat module via proxy
by Courage (Parson) on Jun 11, 2002 at 21:43 UTC
    Okay, I read docs everywhere and accidentially found an answer to the second question (it says those messages are never saved) , so no more need clarifying it for me.

    Best wishes,
    Courage, the Cowardly Dog

      Well, that isn't completly true. PerlMonks doesn't save those messages. But there's nothing stopping somebody else from doing so. Any somebody else does, in the CB last 35.


      We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book

Re: PerlMonksChat module via proxy
by alien_life_form (Pilgrim) on Jun 12, 2002 at 12:39 UTC
    Greetings,

    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(); }

    Cheers,
    alf
    You can't have everything: where would you put it?
      that's good.

      But isn't it the patch in opposite direction?

      Courage, the Cowardly Dog.
      PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.

        Greetings,

        Most likely in the opposite direction. I keep getting it backwards...
        Cheers,
        alf


        You can't have everything: where would you put it?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://173568]
Approved by TStanley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2014-09-02 23:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (34 votes), past polls