Hallo zusammen,
ich habe vor die Statusseite meines Routers in Graphen abzubilden. „Zurecht geschnitten“ wird es mit diesem Teil eines kompletten Scripts:
if ( $response->is_success ) # accept response
{
$html = $response->content(); # get content of response and convert html to processable text
$html =~ s/<[^<>]+>/:/sg; # preprocess: remove tags
$html =~ s/[\x0A]+/:/g; # combine multiple Line Feeds and replave with ":"
$html =~ s/\xC2\xA0/ /g; # preprocess: <c2> or change non-breaking space to 'space'
$html =~ s/ /:/g; # preprocess: non-printable characters
$html =~ s/•//g; # Delete non pritable characters
$html =~s/\s+/ /g; # combine whitespace
$html =~s/(:\x20)+/:/g; # replace multiple ": " sequences
$html =~ s/:+/:/g; # concatenate colons
# $html =~ s/,//g; # JC - REMOVE ALL COMMAS.
# $html =~ s/.//g; # JC - REMOVE ALL DOTS.
$html =~ s/\s:/:/g; # JC - REMOVE ALL SPACES PRECEEDING A COLON.
$html =~ s/:\s/:/g; # JC - REMOVE ALL SPACES AFTER A COLON.
$html =~ s/\s\//\//g; # JC - REMOVE ALL SPACES PRECEEDING A FORWARD SLASH.
$html =~ s/\/\s/\//g; # JC - REMOVE ALL SPACES AFTER A FORWARD SLASH.
@html = split /^/m, $html; # postprocess: remove lines containing only whitespace
$data = join "", @html; # make one long string
@stats = split (/[:\/]/, $data); # split fields up on : (JC - AND ALSO ON /)
}
Einer der Werte lautet jedoch 3.520. Leider wird oben irgendwo gerundet, oder so. Übergeben in den Graph wird eine 4.
Hat jemand eine Idee? Braucht Ihr noch mehr Informationen?