Skip to content

Instantly share code, notes, and snippets.

@anroots
Created May 11, 2012 01:49
Show Gist options
  • Save anroots/2656998 to your computer and use it in GitHub Desktop.
Save anroots/2656998 to your computer and use it in GitHub Desktop.
Download ITK student images
#!/bin/bash
kasutajanimi=foobar # User
salasona=foobar # Pass
kaust="itk-pic" # Folder name
min_pic_id="440" # Min pic ID
max_pic_id="1000" # Max pic ID
wget --user-agent "ITK Notifier" --no-check-certificate --keep-session-cookies --save-cookies cookies.txt
--post-data="username=$kasutajanimi&pw=$salasona&Login=Logi sisse" https://itcollege.ois.ee/auth/login -O login
for i in `seq $min_pic_id $max_pic_id`;
do
file="$kaust/$i.jpg"
echo "Download $file"
echo ""
wget --user-agent "ITK Notifier" --no-check-certificate
--load-cookies cookies.txt "https://itcollege.ois.ee/et/file/user-picture?user_id=$i" -O $file
done
rm -f login cookies.txt
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment