Skip to content

Instantly share code, notes, and snippets.

@Tantas
Created August 17, 2014 19:47
Show Gist options
  • Save Tantas/8e44e1be98009ad49131 to your computer and use it in GitHub Desktop.
Save Tantas/8e44e1be98009ad49131 to your computer and use it in GitHub Desktop.
Get public repository list from GitHub.
#!/usr/bin/env python
"""
Get public repository list from github. Must modify the user name in the script.
"""
import json
import urllib2
# Determine the github api call for the repository list
user = "user_name"
repo_list_url = "https://api.github.com/users/%s/repos" % user
# Download the repository list in json format and convert to an object
repository_list_json_raw = urllib2.urlopen(repo_list_url)
repository_list_json = json.load(repository_list_json_raw)
# Output the clone urls of the repositories
for repository in repository_list_json:
print repository["clone_url"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment