Add helper scripts for finding and loading active repos (on github)
[ci skip]
This commit is contained in:
parent
f3902f800f
commit
b71207ca51
10
scripts/find-active.sh
Executable file
10
scripts/find-active.sh
Executable 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
21
scripts/load-active.sh
Executable 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}"
|
Loading…
Reference in New Issue
Block a user