chiark / gitweb /
media-scraper: wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 9 Sep 2020 22:35:58 +0000 (23:35 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 9 Sep 2020 22:35:58 +0000 (23:35 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
library/wikimedia.toml
media-scraper

index 98fa65dd410e11876482d8c165ef3a6b590b530f..af29d13865f8e8c4184107a86ad868fb958af97d 100644 (file)
@@ -12,11 +12,11 @@ category = "chess"
 
 files = """
 blt45  a white bishop
-adt45  a black knight
+#adt45 a black knight
 """
 [chess.scraper]
 
 method = "wikimedia"
 licences = [ "Cc-by-sa-3.0", "GFDL|migration=relicense" ]
-url_prefix = "https://commons.wikimedia.org/wiki/File:Chess "
-url_suffix = ".svg"
+url_prefix = "https://commons.wikimedia.org/wiki/File:Chess_"
+url_suffix = ".svg?action=raw"
index 8967e806ef76494e008e4ef0d4019109cc2b2abe..65a82fdac983b7c5fcf9f7f924889fdc631c893d 100755 (executable)
@@ -1,6 +1,5 @@
 #!/usr/bin/perl -w
 use strict;
-use autodie;
 
 use POSIX;
 use TOML::Parser;
@@ -14,7 +13,7 @@ our $max_rate = 2; # per second
 open DEBUG, ">&STDERR" or die $!;
 
 sub run_curl {
-  my (@curl) = (qw(curl), @_);
+  my (@curl) = (qw(curl -Ssf -L --proto-redir -all), @_);
   our $last_curl;
   $last_curl //= 0.;
   my $now = Time::HiRes::time;