chiark / gitweb /
Merge branch 'stable-5.x'
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 31 Oct 2009 20:32:21 +0000 (20:32 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 31 Oct 2009 20:32:21 +0000 (20:32 +0000)
32 files changed:
yarrg/Commods.pm
yarrg/CommodsWeb.pm
yarrg/README
yarrg/TODO
yarrg/commod-results-processor
yarrg/commod-update-receiver
yarrg/db-idempotent-populate
yarrg/dictionary-update-receiver
yarrg/ocean-topology-graph
yarrg/update-master-info
yarrg/web/check_capacitystring
yarrg/web/check_capitalstring
yarrg/web/check_commodstring
yarrg/web/check_distance
yarrg/web/check_islandstring
yarrg/web/check_lossperleague
yarrg/web/check_routestring
yarrg/web/copyrightdate
yarrg/web/devel
yarrg/web/dhandler
yarrg/web/docs
yarrg/web/docshead [new file with mode: 0644]
yarrg/web/intro
yarrg/web/lookup
yarrg/web/navbar [new file with mode: 0644]
yarrg/web/qtextstringcheck
yarrg/web/query_age
yarrg/web/query_routesearch
yarrg/web/source.tar.gz
yarrg/web/style.css
yarrg/web/upload [new file with mode: 0755]
yarrg/yppedia-ocean-scraper

index 0d45c5ea70367945bb997c8cdc409ef4caf3afcc..5161af2e8a05a121ca690d41662ebd9012bb8c63 100644 (file)
@@ -22,6 +22,7 @@
 
 package Commods;
 use IO::File;
+use IO::Pipe;
 use HTTP::Request::Common ();
 use POSIX;
 use LWP::UserAgent;
@@ -45,7 +46,8 @@ BEGIN {
                      &pipethrough_run_gzip &http_useragent &version_core
                      &http_useragent_string_map
                      &cgipostform &yarrgpostform &cgi_get_caller
-                     &set_ctype_utf8 $masterinfoversion);
+                     &set_ctype_utf8 $masterinfoversion
+                     &source_tarball);
     %EXPORT_TAGS = ( );
 
     @EXPORT_OK   = qw();
@@ -268,6 +270,7 @@ sub fetch_with_rsync ($) {
 
 sub parse_info_serverside () {
     parse_info1('source-info.txt','s',0);
+    parse_info1('tree-info.txt','t',1);
 }
 sub parse_info_serverside_ocean ($) {
     my ($oceanname) = @_;
@@ -472,4 +475,38 @@ sub http_useragent ($) {
     return $ua;
 }
 
+sub source_tarball ($$) {
+    my ($sourcebasedir,$spitoutfn) = @_;
+
+    my $pipe= new IO::Pipe or die $!;
+    my $pid= fork();  defined $pid or die $!;
+    if (!$pid) {
+       $ENV{'YPPSC_YARRG_SRCBASE'}= $sourcebasedir;
+       $pipe->writer();
+       exec '/bin/sh','-c','
+               cd -P "$YPPSC_YARRG_SRCBASE"
+               (
+                git-ls-files -z;
+                git-ls-files -z --others --exclude-from=.gitignore;
+                if test -d .git; then find .git -print0; fi
+               ) | (
+                cpio -Hustar -o --quiet -0 -R 1000:1000 || \
+                cpio -Hustar -o --quiet -0
+               ) | gzip
+       ';
+       die $!;
+    }
+    $pipe->reader();
+
+    my ($d, $l);
+    while ($l= read $pipe, $d, 65536) {
+       $spitoutfn->($d);
+    }
+    waitpid $pid,0;
+    defined $l or die "read pipe $!";
+    $pipe->error and die "pipe error $!";
+    close $pipe;
+    # deliberately ignore errors
+}
+
 1;
index ab2a4a30a322e002135422a558eb1ecaff0b4c3e..5e120039838271ed9f5ce8377c397b49974b62a1 100644 (file)
@@ -52,7 +52,7 @@ BEGIN {
                      &to_json_shim &to_json_protecttags
                      &set_ctype_utf8 &webdatadir
                      &expected_error &dbw_lookup_string
-                     &printable &tr_datarow
+                     &printable &tr_datarow &escerrq
                      &prettyprint_age &meta_prettyprint_age);
     %EXPORT_TAGS = ( );
 
@@ -222,6 +222,13 @@ sub tr_datarow ($$) {
     }
 }
 
+sub escerrq ($) {
+    return '"'.CGI::escapeHTML($_[0]).'"';
+    # Prettier qotes as below are not in HTML 3.2:
+#    return '&#8220;'.CGI::escapeHTML($_[0]).'&#8221;';
+#    return '&#8216;'.CGI::escapeHTML($_[0]).'&#8217;';
+}
+
 package CommodsWeb::ExpectedError;
 
 sub emsg ($) {
index 10555f47aa039121c0881af27ee8f5c01906692a..526d466aaf541525b79339e3c39d5cb05102ac6d 100644 (file)
@@ -167,14 +167,15 @@ Master).
 
 
 This yarrg screenscraper and upload client was written entirely from
-scratch by me, Ian Jackson, with assistance from Stephen Early and
-Clare Boothby.  It is part of ypp-sc-tools, a set of third-party tools
-for assisting players of Yohoho Puzzle Pirates.
+scratch by me, Ian Jackson, with assistance from Clare Boothby,
+Stephen Early, and Naath.  It is part of ypp-sc-tools, a set of
+third-party tools for assisting players of Yohoho Puzzle Pirates.
 
 ypp-sc-tools and YARRG are
 Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
 Copyright (C) 2009 Clare Boothby
 Copyright (C) 2009 Steve Early
+Copyright (C) 2009 Naath Cousins
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of
index be9fda0917a56e018fed9c1bb987440c7b14aa35..1648c6d664c757d85cfb830f8a47a2a4ee665e06 100644 (file)
@@ -1,6 +1,3 @@
-unticking trades doesn't work?!
-
-
 UPLOADER
 --------
 
index 9525330652b02051e35921a7feae25789faafce7..8ede37166a7c1215731769ccab8993437259634d 100755 (executable)
@@ -51,6 +51,7 @@ sub bs_read ($$) {
     return if @v <= $c;
     my ($price,$qty) = @v[$c..$c+1];
     return if !length($price) && !length($qty);
+    die "$price ?" unless $price =~ m/^\d/;
     die "$_ ?" unless length($price) && length($qty);
     $commod{$commod}{$bs}{$stall}= {
        Stall => $stall,
@@ -63,6 +64,10 @@ while (<>) {
     chomp;
     @v= split /\t/;
 #print STDERR "[".join("|",@v)."]\n";
+    foreach (@v[2..$#v]) {
+       s/\,//g;
+       die "$_ ?" if m/.\D/;
+    }
     ($commod,$stall) = @v;
     push @commods_inorder, $commod unless exists $commod{$commod};
     bs_read(Buy,  2);
@@ -205,8 +210,8 @@ sub bs_p_tsv ($$) {
     }
 }
 
-sub write_tsv ($) {
-    my ($f) = @_;
+sub write_tsv ($$) {
+    my ($f,$showhold) = @_;
     foreach $commod (sort keys %commod) {
        $current= $commod{$commod};
        my %stalls;
@@ -216,6 +221,9 @@ sub write_tsv ($) {
            printf($f "%s\t%s", $commod, $stall) or die $!;
            bs_p_tsv($f, Buy);
            bs_p_tsv($f, Sell);
+           if ($showhold && $commod{$commod}{Hold}) {
+               printf($f "\t%s", $commod{$commod}{Hold}) or die $!;
+           }
            print($f "\n") or die $!;
        }
     }
@@ -224,7 +232,7 @@ sub write_tsv ($) {
 }
 
 sub main__tsv () {
-    write_tsv(\*STDOUT);
+    write_tsv(\*STDOUT,1);
 }
 
 sub undef_printable { my ($ov)= @_; defined $ov ? $ov : '?'; };
@@ -485,7 +493,7 @@ sub main__uploadyarrg () {
     $o{'timestamp'}= $ENV{'YPPSC_DATA_TIMESTAMP'} or die;
 
     my $tf= pipethrough_prep();
-    write_tsv($tf);
+    write_tsv($tf,0);
     my $oz= pipethrough_run_gzip($tf);
     $o{'data'}=  [ undef, 'deduped.tsv.gz',
                    Content_Type => 'application/octet-stream',
index d01b6de1753c3cbfac8b7751d0266c5af36a0116..e03a91828424c7da947aeb3af599402d59e4e005 100755 (executable)
@@ -3,22 +3,22 @@
 # This script is invoked when the yarrg client uploads to
 # the chiark database.
 
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website.  YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
 #
 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
 #
 # This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
@@ -41,8 +41,6 @@ our $now= time;  defined $now or die $!;
 
 my $re_any= "^(.*)\$";
 
-parse_info_serverside();
-
 sub fail ($) {
     my ($msg) = @_;
     addlog("failing $msg");
@@ -63,6 +61,15 @@ sub must_param ($$) {
 
 my %o;
 
+if (param('get_source')) {
+    # There's another copy of this in dictionary-update-receiver.  Sorry.
+    print header('application/octet-stream') or die $!;
+    source_tarball('..', sub { print $_[0] or die $!; });
+    exit 0;
+}
+
+parse_info_serverside();
+
 my $midtmp= "_mid-pid$$.hold";
 open MIDTMP, ">$midtmp" or die "$midtmp $!";
 stat MIDTMP or die $!;
index c4bd4a761431ef4968520b0080e894925871f73f..0ecde9e51ab82ee1bdffc4c71471fee19109c568 100755 (executable)
@@ -7,22 +7,22 @@
 #  creates or updates OCEAN-Oceanname.db
 #  from source-info.txt
 
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website.  YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
 #
 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
 #
 # This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
index 352b9bbbfd09d77fb1f405be2a53b199d7627615..3baef669ddf6b4eefcc7a7942cb709118a9fc9dc 100755 (executable)
@@ -3,29 +3,28 @@
 # This script is invoked when the yarrg wants to send an update to the
 # dictionary server.  See README.privacy.
 
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website.  YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
 #
 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
 #
 # This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
 # are used without permission.  This program is not endorsed or
 # sponsored by Three Rings.
 
-
 # upload testing runes:
 #
 # YPPSC_YARRG_DICT_UPDATE=./ YPPSC_YARRG_DICT_SUBMIT=./ ./yarrg --ocean midnight --pirate aristarchus --find-island --same --raw-tsv >raw.tsv  
@@ -43,6 +42,13 @@ use IO::Handle;
 
 use Commods;
 
+if (param('get_source')) {
+    # There's another copy of this in commod-update-receiver.  Sorry.
+    print header('application/octet-stream') or die $!;
+    source_tarball('..', sub { print $_[0] or die $!; });
+    exit 0;
+}
+
 my $aadepth=2;
 
 #---------- pixmaps ----------
index e609e35778188dc147390cd3a451dc315c95da62..2336b43c453a717363049a18e4132cecd14b5293 100755 (executable)
@@ -1,5 +1,27 @@
 #!/usr/bin/perl -w
 
+# This is part of the YARRG website.  YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
+#
+# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+# are used without permission.  This program is not endorsed or
+# sponsored by Three Rings.
+
 use strict (qw(vars));
 
 use CommodsDatabase;
index c668745c5b6e023bbb2ee016c696112548092624..adad34c81f42fbd29dbc2d0f9b24a7a392bda272 100755 (executable)
 #         ./update-master-info -b -d ~ftp/users/ijackson/yarrg/ -a
 #         ./update-master-info -b -d ~ftp/users/ijackson/yarrg/ -O ...
 
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website.  YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
 #
 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
 #
 # This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
index 52eab28264836ca8208e49a82a16db9beb8e3597..b958dff46745e2ee4c4b3b8efdbaffce92c07c8b 100644 (file)
@@ -96,9 +96,9 @@ my $parse_values= sub {
                                     FROM commods WHERE commodname LIKE ?");
                my ($emsg,$commod,@umv)=
                    dbw_lookup_string($spec,$commodsth,1,0,0,
-                               "No commodity or unit matches \`$spec'",
-                               "Ambiguous commodity (or unit) \`$spec'",
-                               undef);
+                       "No commodity or unit matches ".escerrq($spec),
+                       "Ambiguous commodity (or unit) ".escerrq($spec),
+                       undef);
                expected_error($emsg) if defined $emsg;
                $debugf->("VALUE COMMOD FOUND '$commod' @umv");
                foreach my $mvi (0,1) {
@@ -109,7 +109,8 @@ my $parse_values= sub {
                push @canon, $commod;
        } else {
                s/\s+$//;
-               expected_error("Did not understand value \`$_'");
+               expected_error("Did not understand value ".
+                       escerrq($_));
        }
   }
 };
@@ -131,14 +132,15 @@ my $parse_term= sub {
                push @canon, sprintf "%g%%", $pct;
        } elsif (!m/[^a-z]/i) {
                $debugf->("TERM NAME");
-               expected_error("Name (should be unit or commodity) \`$_'".
+               expected_error("Name (should be unit or commodity)".
+                               escerrq($_).
                                " without preceding quantity")
                        unless $first_term;
                my $sth= $dbh->prepare("SELECT name,mass,volume".
                                       "  FROM vessels WHERE name LIKE ?");
                my ($emsg,$ship,@smv)=
                    dbw_lookup_string($_,$sth,1,1,2,
-                               "Ship name `$_' not understood.",
+                               "Ship name ".escerrq($_)." not understood.",
                                "Too many matching ship types.",
                                sub { "Ambiguous - could be $_[1]" });
                expected_error($emsg) if defined $emsg;
index 53aceecd975dcfacd3255f2cbbd51f8d29e04a29..24617d70c32c4d195099a98015bc11a65d1bec0f 100644 (file)
@@ -53,7 +53,7 @@ if (!m/\S/) {
        $capital= $1;
        $canon= "$capital PoE";
 } else {
-       expected_error("Cannot understand capital \`$_'.");
+       expected_error("Cannot understand capital ".escerrq($_).".");
 }
 
 return ($canon,$capital);
index de7cda8cb525848bfcf54498622ba8a40f6e267f..a6aa7267162499296286a6a0639ee6365acdb2a7 100644 (file)
@@ -45,11 +45,11 @@ SELECT commodname,commodid
 </%method>
 
 <%method nomatch>
-  no commodity matches "<% $ARGS{spec} |h %>"
+  no commodity matches <% $ARGS{specq} %>
 </%method>
 
 <%method ambiguous>
-  ambiguous commodity "<% $ARGS{spec} |h %>",
+  ambiguous commodity <% $ARGS{specq} %>,
   could be <% $ARGS{couldbe} |h %>
 </%method>
 
index 223cc5a8f99509ab07ad226abbed2a127e1e7c3c..4d1a4e31831faa91dbbeb0b3630ee3bb8b7585ac 100644 (file)
@@ -59,7 +59,7 @@ if (!m/\S/) {
        $leagues= $1;
        $canon= "$leagues leagues";
 } else {
-       expected_error("Cannot understand distance \`$_'.");
+       expected_error("Cannot understand distance ".escerrq($_).".");
 }
 
 return ($canon,$leagues);
index e8664d5788b54349780d6cf2d2893fc0efd34f52..bb33db100ec2262f393cf424485d8fd637e49fad 100644 (file)
@@ -45,11 +45,11 @@ maxambig => 5
 </%method>
 
 <%method nomatch>
-  no island matches "<% $ARGS{spec} |h %>"
+  no island matches <% $ARGS{specq} %>
 </%method>
 
 <%method ambiguous>
-  ambiguous island "<% $ARGS{spec} |h %>",
+  ambiguous island <% $ARGS{specq} %>,
   could be <% $ARGS{couldbe} |h %>
 </%method>
 
index 937535521dd4209a254a7efa2d9d81464f6b2527..a37382e3a48aec5f61ae86eb2562d7c7647f50e4 100644 (file)
@@ -54,7 +54,7 @@ if (!m/\S/) {
        $pct= 100.0/$1;
        $str= sprintf("1/%d", $1);
 } else {
-       expected_error("Cannot understand loss per league \`$_'.");
+       expected_error("Cannot understand loss per league ".escerrq($_).".");
 }
 
 return ("$str per league", $pct);
index cfa7ec72303e2ea671acb4ef28aa7de9cdedb662..6741eaedec9db07656b66a55e6051992b6219961 100644 (file)
@@ -47,11 +47,11 @@ UNION ALL   SELECT DISTINCT archipelago,NULL,archipelago
 </%method>
 
 <%method nomatch>
-  no island or arch matches "<% $ARGS{spec} |h %>"
+  no island or arch matches <% $ARGS{specq} %>
 </%method>
 
 <%method ambiguous>
-  ambiguous island or arch "<% $ARGS{spec} |h %>",
+  ambiguous island or arch <% $ARGS{specq} %>,
   could be <% $ARGS{couldbe} |h %>
 </%method>
 
index 6af4e759c890a8ddedbef82e2325f8801c595ef4..fe217970819e3667c69fa2fe5ba5b764ecc28145 100644 (file)
@@ -1 +1 @@
-Copyright 2009 Ian Jackson, Clare Boothby, Steve Early
\ No newline at end of file
+Copyright 2009 Ian Jackson, Clare Boothby, Steve Early, Naath Cousins
\ No newline at end of file
index fed459f5b8e1df457e9de2eaf8456944c76b9c3c..e23d0af4e646daa63ce466d1b376269bb14b2c18 100755 (executable)
 
 
 </%doc>
-<html lang="en"><head>
-<title>YARRG (Yet Another Revenue Research Gatherer)</title>
-<link rel="stylesheet" type="text/css" href="style.css">
-</head><body>
-
-<div class="navoptbar">
-<a href="lookup">YARRG</a> -
- Yet Another Revenue Research Gatherer
-|
-<a href="intro">introduction</a>
-|
-<a href="docs">documentation</a>
-|
-<b>development</b>
-</div>
-<div class="docs">
-
+<& docshead &>
 <h1>YARRG development, contribution and troubleshooting</h1>
 
 <h2>Free Software (aka Open Source) licensing</h2>
 
 YARRG is Free Software - you may share and modify it.  See the
 licences for details.  Not only the client but also the website code
-is Free.  The yarrg client, support files, and so forth are under
-the GNU GPL (v3 or later); the website is under the GNU Affero GPL (v3
-or later).
+is Free.  The yarrg client, support files, and so forth are under the
+GNU GPL (v3 or later); the website and database backend is under the
+GNU Affero GPL (v3 or later).
 
 <p>
 
@@ -82,21 +66,35 @@ the source for their version, the website code itself lets you download
 an up-to-date of its actually-running source code.  So this link
 gives you the source code for the pages you are now looking at.
 
-<h3>YARRG lookup website instances</h3>
+<h3>YARRG website code instances</h3>
+
+<h4>Lookup website</h4>
  <ul>
- <li><a href="http://yarrg.chiark.net/">Main released site</a>
- <li><a href="http://yarrg.chiark.net/test/data">Released code; testing database instance (updated with yarrg --test-servers)</a>
- <li><a href="http://yarrg.chiark.net/test/code">Testing version of the site code</a>
- <li><a href="http://yarrg.chiark.net/test/both">Testing code running against the testing database instance</a>
+ <li><a href="http://yarrg.chiark.net/">Main released site</a>,
+     with <a href="http://yarrg.chiark.net/source.tar.gz">source code</a>
+ <li><a href="http://yarrg.chiark.net/test/data">Released code; testing database instance (updated with yarrg --test-servers)</a> (source code as above)
+ <li><a href="http://yarrg.chiark.net/test/code">Testing version of the site code</a>,
+     with <a href="http://yarrg.chiark.net/test/code/source.tar.gz">source code</a>
+ <li><a href="http://yarrg.chiark.net/test/both">Testing code running against the testing database instance</a> (source code as above)
  </ul>
 
-Each of these allows you to download its own source code so you
-can get both the testing and the main version of the website.
-
 <p>
 
 You can add the form parameter <kbd>?debug=1</kbd> to each of the
-above to get a version of the site with debugging output enabled.
+website URLs above to get a version of the site with debugging output enabled.
+
+<h4>Database and dictionary update receiver</h4>
+
+On the live system there are different trees, potentially with
+different versions, for receiving updates and managing the database,
+to the ones for displaying the website.  The database management trees
+are normally accessed only via the upload client but you may also
+download their source directly:
+
+ <ul>
+ <li><a href="http://upload.yarrg.chiark.net/commod-update-receiver?get_source=1">Main production instance</a>
+ <li><a href="http://upload.yarrg.chiark.net/test/commod-update-receiver?get_source=1">Testing database instance</a>
+ </ul>
 
 <h3>Data</h3>
 
@@ -145,5 +143,6 @@ Email Ian Jackson ijackson (at) chiark.greenend.org.uk.  Or talk to
 any Fleet Officer or above of the crew Special Circumstances on the
 Midnight Ocean.
 
+<p>
 </div>
 <& footer, isdevel => 1 &>
index 2cdb09c823ec81ded6fad8a8672bebd723d534e6..aec56ca39e3c22c3d6d6aecedb5179f6ad55a961 100644 (file)
@@ -1,7 +1,7 @@
 <%perl>
 my $arg= $m->dhandler_arg;
 if ($arg =~ m,^/?$,) {
-       $m->redirect('lookup');
+       $m->redirect('intro');
 } else {
        $r->header_out('Status','404 Not found');
 </%perl>
index 02cbeebdc90ba63569582c2fbd3bd21fa90ae9e2..8c48814f59faddfb74be9b4b1e6cec516b1f756c 100755 (executable)
 
 
 </%doc>
-<html lang="en"><head><title>Website documentation - YARRG</title>
-<link rel="stylesheet" type="text/css" href="style.css">
-</head><body>
-
-<div class="navoptbar">
-<a href="lookup">YARRG</a> -
- Yet Another Revenue Research Gatherer
-|
-<a href="intro">introduction</a>
-|
-<b>documentation</b>
-|
-<a href="devel">development</a>
-</div>
-<div class="docs">
-
+<& docshead &>
 <h1>Looking up data in YARRG</h1>
 
 YARRG (Yet Another Revenue Research Gatherer) is a third-party tool
@@ -66,6 +51,11 @@ Hopefully you will be able to work it without too much help, but this
 documentation page contains information about the database website
 which you may not be able to divine from the online user interface.
 
+<p>
+
+If this page is all too complicated for you, you may prefer to read
+<a href="intro">the introduction</a> instead.
+
 <h2>Bookmarkable URLs</h2>
 
 Mostly, you can bookmark the specific pages and queries.  Select the
@@ -75,8 +65,8 @@ URL.
 
 <p>
 
-(An exception to this is if you select the `Update' option from the
-`Trades for route' lookup; the list of (de)selected stalls is too long
+(An exception to this is if you select the "Update" option from the
+"Trades for route" lookup; the list of (de)selected stalls is too long
 to fit in a URL.)
 
 <h2>Dynamic confirmation of meaning of text entry boxes</h2>
@@ -84,7 +74,7 @@ to fit in a URL.)
 If you have Javascript enabled, the various text entry boxes will be
 annotated with a brief explanation of the system's interpretation of
 your current entry string.  To get the actual results updated, you
-must still hit `Go' or `Update'.
+must still hit "Go" or "Update".
 
 <h2>Trades for route</h2>
 
@@ -102,7 +92,7 @@ archipelago, you must enter the archipelago name twice.
 <p>
 
 After getting the results, you can untick various trades individually,
-and select `Update' to get a new plan.  The unticked trades will be
+and select "Update" to get a new plan.  The unticked trades will be
 excluded from the voyage plan (if any) and also from the totals.
 
 <h3><a name="capacity">Vessel capacity</a></h3>
diff --git a/yarrg/web/docshead b/yarrg/web/docshead
new file mode 100644 (file)
index 0000000..66e393d
--- /dev/null
@@ -0,0 +1,19 @@
+<%method head>
+<html lang="en"><head>
+<title>YARRG (Yet Another Revenue Research Gatherer)</title>
+</%method>
+
+<%method style>
+<style type="text/css">
+<& style.css &>
+  body { margin: 0; color: #000000; background: #ffffff; }
+</style>
+</%method>
+
+<& SELF:head &>
+<& SELF:style &>
+</head><body>
+<div class="navoptbar">
+<& navbar &>
+</div>
+<div class="docs">
index 8e993a0034254d7586dd13b315d3d68f13c7d1b1..a28bf0d8dcd514bc5ddbdef404cbc657aae38d0a 100755 (executable)
@@ -5,6 +5,7 @@
 
  Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
  Copyright (C) 2009 Clare Boothby
+ Copyright (C) 2009 Naath Cousins
 
   YARRG's client code etc. is covered by the ordinary GNU GPL (v3 or later).
   The YARRG website is covered by the GNU Affero GPL v3 or later, which
 
 
 </%doc>
-<html lang="en"><head>
-<title>YARRG (Yet Another Revenue Research Gatherer)</title>
-<link rel="stylesheet" type="text/css" href="style.css">
-</head><body>
-
+<& docshead:head &>
+<style type="text/css">
+<& style.css &>
+  body { margin: 0; color: #000000; background: #c5c7ae; }
+  div.emph {
+     margin-left: 1em; padding-left: 1em; padding-top: 0.01em;
+     margin-right: 1em; padding-right: 1em; padding-bottom: 0.05em;
+     background: #ffffff;
+  }
+</style>
 <div class="navoptbar">
-<a href="lookup">YARRG</a> -
- Yet Another Revenue Research Gatherer
-|
-<b>introduction</b>
-|
-<a href="docs">documentation</a>
-|
-<a href="devel">development</a>
+<& navbar &>
 </div>
 <div class="docs">
-<h1>Introduction to YARRG</h1>
+
+<h1>Guide to YARRG</h1>
 
 YARRG (Yet Another Revenue Research Gatherer) is a third-party tool
 for helping find profitable trades and trade routes in Yohoho Puzzle
@@ -58,72 +58,297 @@ Pirates.  It was inspired by
 
 <p>
 
-The system has two main parts: this website which maintains a
-searchable database of commodity prices, and an upload client, which
-screenscrapes the commodity data from the Puzzle Pirates game client
-and uploads it to the database.
+Information about commodity prices is collected by pirates like you
+and uploaded to the YARRG server, using the special yarrg upload
+client.  You can then query and search on this website for commodity
+prices and good trade routes.
 
-<h2><a href="lookup">Market prices database</a></h2>
 
-The <a href="lookup">lookup page</a> gives access to the uploaded data;
-there is also <a href="docs">documentation</a> to help with using that
-website.
+<p>
 
-<h2>Uploading from Linux</h2>
+<div class="emph">
+<h2>Quick start for experts</h2>
 
-The YARRG upload client uploads both to YARRG and
-<a href="http://pctb.crabdance.com/">PCTB</a>.
+<h3>Straight to the commodity prices database</h3>
+
+If you already know about trading on Puzzle Pirates, understand what
+the YARRG website is for, and just want to get down to playing with
+it right away, simply select your ocean:
 
 <p>
+<div align="center">
+% my @oceans= ocean_list();
+% my $delim= '';
+% foreach my $ocean (@oceans) {
+%      my $uri= URI->new('lookup');
+%      $uri->query_form('ocean', $ocean) if $ocean ne 'Midnight';
+<% $delim %><a href="<% $uri->path_query() |h %>"><% $ocean |h %></a>
+%      $delim=' | ';
+% }
+</div>
+
+<h3>But before you start ...</h3>
 
-The current official version of YARRG for use as an upload
-client can browsed here:
- <a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/">http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/</a>
-See particularly the
-<a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/yarrg/README">YARRG README</a>.
+If you are going to use YARRG seriously you will almost certainly want
+to upload your own data.  See <a href="upload">Uploading to YARRG</a>
+for details.
 
 <p>
-To install the client, install the `git' version control system
-and the other dependencies listed in the `Installation requirements'
-section of the README and then run:
-<pre>
-git-clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git ypp-sc-tools
-cd ypp-sc-tools
-cd yarrg
-make
-</pre>
-this will download the code into the directory <code>ypp-sc-tools</code>,
-and build the software.  (If your Linux is very up to date you may
-find that it complains that it doesn't know the command <kbd>git-core</kbd>.
-In that case, use <kbd>git core</kbd>, with a space, instead.)
+
+You will also probably at some point want to read the
+<a href="docs">Documentation for Experts</a> which covers some
+features of the website which you might not guess just from using it.
+
+</div>
+
+<h2>How to use the YARRG website</h2>
+
+YARRG is designed to help pirates make profitable trades.  It is not
+designed as a trading tutorial and some familiarity with trading in
+YPP is assumed. <a
+href="http://yppedia.puzzlepirates.com/Trading">yppedia.puzzlepirates.com/Trading</a>
+contains some advice on trading basics.
+
+<h3>So how do I use it then?</h3> 
+
+<p> First look at the top of the page.  You need to select your Ocean,
+the sort of Interface you would like and the type of Query you wish to
+ask.
+
+<p> 
+
+<h3>Selecting your Ocean</h3> 
+
+<p> 
+
+Which ocean do you want to trade on?
+Just click on that ocean's name.
+
+<p> 
+
+<h3>Selecting your Interface</h3>
+
+<p> You can choose to enter commodity and island names by typing them
+into a text entry field or by selecting them from a drop down menu.
+The "select from menu" option allows only a restricted number of
+options to be entered into each field.
 
 <p>
 
-When new versions of the upload client are released, you can:
-<pre>
-cd .../ypp-sc-tools
-git-pull
-cd yarrg
-make
-</pre>
-to fetch the new version.  (Again, you may need <kbd>git pull</kbd>
-instead of <kbd>git-pull</kbd>.)
+<h3>Type of Query</h3> 
+
+<p> 
+
+There are currently four types of query available which answer
+slightly different questions.
+
+<p> 
+
+<h4>Trades for route</h4>
+
+<p> 
+
+<b>For pirates who know where they are going.</b>  Trades for route allows
+you to enter a route that you are planning to sail and find out if
+there are any profitable trades you can make along the way.  This is
+for pirates who already have a definite sailing plan for some reason.
+Under "Enter Route" you need to type (or select from menus) the names
+of the islands or Archipelagoes that you plan to visit.  If you wish
+to know about arbitrage opportunities at an island you can enter just
+that island name.  If you enter only one Archipelago then you will get
+arbitrage opportunities in that archipelago; if you enter the same
+archipelago twice you'll get trades within that archipelago.
 
-<h2>Uploading from Windows</h2>
+<p> 
 
-There is not currently an upload client for Windows which feeds data
-into YARRG.  It would probably be straightforward to modify the
-Windows PCTB v5 upload client to upload to YARRG as well.
+<h4>Prices for commodity</h4> 
+
+<p> 
+
+<b>For pirates wanting to sell or buy a specific commodity</b> prices for
+commodity returns the best buy and sell prices for the selected
+commodity at each island where trades are available.  Type (or select
+from a menu) the name of one commodity at a time.  This is useful for
+pirates wishing to purchase or sell a specific commodity and wanting
+the best price.  
+
+<p> 
+
+<h4>Offers at location</h4>
+
+<p>
+
+<b>For pirates wanting more details about commodity prices at specified
+locations.</b> Offers at location returns all the offers to buy and sell
+wood at the selected location(s). Type (or select) a commodity and the
+islands (or achipelagos) you are interested in.  This is useful when
+the best buy or sell offer is for only a small quantity: you can check
+what the others offers are like.
+
+<p>
+
+<h4>Find Profitable route</h4> 
+
+<p>
+
+<b>For pirates just wanting to make some poe moving commodities about.</b> Find
+Profitable Route finds you a profitable trading route: first select
+either "open-ended" (which might take you anywhere) or "circular"
+(which takes you back to where you started) then type (or select) your
+starting point (or points - you may for instance have two ships in
+different locations either of which you could use).
 
 <p>
 
-See our <a href="devel">Developers' information</a> page.
+<h3>Data age</h3>
+
+<p>
+
+Data age tells you how long ago data was uploaded from each island in
+your ocean.  Data changes very quickly and trusting old data to be
+accurate is unlikely to be rewarding.
+
+<p>
+
+<h3>What do the results mean</h3>
+
+<p>
+
+"Prices for commodity" and "Offers at location" give very similar results;
+there will be two tables: the first titled "Offers to BUY" your
+commodity, the second "Offers to SELL" it.  The tables can be sorted
+as you wish by clicking on the arrows in the headings.
+
+<p>
+
+"Trades for route" and "Find profitable route" both return voyage plans.
+"Find profitable route" has an additional step to get at your results -
+when you enter your query you are given a list of 15 good routes for
+total profit and 15 good routes for profit per league which visit
+different islands. Select your preferred route: perhaps you will choose
+to take the best profit or perhaps you need to miss out one island
+because it is blockaded or another because you don't have the charts
+to get to or from it.  If you have asked for a trade for route or
+after selecting the profitable route you prefer you will get a Voyage
+trading plan - this provides you with instructions for what to do (buy
+this, sell that, sail there).
+
+<p>
+
+Sometimes no useful trades are available.  In this case the results
+section says simply "No profitable trading opportunities were found".
+
+<p>
+
+After this there is a table reporting the age of the data used.  And
+then a table of "Relevant trades" which lists just about everything you
+could want to know about each trade the plan suggests you make (yes,
+this table is fairly complicated).  The ticky boxes down the side of
+this table allow you to choose which trades you like the look of -
+untick any that you are not interested in (for instance you may be
+uninterested in trades with a low profit margin).
+
+<p>
+
+<h3>What are the Advanced options</h3>
+
+<p>
+
+These options are very useful, and not very advanced, but not needed
+for searching the data.
+
+<p>
+
+<h4>Capacity</h4>
+
+<p>
+
+You can't trade more than fits in your hold.  If you don't say
+anything YARRG assumes that you have infinite hold space (perhaps you
+will go over the route many times).  You can enter a ship-type, a mass
+or a volume; additionally you can subtract quantities of commodities
+from a ship-type (for instance 'sloop - 10 grog' gives the capacity of
+a sloop that has 10 grog already on board); click the ? by this field
+to get a full description of permitted entries here.
+
+<p>
+
+<h4>Capital</h4>
+
+<p>
+How much poe do you have?  If you don't say anything YARRG assumes you
+have infinite poe to spend, but you probably don't.  Enter the amount
+you are willing to spend on commodities for trading with.
+
+<p>
+
+<h4>Expected losses</h4> 
+
+<p>
+
+How much do you expect to lose to the dastardly brigands?  Enter either
+a % (as eg - 1%) or a fraction (as eg - 1/100) of the goods you
+expect to loose to Brigands.  Brigands take 10% if they defeat you,
+but only you know how often you are defeated.  Note that this doesn't
+include rum-consumed so you will need to account for that
+seperately.
+
+<p>
+
+<h4>Max distance</h4>
+
+<p>
+
+How far are you willing to sail today?  The default is 20 leagues, the
+maximum supported is 35.  Are you willing to sail all the way across
+the ocean for a profit?  Or would you prefer to go only a short way?
+
+<p>
+
+<h3>Other fairly useful information</h3>
+
+<p>
+
+The search information is encoded in the URL - you can bookmark pages
+for searches you want to perform a lot and go straight to them without
+re-entering you data (or you can copy the URL and tell your hearties
+and crew mates if you want to).  There's no need to come back to the
+introductory page each time.
+
+<p>
+
+Javascript magic: when you type things into the text entry fields
+YARRG will try to guess what you meant.  If you pause for a moment then
+beneath the text entry field you'll see what YARRG thinks you meant.
+If it's got it correct you don't have to type any more of that
+commodity/island name: just go on to the next one.
+
+<p>
+
+You'll probably want to upload data to ensure you have fresh data
+available.  Unfortunately YARRG only has a Linux upload client at
+present (a windows one is in the works).  You should <a
+href="upload">read about how to upload</a>: particularly the linked
+README page for information about the client which contain
+easy-to-follow instructions to download, install and run it in the
+form of a few comand line instructions that you can copy and paste.
+
+<p>
+
+It's all free, both free-as-in-beer or free-as-in-speech.  If you're
+interested, read the <a href="devel">Development pages</a> for more
+info about how to contribute or how to run your own website using
+YARRG data (perhaps you don't like our colour choices)
+
+
 
 <h2>Contacting the YARRG developers</h2>
 
 Email Ian Jackson ijackson (at) chiark.greenend.org.uk.  Or talk to
 any Fleet Officer or above of the crew Special Circumstances on the
 Midnight Ocean.
+<p>
 
 </div>
 <& footer &>
index 365ed58129407277626411e60f96b8bc8fe2ba1e..eb9f53d815d9825ff56b265bac60c5b766507e31 100755 (executable)
@@ -129,7 +129,7 @@ $ours
 <html lang="en"><head><title><% ucfirst $ahtml{Query} %> - YARRG</title>
 <style type="text/css">
 <& style.css &>
-  body { color: #000000; background: #c5c7ae; }
+  body { margin: 0; color: #000000; background: #c5c7ae; }
   div.query { background: #d7d8b3; padding: 1em; }
   div.results { padding: 1em; }
   table.data { background: #b5b686; }
@@ -149,14 +149,7 @@ $ours
 
 % if (!printable($m)) {
 <div class="navoptbar">
-<a href="<% $m->current_comp()->name() |u %>">YARRG</a> -
- Yet Another Revenue Research Gatherer
-|
-<a href="intro">introduction</a>
-|
-<a href="docs">documentation</a>
-|
-<a href="devel">development</a>
+<& navbar &>
 <p>
 % }
 <%perl>
diff --git a/yarrg/web/navbar b/yarrg/web/navbar
new file mode 100644 (file)
index 0000000..5ac1000
--- /dev/null
@@ -0,0 +1,22 @@
+<a href="lookup">YARRG</a> -
+ Yet Another Revenue Research Gatherer
+<%perl>
+
+$_= <<END;
+intro  user guide
+upload uploading
+docs   experts' docs
+devel  development
+END
+
+my $name= $m->request_comp()->name();
+
+while (s/^(\w+)\t(.*)$//m) {
+       my ($tname, $thtml) = ($1,$2);
+       if ($tname eq $name) {
+               print "| <b>$thtml</b>\n";
+       } else {
+               print "| <a href=\"$tname\">$thtml</a>\n";
+       }
+}
+</%perl>
index 9dce8287e208d8213418dd6432e49898c998a74a..0a75f8e9b6ae71be9f50117c542733c9ce71e787 100755 (executable)
@@ -65,7 +65,7 @@ my $mydbh;
 $dbh ||= ($mydbh= dbw_connect($ocean));
 
 my $debugf= !$debug ? sub { } : sub {
-    print "@_\n";
+    print escapeHTML("@_")."\n";
 };
 
 $debugf->("QTSC STRING '$string'");
@@ -105,11 +105,12 @@ if ($chk->method_exists('execute')) {
                        $sth, $sqlstmt_nqs,
                        $chk->attr_exists('abbrev_initials'),
                        $chk->attr('maxambig'),
-                       $chk->scall_method("nomatch", spec => $each),
+                       $chk->scall_method("nomatch", specq => escerrq($each)),
                        $chk->scall_method("manyambig"),
                        sub {
                                $chk->scall_method("ambiguous",
-                                       spec => $each, couldbe => $_[1])
+                                       specq => escerrq($each),
+                                       couldbe => $_[1])
                        });
                if (defined $temsg) {
                        $emsg= $temsg;
index fd2044d97b4463457d88776b71dc0000b45590ea..efd709692a855426a1ae3f7ca819a2f009ce8b4f 100644 (file)
@@ -81,7 +81,6 @@ $sth->execute();
 % $da_ages{'id_loaded'}= 0;
 % my $rowix= 0;
 % while ($row= $fetchrow->()) {
-%      print STDERR "$row\n";
 %      my $rowid= "id_$row->{'islandid'}";
 %      my $cellid= "c$rowid";
 %      my $age= $now - $row->{'timestamp'};
index 9c583b8899338489228249fef319dc360e7d3883..357ba94ed39395e86d230801cef31fa53a9ef26d 100644 (file)
@@ -257,7 +257,7 @@ YARRG website still runs quickly.
 <p>
 
 If you submitted several searches and gave up on them (eg by hitting
-`back' or `stop' in your browser), be aware that that doesn't
+"back" or "stop" in your browser), be aware that that doesn't
 generally stop the search process at the server end.  So it's best to
 avoid asking for large searches that you're not sure about.
 
@@ -345,7 +345,7 @@ $someresults->();
 <h2>Notes</h2>
 
 Per league values count each island visited as one
-(additional) league; the `Dist.' column is however the actual distance
+(additional) league; the "Dist." column is however the actual distance
 to be sailed.  All profit figures are somewhat approximate; get a
 complete trading plan for a route for accurate information.
 
index 1d92ad8584255028578f7b1cbb2da41f9376f5f5..0e47a83e38d755720427b9c453db6bed6cf33288 100755 (executable)
 </%doc><%flags>
 inherit => undef
 </%flags><%perl>
-use IO::Pipe;
 use CommodsWeb;
+use Commods;
 
 $r->content_type('application/octet-stream');
 $m->flush_buffer();
 
-$ENV{'YPPSC_YARRG_SRCBASE'}= sourcebasedir();
-my $pipe= new IO::Pipe or die $!;
-my $pid= fork();  defined $pid or die $!;
-if (!$pid) {
-       $pipe->writer();
-       exec '/bin/sh','-c','
-               cd -P "$YPPSC_YARRG_SRCBASE"
-               (
-                git-ls-files -z;
-                git-ls-files -z --others --exclude-from=.gitignore;
-                if test -d .git; then find .git -print0; fi
-               ) | (
-                cpio -Hustar -o --quiet -0 -R 1000:1000 || \
-                cpio -Hustar -o --quiet -0
-               ) | gzip
-       ';
-       die $!;
-}
-$pipe->reader();
-
-my ($d, $l);
-while ($l= read $pipe, $d, 65536) {
-       print $d;
+source_tarball(sourcebasedir(), sub {
+       print $_[0];
        $m->flush_buffer();
-}
-waitpid $pid,0;
-defined $l or die "read pipe $!";
-$pipe->error and die "pipe error $!";
-close $pipe;
-# deliberately ignore errors
+})
 
 </%perl>
index a397e5c1f4fdea7a1f5261bb644382e1b22cf58a..858dcb9f9d3b056ad59ec05e6df14e6cfb84fc21 100755 (executable)
@@ -41,8 +41,10 @@ $r->content_type('text/css')
   if $m->callers(-1) == $m->callers(0);
 </%init>
 
-  body { margin: 0; }
   div.navoptbar { padding: 1em; background: #e0e0ff; }
   address { background: #d7d8b3; padding: 1em; }
-  div.docs { padding: 1em; }
+  div.docs {
+     padding-left: 1em; padding-top: 0.15em;
+     padding-right: 1em; padding-bottom: 0.15em;
+  }
   hr { display: none; }
diff --git a/yarrg/web/upload b/yarrg/web/upload
new file mode 100755 (executable)
index 0000000..59556b2
--- /dev/null
@@ -0,0 +1,75 @@
+<& docshead &>
+<h1>Uploading to YARRG</h1>
+<p>
+
+The YARRG system has two main parts: this website which maintains a
+searchable database of commodity prices, and an upload client, which
+screenscrapes the commodity data from the Puzzle Pirates game client
+and uploads it to the database.
+
+<p>
+
+You will need to upload data yourself if there is no data for your
+ocean or island, or the data that is there is too old.  You should
+also upload when preparing trade run, as market conditions change and
+you want a plan based on recent data.
+
+<h2>Uploading from Linux</h2>
+
+The YARRG upload client uploads both to YARRG and
+<a href="http://pctb.crabdance.com/">PCTB</a>.
+
+<p>
+
+The current official version of YARRG for use as an upload
+client can browsed here:
+ <a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/">http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/</a>
+See particularly the
+<a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/yarrg/README">YARRG README</a>.
+
+<p>
+To install the client, install the "git" version control system
+and the other dependencies listed in the "Installation requirements"
+section of the README and then run:
+<pre>
+git-clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git ypp-sc-tools
+cd ypp-sc-tools
+cd yarrg
+make
+</pre>
+this will download the code into the directory <code>ypp-sc-tools</code>,
+and build the software.  (If your Linux is very up to date you may
+find that it complains that it doesn't know the command <kbd>git-core</kbd>.
+In that case, use <kbd>git core</kbd>, with a space, instead.)
+
+<p>
+
+When new versions of the upload client are released, you can:
+<pre>
+cd .../ypp-sc-tools
+git-pull
+cd yarrg
+make
+</pre>
+to fetch the new version.  (Again, you may need <kbd>git pull</kbd>
+instead of <kbd>git-pull</kbd>.)
+
+<h2>Uploading from Windows</h2>
+
+There is not currently an upload client for Windows which feeds data
+into YARRG.  It would probably be straightforward to modify the
+Windows PCTB v5 upload client to upload to YARRG as well.
+
+<p>
+
+See our <a href="devel">Developers' information</a> page.
+
+<h2>Uploading from Macs</h2>
+
+There is not currently a publicly available upload client for Macs for
+either YARRG or PCTB.
+
+<p>
+
+</div>
+<& footer &>
index 68efa38f6781980c63308a55b55b4334195873d5..d55f7acab83d7d0a03ae21655059e4277e1e9068 100755 (executable)
@@ -2,22 +2,22 @@
 
 # helper program for getting information from yppedia
 
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website.  YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
 #
 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
 #
 # This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and