Skip to content

Instantly share code, notes, and snippets.

@jayswan
Created September 28, 2016 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayswan/592a883b359185d0b2fcf3358f601057 to your computer and use it in GitHub Desktop.
Save jayswan/592a883b359185d0b2fcf3358f601057 to your computer and use it in GitHub Desktop.
pipe-able script to check the existence of a GitHub username; returns 200 if found
#!/bin/sh
# Usage: some_command_that_outputs_usernames | uexists.sh
# subject to anonymous API rate limits
xargs -I {} curl -w "%{http_code}\n" -sI -o /dev/null https://api.github.com/users/{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment