Skip to content

Instantly share code, notes, and snippets.

@PLNech
Last active September 18, 2018 12:49
Show Gist options
  • Save PLNech/be6d5757f0dd5bb785a33d27d86a27a7 to your computer and use it in GitHub Desktop.
Save PLNech/be6d5757f0dd5bb785a33d27d86a27a7 to your computer and use it in GitHub Desktop.
Get how many public repositories mention a topic for a list of GitHub topics.
#! /bin/sh
echo "Counting repositories for GitHub topics ($# given)."
for topic in $@; do
count=`curl https://github.com/topics/$topic -s | grep Counter | cut -d'>' -f2 | cut -d'<' -f 1`
printf '%-20s: %-6s repos.\n' $topic $count;
done
@PLNech
Copy link
Author

PLNech commented Sep 18, 2018

Example output:

Counting repositories for given GitHub topics (5 given).
foo                 : 6      repos.
bar                 : 160    repos.
java                : 61,853 repos.
fizzbuzz            : 199    repos.
machine-learning    : 22,131 repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment