Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/recipe-fiddle.git
#!/bin/bash

URL="http://en.wiktionary.org/w/api.php?action=query&format=xml&generator=categorymembers&gcmlimit=max&gcmtitle=Category:English_uncountable_nouns&gcmcontinue="

mkdir -p output

for x in {1..131}
do
  PAGE_NUMBER=$(printf "%05d\n" $x)
  PAGE=output/page-${PAGE_NUMBER}.xml

  sleep .5
  echo "Downloading $PAGE ..."

  wget -nc -q -O - "$URL$GMCONTINUE" > "$PAGE"
  GMCONTINUE=$(xmlstarlet sel -t -v "*//categorymembers/@gcmcontinue" $PAGE)
  let x="$x+1"
done

# Meep
xmlstarlet sel -t -v "*//page/@title" output/page-00010.xml