Skip to content

Instantly share code, notes, and snippets.

@BuonOmo
Created March 7, 2017 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BuonOmo/efff1cd87e34713b3bee1e179b6799bc to your computer and use it in GitHub Desktop.
Save BuonOmo/efff1cd87e34713b3bee1e179b6799bc to your computer and use it in GitHub Desktop.
#!/bin/sh
gh_user=BuonOmo
curl -u $gh_user 'https://api.github.com/search/code?q=*.github.io' > req.json
# set boundaries, default: {min: 0, max: 9}
[ $# -gt 0 ] && min=$1 && shift || min=0
[ $# -gt 0 ] && max=$1 || max=9
# iterate through gh-pages urls
for i in `seq $min $max` ;do
# find gh-page url
url='https://'$(jshon -F req.json -e items -e $i -e repository -e full_name|sed 's:\\/\.\?:.:'|tr -d \")
# open it if the request url is 200
curl -I $url | head -n 1 | grep 200 && xdg-open $url
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment