Skip to content

Instantly share code, notes, and snippets.

@reportbase
Created April 3, 2015 14:44
Show Gist options
  • Save reportbase/cd57c28dd0d3695572f1 to your computer and use it in GitHub Desktop.
Save reportbase/cd57c28dd0d3695572f1 to your computer and use it in GitHub Desktop.
git hub - load from the repository
<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