Created
March 7, 2017 09:40
-
-
Save BuonOmo/efff1cd87e34713b3bee1e179b6799bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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