Skip to content

Instantly share code, notes, and snippets.

@kulte
Created May 30, 2012 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kulte/2837475 to your computer and use it in GitHub Desktop.
Save kulte/2837475 to your computer and use it in GitHub Desktop.
gitgoggles.js
var GitGoggles = {
getRepos: function(callback) {
this._get('repositories', callback);
},
getRepo: function(repo, callback) {
this._get('repository/' + repo, callback);
},
getCommits: function(repo, callback) {
this._get('repository/' + repo + '/commits', callback);
},
getCommit: function(repo, sha, callback) {
this._get('repository/' + repo + '/commit/' + sha, callback);
},
getTags: function(repo, callback) {
this._get('repository/' + repo + '/tags', callback);
},
getTag: function(repo, tag, callback) {
this._get('repository/' + repo + '/tag/' + tag, callback);
},
getBranches: function(repo, callback) {
this._get('repository/' + repo + '/branches', callback);
},
getBranch: function(repo, branch, callback) {
this._get('repository/' + repo + '/branch/' + branch, callback);
},
_root: 'http://localhost:9292',
_get: function(path, callback) {
$.getJSON(this._root + path + '?callback=?', callback);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment