Skip to content

Instantly share code, notes, and snippets.

@guihatano
Last active June 5, 2019 01:41
Show Gist options
  • Save guihatano/98442b839e264fc2a74a66309b4f955a to your computer and use it in GitHub Desktop.
Save guihatano/98442b839e264fc2a74a66309b4f955a to your computer and use it in GitHub Desktop.
script to download pictures from an event
#!/bin/bash
#kendo_start 8866
#kendo_last 9079
#8814
initial_pic=8866
#last_pic=9181
last_pic=9079
url="http://www.saocarlos.sp.gov.br/images/stories/abril2019/MESDASARTESMARCIAIS/DSC_"
url2="http://www.saocarlos.sp.gov.br/plugins/content/jw_sigpro/sigpro.download.php?file=images/stories/abril2019/MESDASARTESMARCIAIS/DSC_"
# for ((c=$initial_pic; c<=$last_pic; c++))
# do
# #wget $url$c".JPG"
# curl -O $url$c".JPG"
# done
counter=$initial_pic
while [ $counter -le $last_pic ]
do
curl -O $url$counter".JPG"
((counter++))
done
for f in *.JPG
do
filesize=$(wc -c $f | awk '{print $1}')
if [ $filesize -eq 345 ]; then
echo removing $f
rm $f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment