Skip to content

Instantly share code, notes, and snippets.

@benhodgson
Created November 1, 2011 18:17
Show Gist options
  • Save benhodgson/1331418 to your computer and use it in GitHub Desktop.
Save benhodgson/1331418 to your computer and use it in GitHub Desktop.
Fetch the Watchers and Forks counts for a GitHub repo
// What up, @mdo. You'll need a recent version of jQuery.
// You can try this out by pasting it into the console on http://api.jquery.com/jQuery.ajax/
window.repoCallback = function (obj) {
console.log("Watchers:" + obj['repository']['watchers']);
console.log("Forks:" + obj['repository']['forks']);
}
$.ajax("http://github.com/api/v2/json/repos/show/twitter/bootstrap?callback=repoCallback", {dataType: "jsonp"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment