Created
March 1, 2012 17:43
-
-
Save connatser/1951620 to your computer and use it in GitHub Desktop.
gistJS sample
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
README: http://fitzgen.github.com/github-api/ | |
Repo: https://github.com/fitzgen/github-api/blob/master/github.js |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>GistJS</title> | |
<script type="text/javascript" src="js/github.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
authenticateUser(); | |
function authenticateUser() { | |
this.authUsername = CHANGEME; | |
this.authToken = CHANGEME; | |
gh.authenticate(this.authUsername, this.authToken); | |
//Log who I follow | |
/* | |
gh.user(this.authUsername).following(function (data) { | |
console.log(data.users); | |
}); | |
*/ | |
//Log who follows me | |
/* | |
gh.user(this.authUsername).followers(function (data) { | |
console.log(data.users); | |
}); | |
*/ | |
//Log a list of my repos | |
/* | |
gh.user(this.authUsername).allRepos(function (data) { | |
data.repositories.forEach(function (repo) { | |
console.log(repo.name); | |
}); | |
}); | |
*/ | |
//Log simple description about the repo | |
/* | |
gh.repo(this.authUsername, "larry").show(function (data) { | |
console.log(data.repository.description); | |
}); | |
*/ | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment