Created
February 17, 2012 03:34
-
-
Save mausch/1850364 to your computer and use it in GitHub Desktop.
Watches all repositories in a given github network
This file contains hidden or 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
user="mausch" | |
token="your_github_token" | |
mainrepo="mausch/solrnet" | |
urls=$(curl -s "https://github.com/api/v2/json/repos/show/$mainrepo/network" | python -mjson.tool | grep "url" | grep -vi "$mainrepo" | sed -re 's/.*(https.*)".*/\1/') | |
for url in $urls; do | |
remote=$(echo $url | cut -d/ -f4-5) | |
curl -F "login=$user" -F "token=$token" "https://github.com/api/v2/json/repos/watch/$remote" | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This needs to be updated for GitHub API v3. Anyone?