Skip to content

Instantly share code, notes, and snippets.

@guihatano
Last active June 5, 2019 01:41
Show Gist options
  • Select an option

  • Save guihatano/98442b839e264fc2a74a66309b4f955a to your computer and use it in GitHub Desktop.

Select an option

Save guihatano/98442b839e264fc2a74a66309b4f955a to your computer and use it in GitHub Desktop.

Revisions

  1. guihatano revised this gist Jun 5, 2019. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions download_pics.sh
    Original file line number Diff line number Diff line change
    @@ -10,10 +10,17 @@ 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++))
    # 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
    #wget $url$c".JPG"
    curl -O $url$c".JPG"
    curl -O $url$counter".JPG"
    ((counter++))
    done

    for f in *.JPG
  2. guihatano created this gist Jun 5, 2019.
    26 changes: 26 additions & 0 deletions download_pics.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/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

    for f in *.JPG
    do
    filesize=$(wc -c $f | awk '{print $1}')
    if [ $filesize -eq 345 ]; then
    echo removing $f
    rm $f
    fi
    done