Skip to content

Instantly share code, notes, and snippets.

@johnbender
Created November 28, 2008 06:03
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 johnbender/29910 to your computer and use it in GitHub Desktop.
Save johnbender/29910 to your computer and use it in GitHub Desktop.
this.GetRepos = function()
{
//create an array of the github data, used to prevent mutiple hits
//to the server for the same user
var github_usernames = new Array();
//for all the github-projects divs
$(GITHUB_PROJECTS_CLASS).each(function(i) {
//create an array of all unique userids in the page
if(this.id != undefined)
{
//add this object (div by default) that met the query parameters
//to a list to be altered later
if( GitHubRepos.displayObjects[this.id] == undefined)
{
GitHubRepos.displayObjects[this.id] = new Array();
}
GitHubRepos.displayObjects[this.id][i] = this;
}
});
//for each unique user
for(var i in GitHubRepos.displayObjects)
{
//format the github url for our given user and callback function
var github_url = format(GITHUB_JSON_URL, i, "GitHubRepos.DisplayRepos");
//insert a script into the DOM to add our JSON data via the github url
//once the script loads it will callback the DATA_DISPLAY_FUCNTION
$('head').append(format(DYNAMIC_SCRIPT_TEMPLATE, github_url));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment