]> git.openstreetmap.org Git - rails.git/blobdiff - script/misc/update-wiki-pages
Change wiki preprocessing script to read redirect pages
[rails.git] / script / misc / update-wiki-pages
old mode 100644 (file)
new mode 100755 (executable)
index ffb1105..e01e9ca
@@ -42,7 +42,10 @@ Getopt::Long::Parser->new(
 # On --help
 help() if $help;
 
-help() unless $ARGV[0];
+my $out_file = $ARGV[0];
+$out_file //= 'config/wiki_pages.yml';
+
+help() unless -f $out_file;
 
 # Get a API interface
 my $mw = MediaWiki::API->new();
@@ -73,7 +76,7 @@ for my $lang ('', map { "${_}:" } qw[ Pt Fi De It HU Cz Fr RU Pl ]) {
 ok(1, "Got a total of $count{$_} ${_}s") for qw[ key value ];
 
 # Dump to .yml file
-open my $out, ">", $ARGV[0] or die "Can't open file '$ARGV[0]' supplied on the command line";
+open my $out, ">", $out_file or die "Can't open file '$out_file' supplied on the command line";
 say $out "# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-wiki-pages";
 say $out "# PROGRAM DO NOT MANUALLY EDIT IT";
 say $out "";
@@ -125,7 +128,7 @@ sub get_embeddedin
             action => 'query',
             list => 'embeddedin',
             eititle => $title,
-            eifilterredir => 'nonredirects',
+            eifilterredir => 'all',
             # Doesn't work for De:* and anything non-en. Odd.
             # einamespace => '0|8',
             eilimit => '200',