Changeset 14626 in josm for trunk/scripts


Ignore:
Timestamp:
2019-01-01T14:07:43+01:00 (6 years ago)
Author:
stoecker
Message:

see #16123 - support complete style/rule/preset scan using josm server cronjob output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/TestHTTPS.pl

    r14620 r14626  
    5454  for my $line (<FILE>)
    5555  {
    56     if($line =~ /^([^ \t].*);/)
     56    if($line =~ /^([^ \t].*);(.*)/)
    5757    {
    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      }
    5967    }
    6068    if($line =~ /http:\/\/(.*?)[\/]/)
    6169    {
    62       $urls{$1}{"$type:$name"}++;
     70      $urls{$1}{$name}++;
    6371    }
    6472  }
     73  close FILE;
    6574}
    6675
    67 print "Options: PLUGIN STYLE RULE PRESET MAP GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP LOCAL\n" if !@ARGV;
     76sub 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
     86print "Options: \n PLUGIN STYLE RULE PRESET MAP DUMP\n GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP GETDUMP\n LOCAL\n ALL GETALL\n" if !@ARGV;
    6887
    6988open OUTFILE,">","josm_https.txt" or die "Could not open output file";
     
    7897for my $ARG (@ARGV)
    7998{
     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}
     102my %ARGS = map {$_ => 1} @ARGV; # prevent double arguments by passing through a hash
     103for my $ARG (sort keys %ARGS)
     104{
    80105  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(); }
    81108  if($ARG eq "GETMAP") { system "curl https://josm.openstreetmap.de/maps -o imagery_josm.imagery.xml"; getmaps();}
    82109  if($ARG eq "MAP") { getmaps(); }
Note: See TracChangeset for help on using the changeset viewer.