#!/bin/bash # githubuser--Given a GitHub username, pulls information about them. if test $Argc -ne 1 { echo "Usage: $0 " exit 1 } # The -s silences curl's normally verbose output. curl -s "https://api.github.com/users/$1" | \ awk -F'"' ' /\"name\":/ { print $4" is the name of the Github user." } /\"followers\":/{ split($3, a, " ") sub(/,/, "", a[2]) print "They have "a[2]" followers." } /\"following\":/{ split($3, a, " ") sub(/,/, "", a[2]) print "They are following "a[2]" other users." } /\"created_at\":/{ print "Their account was created on "$4"." } ' exit 0