Thread Website aufruf (11 answers)
Opened by KCobain at 2011-10-03 14:24

Gast KCobain
 2011-10-03 14:24
#152828 #152828
Moinsen,
ich habe folgende funktion:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package Hotfile;
# Perl->Hotfile API

use LWP::UserAgent; 
our $HFA_VERSION = 0.1;                                                     # Perlmodul Version
our $HFA_WHO = "Hotfile-PerlAPI/$HFA_VERSION";                              # UserAgent-Name

sub new() {                                         # Die $->new Funktion
     my $class = shift;
     return bless {}, $class;
}

sub link_status(){
  my $url     = shift;
  my $browser = new LWP::UserAgent;
  $browser    ->agent($HFA_WHO);
  my $resp    = $browser->get("http://api.hotfile.com/?action=checklinks&links=$url&fields=status");
  my $status  = $resp->decoded_content();
    return $status;
}
1;


Als status müsste ich entweder 0, 1 oder 2 zurück bekommen - aber ich kriege garkeinen wert zurück. Wo liegt der fehler?
Last edited: 2011-10-03 14:42:33 +0200 (CEST)

View full thread Website aufruf