| 1 | package Plagger::Mechanize; | ||
| 2 | use strict; | ||
| 3 | use base qw( WWW::Mechanize ); | ||
| 4 | |||
| 5 | sub new { | ||
| 6 | my $class = shift; | ||
| 7 | my $self = $class->SUPER::new(@_); | ||
| 8 | |||
| 9 | my $conf = Plagger->context->conf->{user_agent}; | ||
| 10 | $self->agent( $conf->{agent} || "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" ); | ||
| 11 | $self->timeout( $conf->{timeout} || 15 ); | ||
| 12 | |||
| 13 | $self; | ||
| 14 | } | ||
| 15 | |||
| 16 | 1; |