From: Reimar Döffinger Date: Sat, 18 Apr 2020 09:04:41 +0000 (+0200) Subject: Update script to work with current wikimedia page. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=391dab855e05ef1e244fc52adf3176e5fc10bb7b Update script to work with current wikimedia page. But don't update the flag list or flags themselves yet, as I have no use for them currently. Alternative to pull request #117. --- diff --git a/images/flags/getFlags.sh b/images/flags/getFlags.sh index 924b77b..4b8b1bb 100755 --- a/images/flags/getFlags.sh +++ b/images/flags/getFlags.sh @@ -4,16 +4,12 @@ OLD_DIR=`pwd` DIR=`dirname $0` cd $DIR -curl commons.wikimedia.org/wiki/Sovereign-state_flags | - egrep -o "\"[^\"]+\"" | - egrep Flag_of | - egrep upload\\.wikimedia | - sed -E 's!^.*(upload.*\svg)/.*$!\1!' | - sed 's!thumb/!!' > flag_files.txt +curl https://commons.wikimedia.org/wiki/Sovereign-state_flags | + egrep -o 'src="[^"]+/Flag_of_[^/"]+\.svg' | + sed -e 's#src="##' -e 's#thumb/##' > flag_files.txt -for i in `cat flag_files.txt` -do - curl --remote-name $i -done +while read i ; do + curl --remote-name "$i" +done < flag_files.txt cd $OLD_DIR