Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum


download

kabir_iut 6338. download
2008-08-31 07:07:06 Hi,I am new in this site.
can ne1 tell me how can I download all of the problems.
thanx in advance
Moises Osorio [WCoder] 6344. Re:download
2008-09-05 04:24:12 I was trying to do that before, and I had to write a program in bash to do it for me (not by hand). You can use it if you want to. You can download entire volumes with it =)

#! /bin/bash
function download {
  url="http://acm.tju.edu.cn/toj/showp$1.html"
  wget -q -p -N -k -P $2 $url
  echo "Problem #$1 - Downloaded"
}
if [ -z "$1" ]; then
  echo usage: $0 directory
  exit
fi
dir="vol$1"
vol=$1
echo "Downloading volume $vol of problems in TOJ."
list="http://acm.tju.edu.cn/toj/list$vol.html"
if [ -z "$3" ]; then
  wget -q -p -N -P $dir $list
else
  wget -q -p -N --post-data="user_id=$2&passwd=$3" -P $dir $list
fi
for i in `seq 1 100`;
do
  id=$(( ( vol + 9 ) * 100 + i ))
  download $id $dir
done
path="vol$vol/acm.tju.edu.cn"
mv $path/toj/* "vol$vol"
rm -r $path
echo "Downloaded volume $vol!"
kabir_iut 6346. Re:download
2008-09-05 19:23:55 thanx for ur reply. But I dont really understand how to use this code to download all problems.If u have time pliz let me know.
thanx in advance
Moises Osorio [WCoder] 6368. Re:download
2008-09-11 05:58:06 Well you need bash to run it. If you have linux you already have bash. Run it on terminal in this way:

download_toj volN user password
where
download_toj is the program's name
volN is the volume number N
user is your username (optional)
password is your password (optional)

If you have windows you can not use it, sorry =P
mgy@TJU_Buddha 6371. Re:download
2008-09-11 12:46:03 very cool!
shell program~
Wilbert 6481. Re:download
2008-10-25 15:58:21 Wow.., thanks brother.. :)
  1

Search    Goto Page:  
User ID:
Password:
Title:

Tianjin University Online Judge v1.2.4