#!/bin/sh

mkdir -p out
i=$1
while [ $i -lt $2 ]
do
  echo "Fetching challenge ID: $i"
  curl "http://www.dpchallenge.com/challenge_results.php?CHALLENGE_ID=${i}&showfull=1" | awk 'BEGIN { FS = "<b>"} /average vote of <b>/ { print $3 } END { }' | cut -d '<' -f 1 > out/${i}.txt
  i=`expr $i + 1`
done


