Skip to content

Instantly share code, notes, and snippets.

@connatser
Created March 1, 2012 17:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connatser/1951620 to your computer and use it in GitHub Desktop.
Save connatser/1951620 to your computer and use it in GitHub Desktop.
gistJS sample
README: http://fitzgen.github.com/github-api/
Repo: https://github.com/fitzgen/github-api/blob/master/github.js
<!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