Last active
October 26, 2021 14:44
-
-
Save skhavari/b23f5d7ae0317a1be9a6 to your computer and use it in GitHub Desktop.
Bash Script to Get Stars on GitHub Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# repo.txt has 1 entry per line like: docker/docker | |
for repo in $( cat repo.txt ); do | |
cmd="curl -s -I https://api.github.com/repos/$repo/stargazers\?page\=1\&per_page\=1 | grep "Link:" | sed -e 's@.*stargazers?page=@@' | sed -e 's@&per_page=1.*@@'" | |
stars=`$cmd` | |
echo $repo $stars | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment