]> git.donarmstrong.com Git - bin.git/commitdiff
* Fixup urls better in get_sgf
authorDon Armstrong <don@donarmstrong.com>
Sat, 27 Oct 2007 01:24:56 +0000 (01:24 +0000)
committerDon Armstrong <don@donarmstrong.com>
Sat, 27 Oct 2007 01:24:56 +0000 (01:24 +0000)
get_sgf

diff --git a/get_sgf b/get_sgf
index 090ba8dcce4f199d7d0b48571db0e6ca2f8a5fe6..229424c0b3849c1dd838f5ab7690a14820809285 100755 (executable)
--- a/get_sgf
+++ b/get_sgf
@@ -113,6 +113,8 @@ my $base = 'http://gobase.org/online/sgf2misc/?fname=/games/japan/titles/kisei/3
 for my $url (@ARGV) {
      # strip of leading stuff
      $url =~ s/[^=]+=//;
+     $url =~ s{(?:http://)?(?:gobase\.org)?}{};
+     $url = qq(/$url) unless $url =~ m{^/};
      my $fname = $url;
      my $uri = URI->new($base);
      $uri->query_form(mode    => $options{mode},