#!/bin/bash -e # TODO fix bug when same package updated twice in a row: # use masterlist root_dir=`pwd -P` mkdir -p old pnd if [ done -nt index.html ]; then for A in index.html apps.txt masterlist; do mv $A old/$A || touch old/$A done fi wget -q 'http://repo.openpandora.org/?page=all&s=new&ipp=all' -O index.html wget -q 'http://repo.openpandora.org/client/masterlist' -O masterlist # PARALLEL_MAX=4 < index.html htmllinks | perl -ne 's/^\?page=detail&app=// and print' > apps.txt diff old/apps.txt apps.txt | perl -ne 's/^> // and print' | tac > apps.new # WGET_OPTS=-nc : ${WGET_OPTS:=-N -nv} export WGET_OPTS ( cd pnd while read L; do "$root_dir/snarf_app.sh" "$L" "$root_dir/id2pnd.sh" "$L" >>"$root_dir/id2pnd.txt" done ) < apps.new touch done