Thread Wartezeit erhöhen in http.pm? (14 answers)
Opened by gubach at 2013-01-28 14:43

Linuxer
 2013-01-28 17:32
#165244 #165244
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
new() von CPAN:Flickr::Upload ist von CPAN:Flickr::API ererbt.
Darin ist zu sehen, dass Flickr::API->new() ein erweitertes LWP::UserAgent Objekt, welches dann "reblessed" wird.

Flickr::API
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
sub new {
        my $class = shift;
        my $options = shift;
        my $self = new LWP::UserAgent;
        $self->{api_key}        = $options->{key};
        $self->{api_secret}     = $options->{secret};
        $self->{rest_uri}       = $options->{rest_uri} || 'http://api.flickr.com/services/rest/';
        $self->{auth_uri}       = $options->{auth_uri} || 'http://api.flickr.com/services/auth/';

        eval {
                require Compress::Zlib;

                $self->default_header('Accept-Encoding' => 'gzip');
        };

        warn "You must pass an API key to the constructor" unless defined $self->{api_key};

        bless $self, $class;
        return $self;
}
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Wartezeit erhöhen in http.pm?