chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chart scraper: cope with ocean difficulty annotations
[ypp-sc-tools.db-test.git]
/
yarrg
/
CommodsScrape.pm
diff --git
a/yarrg/CommodsScrape.pm
b/yarrg/CommodsScrape.pm
index 3e6f1c68b339924e1b631562c341bd76e9a649c9..2b1d4a9add9ed0bf0d1cc49d63e55a6996348e97 100644
(file)
--- a/
yarrg/CommodsScrape.pm
+++ b/
yarrg/CommodsScrape.pm
@@
-54,7
+54,7
@@
sub yppedia_chart_parse ($$ $$$$ $) {
s/\<--.*--\>//g;
s/^\s*//; chomp; s/\s+$//; s/\s+/ /g;
s/\<\/?(?:b|em)\>//g;
s/\<--.*--\>//g;
s/^\s*//; chomp; s/\s+$//; s/\s+/ /g;
s/\<\/?(?:b|em)\>//g;
- s/\{\{
chart\ style
\|[^{}]*\}\}//gi;
+ s/\{\{
(?:chart\ style|Chart league difficulty)
\|[^{}]*\}\}//gi;
next unless m/\{\{/; # only interested in chart template stuff
if (($x,$y,$arch) =
next unless m/\{\{/; # only interested in chart template stuff
if (($x,$y,$arch) =
@@
-76,7
+76,7
@@
sub yppedia_chart_parse ($$ $$$$ $) {
$on_island->($n, $island);
} elsif (($solid,$x,$y,$dirn) =
m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
$on_island->($n, $island);
} elsif (($solid,$x,$y,$dirn) =
m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
-
([-\/\\o])
\| .*\}\}$/xi) {
+
\.?([-\/\\o])\.?
\| .*\}\}$/xi) {
next if $dirn eq 'o';
printf $debugfh "%2d,%-2d league %-6s %s\n", $x,$y,
next if $dirn eq 'o';
printf $debugfh "%2d,%-2d league %-6s %s\n", $x,$y,
@@
-86,7
+86,7
@@
sub yppedia_chart_parse ($$ $$$$ $) {
if ($dirn eq '-') { $bx+=2; }
elsif ($dirn eq '\\') { $bx++; $by++; }
elsif ($dirn eq '/') { $x++; $by++; }
if ($dirn eq '-') { $bx+=2; }
elsif ($dirn eq '\\') { $bx++; $by++; }
elsif ($dirn eq '/') { $x++; $by++; }
- else { die; }
+ else { die
"$dirn ?"
; }
my $na= $nn->();
my $nb= $conv_nxy->($bx,$by);
my $na= $nn->();
my $nb= $conv_nxy->($bx,$by);