Add helper scripts for finding and loading active repos (on github)

[ci skip]
This commit is contained in:
Valentin Brandl 2019-07-07 20:22:32 +02:00
parent f3902f800f
commit b71207ca51
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D
2 changed files with 31 additions and 0 deletions

10
scripts/find-active.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -e
DIR=${1:-repos}
for url in $(./scripts/list.sh "${DIR}")
do
(curl "${url}" --silent | grep -q hitsofcode) && echo "${url}"
done

21
scripts/load-active.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -e
ACTIVE=${1}
if [ -z "${ACTIVE}" ]
then
echo "Usage: $0 <list of active repos>"
exit 1
fi
while IFS= read -r url
do
imgs=$(curl "${url}" --silent | grep hitsofcode | grep -o -P 'https://camo.githubusercontent.com/[a-z0-9]+/[a-z0-9]+')
[ -z "${imgs}" ] || echo "${url}"
for img in ${imgs}
do
curl "$img" --silent > /dev/null
done
done < "${ACTIVE}"