Open petrosh opened 8 years ago
HTML
<script src="https://npmcdn.com/github-api/dist/GitHub.bundle.min.js"></script>
<script src="script.js"></script>
script.js
function getfit(err, repo) {
if (!err) {
for (var i = 0; i < repo.length; i++) {
var p = document.createElement('p');
p.innerHTML = repo[i].name;
document.body.appendChild(p);
}
}
}
var gh = new GitHub();
var fnp = gh.getOrganization('fork-n-play');
fnp.getRepos(getfit);
Docs
mergePullRequest(number, options [, cb])
getRef(ref [, cb])
Example
repo = oauthAuth.getRepo(OWNER_NAME, PROJECT_NAME);
repo.getRef('heads/master', function(e,r) { ... });
updateHead('heads/master', commitSHA, force, cb)
repo = oauthAuth.getRepo(OWNER_NAME, PROJECT_NAME);
repo.updateHead('heads/master', r.object.sha, true, cb);
getContents(ref, path, raw, cb)
listPullRequests(options [, cb])
_dateToISO(date) → {string}
Example
Start
Reference
[apiRepo, 'git/refs/heads', 'master'].join('/')
master.object.sha
Loader.js
Repository
apiRepo
full_name
owner.type
permissions && permissions.admin
fork
created_at
parent.owner.login
parent.name
parent.created_at
parent_forks
parent.full_name
Player owner (check pulls made)
[apiRepos, parent.full_name, 'pulls'].join('/');
Data:
{"base": "teams"}
pullsArray
No Pulls made (check
teams
ref for both)[apiRepos, parent.full_name, 'git/refs/heads', 'teams'].join('/')
parent.teams.object.sha
[apiRepo, "git/refs/heads", "teams"].join('/')
teams.object.sha
Teams updated (check
data
for both)[apiRepos, parent.full_name, "git/refs/heads", "data"].join('/')
parent.data.object.sha
[apiRepo, "git/refs/heads", "data"].join('/')
data.object.sha
Data updated (check
parent.master
)[apiRepos, parent.full_name, "git/refs/heads", "master"].join('/')
parent.master.object.sha
Master updated (load files: setup, leagues, team)
[apiRepo, 'contents', 'setup.json' + '?ref=' + branch.object.sha
content
sha
[apiRepo, 'contents', 'leagues.json' + '?ref=' + branch.object.sha
content
sha
[apiRepo, 'contents', 'teams/' + repoOwner + '.json?ref=' + branch.object.sha
content
sha
Load page script