-
-
Save bryanveloso/7432 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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import demjson | |
from pprint import pprint | |
import urllib2 | |
def main(): | |
user = "jeremybanks" | |
userJSON = urllib2.urlopen("http://github.com/api/v1/json/%s/" % user).read() | |
user = demjson.decode(userJSON)["user"] | |
print("Latest Commits In %(name)s's Repositories' Master Branches:\n" % user) | |
for repository in user["repositories"]: | |
masterHeadJSON = urllib2.urlopen("http://github.com/api/v1/json/%(owner)s/%(name)s/commit/master" % repository).read() | |
masterHead = demjson.decode(masterHeadJSON)["commit"] | |
masterHead["author"] = "%(name)s <%(email)s>" % masterHead["author"] | |
masterHead["message"],t,t = masterHead["message"].partition("\n") | |
print("%(id)s\n%(author)s\n%(message)s\n" % masterHead) | |
if __name__ == "__main__": sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment