Browse Source

+utils/free_rooms.sh

master
Erik Zscheile 10 months ago
parent
commit
6cab1dff50
2 changed files with 19 additions and 11 deletions
  1. +0
    -11
      src/main.rs
  2. +19
    -0
      utils/free_rooms.sh

+ 0
- 11
src/main.rs View File

@@ -31,12 +31,6 @@ fn main() {
.multiple(true)
.help("append additional categories ('r' will always be fetched)"),
)
.arg(
Arg::with_name("eval-rooms")
.short("r")
.long("eval-rooms")
.help("enable evaluation of rooms"),
)
.get_matches();

let mut categories = vec!["r"];
@@ -82,9 +76,4 @@ fn main() {
}

progbar_master.join_and_clear().unwrap();

if matches.is_present("eval-rooms") {
// TODO: impl eval-rooms
unimplemented!();
}
}

+ 19
- 0
utils/free_rooms.sh View File

@@ -0,0 +1,19 @@
#!/bin/bash

# this script is designed to run from the $destdir
# of the 'dsbfnr' script

cd r || exit 1

echo
echo "== free rooms: =="
echo

for i in *.htm; do
LNC="$(rg -F "<TABLE><TR><TD></TD></TR></TABLE>" "$i" | wc -l)"
if expr "$LNC" '>' 54 &>/dev/null; then
continue
fi
RDESC="$(rg -C 3 -Fx "</font>" "$i" | head -n 3)"
echo -e "$(basename -s .htm "$i")\\t$LNC\\t$(echo "$RDESC" | head -n 1 | tr -cd '[[:print:]]')\\t$(echo "$RDESC" | tail -n 1 | tr -cd '[[:print:]]')"
done | sort -n -b -r -k 2

Loading…
Cancel
Save