1 |
9949
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/table.run
|
3 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/sh/web.sh
|
4 |
|
|
|
5 |
|
|
if self_not_included; then
|
6 |
|
|
|
7 |
|
|
*.htm/make()
|
8 |
|
|
{
|
9 |
12779
|
aaronmk
|
begin_target; check_wildcard_target_exists
|
10 |
9949
|
aaronmk
|
local letter_range="${letter_range-[A-Z]}"
|
11 |
|
|
local rank="${table%_homonyms}"
|
12 |
|
|
curl --output '#1.htm' "http://www.marine.csiro.au/mirrorsearch/ir_search.list_homonyms?hlevel=$rank&start_letter=$letter_range&restrict_by=pln&output_style=delim_rows"
|
13 |
|
|
}
|
14 |
|
|
|
15 |
|
|
*.txt/make()
|
16 |
|
|
{
|
17 |
12779
|
aaronmk
|
begin_target; deferred_check_target_exists
|
18 |
9949
|
aaronmk
|
*.htm/make
|
19 |
|
|
for in in "$top_dir"/*.htm; do
|
20 |
|
|
stdout="${in/%.htm/.txt}" to_file grep -vE '^<' "$in" # strip tags
|
21 |
|
|
done
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
func_override import__table_run
|
25 |
|
|
import()
|
26 |
|
|
{
|
27 |
12779
|
aaronmk
|
begin_target
|
28 |
9949
|
aaronmk
|
*.txt/make
|
29 |
|
|
self_make import__table_run "$@"
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
fi
|