Changeset 14626 in josm for trunk/scripts
- Timestamp:
- 2019-01-01T14:07:43+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/TestHTTPS.pl
r14620 r14626 54 54 for my $line (<FILE>) 55 55 { 56 if($line =~ /^([^ \t].*);/) 56 if($line =~ /^([^ \t].*);(.*)/) 57 57 { 58 $name = $1; 58 my ($n, $url) = ($1, $2); 59 if($url =~ /josm\.openstreetmap\.de/) 60 { 61 $name = "WIKI$type:$n"; 62 } 63 else 64 { 65 $name = "$type:$n"; 66 } 59 67 } 60 68 if($line =~ /http:\/\/(.*?)[\/]/) 61 69 { 62 $urls{$1}{ "$type:$name"}++;70 $urls{$1}{$name}++; 63 71 } 64 72 } 73 close FILE; 65 74 } 66 75 67 print "Options: PLUGIN STYLE RULE PRESET MAP GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP LOCAL\n" if !@ARGV; 76 sub getdump() 77 { 78 open FILE,"<:encoding(utf-8)","josm_dump.txt" or die; 79 local $/; 80 undef $/; 81 my $file = <FILE>; 82 close FILE; 83 eval $file; 84 } 85 86 print "Options: \n PLUGIN STYLE RULE PRESET MAP DUMP\n GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP GETDUMP\n LOCAL\n ALL GETALL\n" if !@ARGV; 68 87 69 88 open OUTFILE,">","josm_https.txt" or die "Could not open output file"; … … 78 97 for my $ARG (@ARGV) 79 98 { 99 if($ARG eq "ALL") {push(@ARGV, "PLUGIN", "STYLE", "RULE", "PRESET", "MAP", "DUMP");} 100 if($ARG eq "GETALL") {push(@ARGV, "GETPLUGIN", "GETSTYLE", "GETRULE", "GETPRESET", "GETMAP", "GETDUMP");} 101 } 102 my %ARGS = map {$_ => 1} @ARGV; # prevent double arguments by passing through a hash 103 for my $ARG (sort keys %ARGS) 104 { 80 105 if($ARG eq "LOCAL") {$local = 1; } 106 if($ARG eq "GETDUMP") { system "scp josm\@josm.openstreetmap.de:auto/httpinfo.dump josm_dump.txt"; getdump();} 107 if($ARG eq "DUMP") { getdump(); } 81 108 if($ARG eq "GETMAP") { system "curl https://josm.openstreetmap.de/maps -o imagery_josm.imagery.xml"; getmaps();} 82 109 if($ARG eq "MAP") { getmaps(); }
Note:
See TracChangeset
for help on using the changeset viewer.