root > WikiSense-trunk > tools > catlist

catlist

text/x-shellscript, 339 bytes (load raw)
#!/bin/bash
lang="$1"
cat="$2"
depth="$3"

if [ -z "$depth" ]; then
  depth=3
fi

url="http://tools.wikimedia.de/~daniel/WikiSense/CategoryIntersect.php?wikilang=$lang&wikifam=.wikipedia.org&basecat=$cat&basedeep=$depth&mode=al&go=1&raw=on"
f="$lang.$cat.list"

wget -O - "$url" | grep '^0' | cut -f 2 > "$f"

echo "created listing in $f";