Skip to content

Instantly share code, notes, and snippets.

@skhavari
Last active October 26, 2021 14:44
Show Gist options
  • Save skhavari/b23f5d7ae0317a1be9a6 to your computer and use it in GitHub Desktop.
Save skhavari/b23f5d7ae0317a1be9a6 to your computer and use it in GitHub Desktop.
Bash Script to Get Stars on GitHub Project
#!/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