chiark / gitweb /
cope with unknown vessels by turning them unto zz vcunk
[ypp-sc-tools.db-live.git] / yarrg / database-info-fetch
index 5e0576095a0b23ac7aa837a1d91ff72132f0c3c2..041e008f4220e0a775c8ce4aeab18f5c7d4535ff 100755 (executable)
@@ -25,7 +25,6 @@
 # sponsored by Three Rings.
 
 use strict (qw(vars));
-use LWP::UserAgent;
 use JSON;
 #use Data::Dumper;
 use IO::File;
@@ -38,7 +37,7 @@ our ($which) = shift @ARGV;
 $which =~ s/\W//g;
 
 our ($pctb) = $ENV{'YPPSC_YARRG_PCTB'};
-our ($ua)= LWP::UserAgent->new;
+our ($ua)= http_useragent("database_info_fetch $which");
 our $jsonresp;
 
 sub jparsetable ($$) {
@@ -167,8 +166,8 @@ sub main__comparesources () {
 sub main__island () {
     my $ocean= get_ocean();
     
-    parse_info_clientside();
-    get_arches_islands_pctb($ocean);
+    parse_info_clientside() if $ENV{'YPPSC_YARRG_YARRG'};
+    get_arches_islands_pctb($ocean) if $pctb;
 
     for_islands($ocean,
                sub {
@@ -193,6 +192,14 @@ sub main__timestamp () {
     exit(0);
 }
 
+sub main__yarrgversion () {
+    printf "%s\n", version_core();
+}
+
+sub main__useragentstringmap ($$) {
+    printf "%s\n", http_useragent_string_map($_[0], $_[1]);
+}
+
 sub main__sunshinewidget () {
     print <<END
 Land {On land} {