comparison Ikariam.pm @ 250:a654d43731f0

implement multi-thread Ikariam::Scanner
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 17 Nov 2008 00:26:44 +0800
parents 5f6f845bbb1d
children 83e3ce37779d
comparison
equal deleted inserted replaced
249:c30080146c05 250:a654d43731f0
116 user => $user, 116 user => $user,
117 pass => $pass, 117 pass => $pass,
118 debug => undef, 118 debug => undef,
119 }; 119 };
120 120
121
122 # if debug 121 # if debug
123 LWP::Debug::level('+trace'); 122 LWP::Debug::level('+trace');
124 123
125 $self->{mech}->cookie_jar(HTTP::Cookies->new(file => "/tmp/ikariam-cookies.txt", autosave => 1)); 124 $self->{mech}->cookie_jar(HTTP::Cookies->new(file => "/tmp/ikariam-$server-cookies.txt", autosave => 1, ignore_discard => 1));
126 $self->{mech}->default_headers->push_header('Accept-Encoding', 'deflate'); 125 $self->{mech}->default_headers->push_header('Accept-Encoding', 'deflate');
127 126
128 return bless $self, $class; 127 return bless $self, $class;
128 }
129
130 sub clone
131 {
132 my $self = shift;
133 my $copy = bless { %$self }, ref $self; # copy most fields
134
135 $copy;
129 } 136 }
130 137
131 sub viewAlly 138 sub viewAlly
132 { 139 {
133 my $self = shift; 140 my $self = shift;