Created
April 3, 2015 14:44
-
-
Save reportbase/cd57c28dd0d3695572f1 to your computer and use it in GitHub Desktop.
git hub - load from the repository
This file contains hidden or 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
<script type="text/javascript" src="ext/underscore/underscore-min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script type="text/javascript" src="ext/gh3/gh3.js"></script> | |
function load_github() | |
{ | |
var gh = new Gh3.User("reportbase"); | |
var ghr = new Gh3.Repository("scripts", gh); | |
ghr.fetch(function (err, res) | |
{ | |
ghr.fetchBranches(function (err, res) | |
{ | |
var master = ghr.getBranchByName("master"); | |
master.fetchContents(function (err, res) | |
{ | |
var myfile = master.getFileByName("FILENAME"); | |
myfile.fetchContent(function (err, res) | |
{ | |
console.log(myfile.getRawContent()); | |
}); | |
}); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment