first commit

This commit is contained in:
2024-12-27 21:34:49 +01:00
commit de590f3747
7 changed files with 348 additions and 0 deletions

9
clientraw.txt Normal file
View File

@@ -0,0 +1,9 @@
12345 0.3 2.6 107 18.8 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.8 18.8 -- -- -- -- 21 30 10 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:30:10 0 0 27 8 0 0 0 0 0 0 0 18.8 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.50.9 1.0 0.7 1.1 1.0 1.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 2.9 13.0 2933.1 27/08/2024 0 0 26.1 10.1 0.0 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 19.7 19.6 19.4 19.3 19.2 19.2 19.1 19.0 18.9 18.8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.8 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.3 1025.5 1022.9
12345 0.2 2.6 114 18.7 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.7 18.7 -- -- -- -- 21 50 10 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:50:10 0 0 27 8 0 0 0 0 0 0 0 18.7 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.31.0 1.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 2.9 12.9 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 19.2 19.2 19.1 19.0 18.9 18.8 18.8 18.8 18.7 18.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.7 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.2 1025.5 1022.9
12345 0.2 2.6 114 18.7 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.7 18.7 -- -- -- -- 21 50 10 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:50:10 0 0 27 8 0 0 0 0 0 0 0 18.7 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.31.0 1.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 2.9 12.9 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 19.2 19.2 19.1 19.0 18.9 18.8 18.8 18.8 18.7 18.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.7 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.2 1025.5 1022.9
12345 0.2 2.6 114 18.7 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.7 18.7 -- -- -- -- 21 50 10 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:50:10 0 0 27 8 0 0 0 0 0 0 0 18.7 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.31.0 1.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 2.9 12.9 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 19.2 19.2 19.1 19.0 18.9 18.8 18.8 18.8 18.7 18.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.7 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.2 1025.5 1022.9
12345 0.2 2.6 114 18.7 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.7 18.7 -- -- -- -- 21 50 10 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:50:10 0 0 27 8 0 0 0 0 0 0 0 18.7 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.31.0 1.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 2.9 12.9 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 19.2 19.2 19.1 19.0 18.9 18.8 18.8 18.8 18.7 18.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.7 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.2 1025.5 1022.9
12345 0.1 1.7 106 18.6 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.6 18.6 -- -- -- -- 21 55 08 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:55:08 0 0 27 8 0 0 0 0 0 0 0 18.6 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.21.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 0.1 2.9 12.8 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 0.1 19.2 19.1 19.0 18.9 18.8 18.8 18.8 18.7 18.7 18.6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.6 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.1 1025.5 1022.9
12345 0.1 1.7 106 18.6 69 1023.6 0.0 16.2 411.4 0 0 24.7 49 -- 9 -- -- 1 0.0 -- -- -- 18.6 18.6 -- -- -- -- 21 55 08 Wetter_in_Greifswald_(Gut_Koitenhagen)-21:55:08 0 0 27 8 0 0 0 0 0 0 0 18.6 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.21.1 1.3 1.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 0.1 2.9 12.8 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 0.1 19.2 19.1 19.0 18.9 18.8 18.8 18.8 18.7 18.7 18.6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.6 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 26.1 20.4 15.1 1025.5 1022.9
12345 0.7 5.2 85 18.6 69 1023.7 0.0 16.2 411.4 0 0 24.6 49 -- 9 -- -- 1 0.0 -- -- -- 18.6 18.6 -- -- -- -- 22 5 25 Wetter_in_Greifswald_(Gut_Koitenhagen)-22:06:25 0 0 27 8 0 0 0 0 0 0 0 18.6 0 26.3 10.1 0 Teilweise_wolkig_mit_wenig_Temperaturaenderung._ +0.21.0 1.1 1.5 1.2 0.7 0.8 0.2 0.1 0.3 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 0.1 0.0 0.7 2.9 12.8 2929.8 27/08/2024 0 0 26.1 10.1 0.0 0.0 0.0 0.3 0.5 0.4 0.4 0.2 0.1 0.0 0.7 19.0 18.9 18.8 18.8 18.8 18.7 18.7 18.6 18.6 18.6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 18.6 2.9 0 0 0 360 0 0 -- -- -- -- -- -- -- 0 25.5 20.4 15.1 1025.5 1022.9
12345 2.8 7.0 229 32.9 49 1015.7 0.0 16.2 411.4 0 0 27.1 54 -- 44 -- -- 1 0.0 -- -- -- 32.9 32.9 -- -- -- -- 13 50 10 Wetter_in_Greifswald_(Gut_Koitenhagen)-13:50:10 0 100 29 8 0 0 0 0 0 0 0 32.9 0 33.3 19.2 0 Zunehmende_Bewoelkung_mit_wenig_Temperaturaenderung._Niederschlaege_moeglich_innerhalb_der_naechsten_24_bis_48_Stunden._ -0.32.3 3.1 2.2 2.9 3.3 1.1 1.9 2.8 2.1 1.9 2.3 2.4 2.2 2.7 2.5 2.5 1.7 2.3 2.5 2.8 4.1 20.8 6138.5 29/08/2024 0 0 33.2 19.2 3.4 2.3 2.4 2.2 2.7 2.5 2.5 1.7 2.3 2.5 2.8 32.8 32.8 32.9 32.8 32.8 32.9 33.2 32.9 32.8 32.9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 35.8 4.1 0 0 0 112 0 0 -- -- -- -- -- -- -- 661 27.1 25.7 24.3 1021.3 1015.6

1
getwetter.html Normal file

File diff suppressed because one or more lines are too long

69
getwetter.pl Normal file
View File

@@ -0,0 +1,69 @@
use Mojo::UserAgent;
use Data::Printer;
use File::Slurp;
use JSON;
my $ua = Mojo::UserAgent->new;
# # my $tx = $ua->get('https://wetter.lauters.heim-server.de/current.html')->result->body;
# # my $netext = $tx =~ s/\R//rg;
my $tx = $ua->get('https://wetter.lauters.heim-server.de/clientraw.txt')->result->body;
append_file('clientraw.txt', "$tx");
# my $red = read_file('clientraw.txt');
my @read = split(' ', $tx);
my $var = read_file('variablen.txt');
my @vari = split(/\n/, $var);
# p @vari;
# p @read;
my $c = 0;
my $json = {};
for my $v ( @read ) {
if ( $vari[$c] =~ /,/ ) {
my ($wert, $einheit, $jsonkey ) = split(',', $vari[$c]);
if ( $jsonkey ) {
$json->{$jsonkey} = $read[$c];
}
print "$wert: $read[$c] $einheit\n";
}
$c ++;
}
# my @tr = $red =~ /<tr>(.*?)<\/tr>/g;
# for my $t ( @tr ) {
# if ( $t =~ /<nobr>Temperatur Au&szlig;en<\/nobr>/ ) {
# my ($aktuell) = $t =~ /<b><font size="1">aktuell<\/font><\/b><br><b><font size="5">(.*?)&deg;C<\/font><\/b/g;
# $json->{temp} = $aktuell =~ s/,/\./r;
# }
# if ( $t =~ /<nobr>Luftfeuchte Au&szlig;en<\/nobr>/ ) {
# my ($aktuell) = $t =~ /<b><font size="1">aktuell<\/font><\/b><br><b><font size="5">(.*?)%<\/font><\/b/g;
# $json->{luftfeuchte} = $aktuell;
# }
# if ( $t =~ /<nobr>Luftdruck<\/nobr>/ ) {
# my ($aktuell) = $t =~ /<b><font size="1">aktuell<\/font><\/b><br><b><font size="5">(.*?)hPa<\/font><\/b/g;
# $json->{luftdruck} = $aktuell =~ s/,/\./r;
# }
# if ( $t =~ /<nobr>Taupunkt<\/nobr>/ ) {
# my ($aktuell) = $t =~ /<b><font size="1">aktuell<\/font><\/b><br><b><font size="5">(.*?)&deg;C<\/font><\/b/g;
# $json->{taupunkt} = $aktuell =~ s/,/\./r;
# }
# if ( $t =~ /<nobr>UV-Index<\/nobr>/ ) {
# my ($aktuell) = $t =~ /<b><font size="1">aktuell<\/font><\/b><br><b><font size="5">(.*?)UV-I<\/font><\/b/g;
# $json->{uvindex} = $aktuell =~ s/,/\./r;
# }
# if ( $t =~ /<nobr>Solarstrahlung<\/nobr>/ ) {
# my ($aktuell) = $t =~ /<b><font size="1">aktuell<\/font><\/b><br><b><font size="5">(.*?)W\/m&sup2;<\/font><\/b/g;
# $json->{solarstrahlung} = $aktuell =~ s/,/\./r;
# }
# }
write_file( 'wetter.json', encode_json($json) );

130
temp.txt Normal file
View File

@@ -0,0 +1,130 @@
12345
2.8
7.0
229
32.9
49
1015.7
0.0
16.2
411.4
0
0
27.1
54
--
44
--
--
1
0.0
--
--
--
32.9
32.9
--
--
--
--
13
50
10
Wetter_in_Greifswald_(Gut_Koitenhagen)-13:50:10
0
100
29
8
0
0
0
0
0
0
0
32.9
0
33.3
19.2
0
Zunehmende_Bewoelkung_mit_wenig_Temperaturaenderung._Niederschlaege_moeglich_innerhalb_der_naechsten_24_bis_48_Stunden._
-0.32.3
3.1
2.2
2.9
3.3
1.1
1.9
2.8
2.1
1.9
2.3
2.4
2.2
2.7
2.5
2.5
1.7
2.3
2.5
2.8
4.1
20.8
6138.5
29/08/2024
0
0
33.2
19.2
3.4
2.3
2.4
2.2
2.7
2.5
2.5
1.7
2.3
2.5
2.8
32.8
32.8
32.9
32.8
32.8
32.9
33.2
32.9
32.8
32.9
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
35.8
4.1
0
0
0
112
0
0
--
--
--
--
--
--
--
661
27.1
25.7
24.3
1021.3
1015.6

130
variablen.txt Normal file
View File

@@ -0,0 +1,130 @@
12345
2.8
7.0
Windrichtung,°
Temperatur Außen,°C,temp
Luftfeuchte Außen,%,luftfeuchte
Luftdruck aktuell,hPa,luftdruck
0.0
Niederschlag aktueller Monat,/m²
Niederschlag aktuelles Jahr,/m²
0
0
27.1
54
--
44
--
--
1
0.0
--
--
--
32.9
32.9
--
--
--
--
13
50
10
Wetter_in_Greifswald_(Gut_Koitenhagen)-13:50:10
0
100
29
8
0
0
0
0
0
0
0
32.9
0
33.3
19.2
0
Zunehmende_Bewoelkung_mit_wenig_Temperaturaenderung._Niederschlaege_moeglich_innerhalb_der_naechsten_24_bis_48_Stunden._
-0.32.3
3.1
2.2
2.9
3.3
1.1
1.9
2.8
2.1
1.9
2.3
2.4
2.2
2.7
2.5
2.5
1.7
2.3
2.5
2.8
4.1
Taupunkt aktuell,°C,taupunkt
6138.5
29/08/2024
0
0
33.2
19.2
3.4
2.3
2.4
2.2
2.7
2.5
2.5
1.7
2.3
2.5
2.8
32.8
32.8
32.9
32.8
32.8
32.9
33.2
32.9
32.8
32.9
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
35.8
4.1
0
0
0
112
0
0
--
--
--
--
--
--
--
661
27.1
25.7
24.3
Luftdruck max,hPa
Luftdruck min,hPa

1
variablen_thomas.txt Normal file
View File

@@ -0,0 +1 @@
%unit_off%%alwaysseppoint_on%12345 %windkts% %windgkts% %nrtval[36]% %nrtval[0]% %nrtval[-1]% %nrtval[33]% %rainday% %rainmonth% %rainyear% 0 0 %nrtval[1]% %nrtval[17]% %ws_comparestr=- -~%nrtval[3]%~0% %forecast_number_vant% %nrtval[3]% %nrtval[19]% 1 %avgvalpast[34~-1~00~0000]% %ws_comparestr=- -~%nrtval[3]%~0% %ws_comparestr=- -~%nrtval[4]%~0% %ws_comparestr=- -~%nrtval[5]%~0% %ws_comparestr=- -~%nrtval[6]%~0% %ws_comparestr=- -~%nrtval[7]%~0% %ws_comparestr=- -~%nrtval[8]%~0% %ws_comparestr=- -~%nrtval[19]%~0% %ws_comparestr=- -~%nrtval[20]%~0% %ws_comparestr=- -~%nrtval[21]%~0% %ws_hour% %ws_minute% %ws_nrt_sec% %ws_modtext[Wetter in Greifswald (Gut Koitenhagen)]%-%ws_nrttime% 0 %sunproz% %ws_day% %ws_month% 0 0 0 0 0 0 0 %nrtval[44]% 0 %maxval[0]% %minval[0]% 0 %ws_modtext[%forecast_vant%]% %ws_baro1h%%ws_arraywind[20]% %windmaxkts% %nrtval[43]% %ws_calc[/]=%cloudline%~0.3048~1% %ws_day2%/%ws_month2%/%ws_year% 0 0 %maxval[44]% %minval[44]% %ws_comparestr=- -~%nrtval[41]%~0% %ws_arraywind[10]% %ws_arraytemp[10]% %ws_arrayrain[10]% %heatindex[2]% %windmaxkts% 0 0 0 %avgval[36]% 0 0 %ws_comparestr=- -~%nrtval[8]%~0% %ws_comparestr=- -~%nrtval[9]%~0% %ws_comparestr=- -~%nrtval[20]%~0% %ws_comparestr=- -~%nrtval[21]%~0% %ws_comparestr=- -~%nrtval[22]%~0% %ws_comparestr=- -~%nrtval[23]%~0% %ws_comparestr=- -~%nrtval[24]%~0% %ws_comparestr=- -~%nrtval[42]%~0% %maxval[1]% %minval[1]% %wetbulbtemp% %maxval[33]% %minval[33]%

8
wetter.json Normal file
View File

@@ -0,0 +1,8 @@
{
"luftfeuchte": "60",
"solarstrahlung": "754",
"temp": "23.4",
"luftdruck": "1017.2",
"uvindex": "3.8",
"taupunkt": "15.2"
}