book

Github API

The objective is to learn how to use Github's API to pull in real data. Your need to figure out how to compose an URL for accessing a particular API to grab the data you want.

Github provides a wide range of APIs. We will focus on these three for now.

Carefully go through the examples below.

What is the data of the first issue?

Data is loaded from https://api.github.com/repos/bigdatahci2015/forum/issues/1

The data is saved in data. It looks like below.

{
 "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1",
 "labels_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1/labels{/name}",
 "comments_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1/comments",
 "events_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1/events",
 "html_url": "https://github.com/bigdatahci2015/forum/issues/1",
 "id": 102129972,
 "number": 1,
 "title": "Introduction",
 "user": {
  "login": "doubleshow",
  "id": 129562,
  "avatar_url": "https://avatars.githubusercontent.com/u/129562?v=3",
  "gravatar_id": "",
  "url": "https://api.github.com/users/doubleshow",
  "html_url": "https://github.com/doubleshow",
  "followers_url": "https://api.github.com/users/doubleshow/followers",
  "following_url": "https://api.github.com/users/doubleshow/following{/other_user}",
  "gists_url": "https://api.github.com/users/doubleshow/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/doubleshow/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/doubleshow/subscriptions",
  "organizations_url": "https://api.github.com/users/doubleshow/orgs",
  "repos_url": "https://api.github.com/users/doubleshow/repos",
  "events_url": "https://api.github.com/users/doubleshow/events{/privacy}",
  "received_events_url": "https://api.github.com/users/doubleshow/received_events",
  "type": "User",
  "site_admin": false
 },
 "labels": [],
 "state": "open",
 "locked": false,
 "assignee": null,
 "milestone": null,
 "comments": 28,
 "created_at": "2015-08-20T12:43:48Z",
 "updated_at": "2015-09-11T13:57:02Z",
 "closed_at": null,
 "body": "Name: Tom Yeh\r\nDepartment: Computer Science\r\nFavorite Programming Language: Javascript\r\nFavorite Food: BBQ",
 "closed_by": null
}

What is the title of the first issue?

Introduction

Who created this issue?

doubleshow

What are the comments of this issue?

Data is loaded from https://api.github.com/repos/bigdatahci2015/forum/issues/1/comments

The comments data look like

[
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/comments/133203904",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/1#issuecomment-133203904",
  "issue_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1",
  "id": 133203904,
  "user": {
   "login": "willzfarmer",
   "id": 546524,
   "avatar_url": "https://avatars.githubusercontent.com/u/546524?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/willzfarmer",
   "html_url": "https://github.com/willzfarmer",
   "followers_url": "https://api.github.com/users/willzfarmer/followers",
   "following_url": "https://api.github.com/users/willzfarmer/following{/other_user}",
   "gists_url": "https://api.github.com/users/willzfarmer/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/willzfarmer/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/willzfarmer/subscriptions",
   "organizations_url": "https://api.github.com/users/willzfarmer/orgs",
   "repos_url": "https://api.github.com/users/willzfarmer/repos",
   "events_url": "https://api.github.com/users/willzfarmer/events{/privacy}",
   "received_events_url": "https://api.github.com/users/willzfarmer/received_events",
   "type": "User",
   "site_admin": false
  },
  "created_at": "2015-08-20T22:39:50Z",
  "updated_at": "2015-08-20T22:39:50Z",
  "body": "Name: William Farmer\r\nMajor: Applied Math w/ Minor in Computer Science\r\nFavorite Programming Language: Python\r\nFavorite Food: Sushi"
 },
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/comments/133227037",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/1#issuecomment-133227037",
  "issue_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1",
  "id": 133227037,
  "user": {
   "login": "twagar95",
   "id": 10174237,
   "avatar_url": "https://avatars.githubusercontent.com/u/10174237?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/twagar95",
   "html_url": "https://github.com/twagar95",
   "followers_url": "https://api.github.com/users/twagar95/followers",
   "following_url": "https://api.github.com/users/twagar95/following{/other_user}",
   "gists_url": "https://api.github.com/users/twagar95/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/twagar95/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/twagar95/subscriptions",
   "organizations_url": "https://api.github.com/users/twagar95/orgs",
   "repos_url": "https://api.github.com/users/twagar95/repos",
   "events_url": "https://api.github.com/users/twagar95/events{/privacy}",
   "received_events_url": "https://api.github.com/users/twagar95/received_events",
   "type": "User",
   "site_admin": false
  },
  "created_at": "2015-08-21T00:32:27Z",
  "updated_at": "2015-08-21T00:32:27Z",
  "body": "Name: Tristan Wagar\r\nMajor: Computer Science\r\nFavorite Programming Language: Javascript\r\nFavorite Food: Steak"
 },
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/comments/133571232",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/1#issuecomment-133571232",
  "issue_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1",
  "id": 133571232,
  "user": {
   "login": "Malaokia",
   "id": 10319733,
   "avatar_url": "https://avatars.githubusercontent.com/u/10319733?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/Malaokia",
   "html_url": "https://github.com/Malaokia",
   "followers_url": "https://api.github.com/users/Malaokia/followers",
   "following_url": "https://api.github.com/users/Malaokia/following{/other_user}",
   "gists_url": "https://api.github.com/users/Malaokia/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/Malaokia/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/Malaokia/subscriptions",
   "organizations_url": "https://api.github.com/users/Malaokia/orgs",
   "repos_url": "https://api.github.com/users/Malaokia/repos",
   "events_url": "https://api.github.com/users/Malaokia/events{/privacy}",
   "received_events_url": "https://api.github.com/users/Malaokia/received_events",
   "type": "User",
   "site_admin": false
  },
  "created_at": "2015-08-21T21:44:26Z",
  "updated_at": "2015-08-21T21:44:26Z",
  "body": "Name: Mingqi Liew\r\nMajor: Computer Science\r\nFavorite Programming Language: C\r\nFavorite Food: Thai food"
 },
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/comments/133776171",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/1#issuecomment-133776171",
  "issue_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/1",
  "id": 133776171,
  "user": {
   "login": "fadhilfath",
   "id": 5599246,
   "avatar_url": "https://avatars.githubusercontent.com/u/5599246?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/fadhilfath",
   "html_url": "https://github.com/fadhilfath",
   "followers_url": "https://api.githu

There are 28 comments.

return _.pluck(data, 'user.login')

The github account names are willzfarmer,twagar95,Malaokia,fadhilfath,hswitte,ZachLamb,zhya215,jocr1627,drewdinger,94kazakov,nicolele,satchelspencer,tiro6090,Linenfelser,KevinKGifford,calebhsu,sumi6109,pail4944,DomoYeti,boanding,kjblakemore,SankethSukumarShetty,AndreyShprengel,co-bri,karisantos,anbe6083,jraesly,doubleshow.

Exercises

Now it's your turn to answer the following questions using the real data.

How many issues have been created to date in our class's forum repository?

Data is loaded from https://api.github.com/repos/bigdatahci2015/forum/issues

This issues data is saved in data. It looks like below.

[
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/32",
  "labels_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/32/labels{/name}",
  "comments_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/32/comments",
  "events_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/32/events",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/32",
  "id": 109803767,
  "number": 32,
  "title": "IMPORTANT! NetApp / Location Change --> ATLAS",
  "user": {
   "login": "doubleshow",
   "id": 129562,
   "avatar_url": "https://avatars.githubusercontent.com/u/129562?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/doubleshow",
   "html_url": "https://github.com/doubleshow",
   "followers_url": "https://api.github.com/users/doubleshow/followers",
   "following_url": "https://api.github.com/users/doubleshow/following{/other_user}",
   "gists_url": "https://api.github.com/users/doubleshow/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/doubleshow/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/doubleshow/subscriptions",
   "organizations_url": "https://api.github.com/users/doubleshow/orgs",
   "repos_url": "https://api.github.com/users/doubleshow/repos",
   "events_url": "https://api.github.com/users/doubleshow/events{/privacy}",
   "received_events_url": "https://api.github.com/users/doubleshow/received_events",
   "type": "User",
   "site_admin": false
  },
  "labels": [],
  "state": "open",
  "locked": false,
  "assignee": null,
  "milestone": null,
  "comments": 0,
  "created_at": "2015-10-05T14:07:48Z",
  "updated_at": "2015-10-05T14:07:48Z",
  "closed_at": null,
  "body": "I am excited to announce that we will have a special guest speaker from NetApp today to speak about big data at NetApp. Also, we will get a \"real\" data problem to work on. The special speaker is none other than your classmate, Brian McKean.\r\n\r\nNetApp has kindly donated food (pizzas) and drink for our hackathon today. They will arrive around 5pm. Please come with an empty stomach.\r\n\r\n__IMPORTANT: We will move our class to a new location: ATLAS 2nd floor lounge.__ \r\n\r\nTeam: Please remind each other on your team to show up at the right location.\r\n\r\nJust as a reminder, we will devote some part of the class today to present your \"open\" hackathon data analysis report. Because of limited time, we will randomly select half of the class to present about 3-5 minutes each.\r\n\r\nSee you later in class!!"
 },
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/31",
  "labels_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/31/labels{/name}",
  "comments_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/31/comments",
  "events_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/31/events",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/31",
  "id": 109691434,
  "number": 31,
  "title": "All of my gitbook work is missing ",
  "user": {
   "login": "anbe6083",
   "id": 10716752,
   "avatar_url": "https://avatars.githubusercontent.com/u/10716752?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/anbe6083",
   "html_url": "https://github.com/anbe6083",
   "followers_url": "https://api.github.com/users/anbe6083/followers",
   "following_url": "https://api.github.com/users/anbe6083/following{/other_user}",
   "gists_url": "https://api.github.com/users/anbe6083/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/anbe6083/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/anbe6083/subscriptions",
   "organizations_url": "https://api.github.com/users/anbe6083/orgs",
   "repos_url": "https://api.github.com/users/anbe6083/repos",
   "events_url": "https://api.github.com/users/anbe6083/events{/privacy}",
   "received_events_url": "https://api.github.com/users/anbe6083/received_events",
   "type": "User",
   "site_admin": false
  },
  "labels": [],
  "state": "open",
  "locked": false,
  "assignee": null,
  "milestone": null,
  "comments": 1,
  "created_at": "2015-10-04T16:58:11Z",
  "updated_at": "2015-10-04T21:59:16Z",
  "closed_at": null,
  "body": "I was just looking through all of my gitbook work, and none of the content that I've pushed is there. I think something happened last week with pushing the birdstrikes JSON file (From this issue: https://github.com/bigdatahci2015/forum/issues/24). Is there any way for me to recover my work? Thanks. "
 },
 {
  "url": "https://api.github.com/repos/bigdatahci2015/forum/issues/30",
  "labels_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/30/labels{/name}",
  "comments_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/30/comments",
  "events_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/30/events",
  "html_url": "https://github.com/bigdatahci2015/forum/issues/30",
  "id": 109531136,
  "number": 30,

return _.size(data)

There are 26 issues in the HCI Big Data Forum

What are the titles of these issues?

return _.pluck(data, 'title')

The issues of the HCI Big Data Forum are titled: IMPORTANT! NetApp / Location Change --> ATLAS,All of my gitbook work is missing ,Question about using Mongo DB for the android app project,Trouble getting mongodb data,adding axes to SVG charts,Week 6 team homework is released,serving gitbook's specific pages,Viz drills are posted,Questions for the Birdstrike Hackathon,Corrupt file in .git,Converting JSON to Tableau ready (on OSX),Week 4 Learning Challenge ,Your FCQ question,Everyone's book,This week's challenge and next week's hackathon,Week 3 Learning Challenge Updated / Posted,Tableau,lodash variables,Week 2 Learning Challenge Updated / Posted,Week 2 Team Learning Clarification,Knowing Your Classmates Hackathon,Problems uploading book to github.io,Hackathons,First Learning Challenge (Update),Learning challenges,Introduction

How many repository have been created to date for our class?

Our class's Github organization is bigdatahci2015.

Data is loaded from https://api.github.com/orgs/bigdatahci2015/repos

This repositories data is saved in data. It looks like below.

[
 {
  "id": 41092269,
  "name": "forum",
  "full_name": "bigdatahci2015/forum",
  "owner": {
   "login": "bigdatahci2015",
   "id": 13886111,
   "avatar_url": "https://avatars.githubusercontent.com/u/13886111?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/bigdatahci2015",
   "html_url": "https://github.com/bigdatahci2015",
   "followers_url": "https://api.github.com/users/bigdatahci2015/followers",
   "following_url": "https://api.github.com/users/bigdatahci2015/following{/other_user}",
   "gists_url": "https://api.github.com/users/bigdatahci2015/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/bigdatahci2015/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/bigdatahci2015/subscriptions",
   "organizations_url": "https://api.github.com/users/bigdatahci2015/orgs",
   "repos_url": "https://api.github.com/users/bigdatahci2015/repos",
   "events_url": "https://api.github.com/users/bigdatahci2015/events{/privacy}",
   "received_events_url": "https://api.github.com/users/bigdatahci2015/received_events",
   "type": "Organization",
   "site_admin": false
  },
  "private": false,
  "html_url": "https://github.com/bigdatahci2015/forum",
  "description": "",
  "fork": false,
  "url": "https://api.github.com/repos/bigdatahci2015/forum",
  "forks_url": "https://api.github.com/repos/bigdatahci2015/forum/forks",
  "keys_url": "https://api.github.com/repos/bigdatahci2015/forum/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/bigdatahci2015/forum/collaborators{/collaborator}",
  "teams_url": "https://api.github.com/repos/bigdatahci2015/forum/teams",
  "hooks_url": "https://api.github.com/repos/bigdatahci2015/forum/hooks",
  "issue_events_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/events{/number}",
  "events_url": "https://api.github.com/repos/bigdatahci2015/forum/events",
  "assignees_url": "https://api.github.com/repos/bigdatahci2015/forum/assignees{/user}",
  "branches_url": "https://api.github.com/repos/bigdatahci2015/forum/branches{/branch}",
  "tags_url": "https://api.github.com/repos/bigdatahci2015/forum/tags",
  "blobs_url": "https://api.github.com/repos/bigdatahci2015/forum/git/blobs{/sha}",
  "git_tags_url": "https://api.github.com/repos/bigdatahci2015/forum/git/tags{/sha}",
  "git_refs_url": "https://api.github.com/repos/bigdatahci2015/forum/git/refs{/sha}",
  "trees_url": "https://api.github.com/repos/bigdatahci2015/forum/git/trees{/sha}",
  "statuses_url": "https://api.github.com/repos/bigdatahci2015/forum/statuses/{sha}",
  "languages_url": "https://api.github.com/repos/bigdatahci2015/forum/languages",
  "stargazers_url": "https://api.github.com/repos/bigdatahci2015/forum/stargazers",
  "contributors_url": "https://api.github.com/repos/bigdatahci2015/forum/contributors",
  "subscribers_url": "https://api.github.com/repos/bigdatahci2015/forum/subscribers",
  "subscription_url": "https://api.github.com/repos/bigdatahci2015/forum/subscription",
  "commits_url": "https://api.github.com/repos/bigdatahci2015/forum/commits{/sha}",
  "git_commits_url": "https://api.github.com/repos/bigdatahci2015/forum/git/commits{/sha}",
  "comments_url": "https://api.github.com/repos/bigdatahci2015/forum/comments{/number}",
  "issue_comment_url": "https://api.github.com/repos/bigdatahci2015/forum/issues/comments{/number}",
  "contents_url": "https://api.github.com/repos/bigdatahci2015/forum/contents/{+path}",
  "compare_url": "https://api.github.com/repos/bigdatahci2015/forum/compare/{base}...{head}",
  "merges_url": "https://api.github.com/repos/bigdatahci2015/forum/merges",
  "archive_url": "https://api.github.com/repos/bigdatahci2015/forum/{archive_format}{/ref}",
  "downloads_url": "https://api.github.com/repos/bigdatahci2015/forum/downloads",
  "issues_url": "https://api.github.com/repos/bigdatahci2015/forum/issues{/number}",
  "pulls_url": "https://api.github.com/repos/bigdatahci2015/forum/pulls{/number}",
  "milestones_url": "https://api.github.com/repos/bigdatahci2015/forum/milestones{/number}",
  "notifications_url": "https://api.github.com/repos/bigdatahci2015/forum/notifications{?since,all,participating}",
  "labels_url": "https://api.github.com/repos/bigdatahci2015/forum/labels{/name}",
  "releases_url": "https://api.github.com/repos/bigdatahci2015/forum/releases{/id}",
  "created_at": "2015-08-20T11:30:53Z",
  "updated_at": "2015-08-20T11:30:53Z",
  "pushed_at": "2015-08-20T11:32:36Z",
  "git_url": "git://github.com/bigdatahci2015/forum.git",
  "ssh_url": "git@github.com:bigdatahci2015/forum.git",
  "clone_url": "https://github.com/bigdatahci2015/forum.git",
  "svn_url": "https://github.com/bigdatahci2015/forum",
  "homepage": null,
  "size": 104,
  "stargazers_count": 0,
  "watchers_count": 0,
  "language": null,
  "has_issues": true,
  "has_downloads": true,
  "has_wiki": true,
  "has_pages": false,
  "forks_count": 4,
  "mirror_url": null,
  "open_issues_count": 26,
  "forks": 4,
  "open_issues": 26,
  "watcher

return _.size(data)

There are 6 repositories for bigdatahci2015.

What are the fork counts of our class's repositories?

var repo_names = _.pluck(data, 'name')
var count = _.pluck(data, 'forks_count')
answer = ""
// FIXME: Do without a for loop
for (i = 0; i < repo_names.length; i++) {
    if (i < repo_names.length - 1) {answer += repo_names[i] + ' has ' + count[i] + ' forks; '}
    else {answer += repo_names[i] + ' has ' + count[i] + ' forks.'}
}
return answer

The results are: forum has 4 forks; course has 2 forks; book-warmup has 25 forks; book has 32 forks; gitbook-plugin-bigdata has 2 forks; book2 has 0 forks.

How many public repositories does the user doubleshow have?

Data is loaded from https://api.github.com/users/doubleshow/repos

The doubleshow repositories data is saved in data. It looks like below.

[
 {
  "id": 28779360,
  "name": "base",
  "full_name": "doubleshow/base",
  "owner": {
   "login": "doubleshow",
   "id": 129562,
   "avatar_url": "https://avatars.githubusercontent.com/u/129562?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/doubleshow",
   "html_url": "https://github.com/doubleshow",
   "followers_url": "https://api.github.com/users/doubleshow/followers",
   "following_url": "https://api.github.com/users/doubleshow/following{/other_user}",
   "gists_url": "https://api.github.com/users/doubleshow/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/doubleshow/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/doubleshow/subscriptions",
   "organizations_url": "https://api.github.com/users/doubleshow/orgs",
   "repos_url": "https://api.github.com/users/doubleshow/repos",
   "events_url": "https://api.github.com/users/doubleshow/events{/privacy}",
   "received_events_url": "https://api.github.com/users/doubleshow/received_events",
   "type": "User",
   "site_admin": false
  },
  "private": false,
  "html_url": "https://github.com/doubleshow/base",
  "description": "",
  "fork": false,
  "url": "https://api.github.com/repos/doubleshow/base",
  "forks_url": "https://api.github.com/repos/doubleshow/base/forks",
  "keys_url": "https://api.github.com/repos/doubleshow/base/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/doubleshow/base/collaborators{/collaborator}",
  "teams_url": "https://api.github.com/repos/doubleshow/base/teams",
  "hooks_url": "https://api.github.com/repos/doubleshow/base/hooks",
  "issue_events_url": "https://api.github.com/repos/doubleshow/base/issues/events{/number}",
  "events_url": "https://api.github.com/repos/doubleshow/base/events",
  "assignees_url": "https://api.github.com/repos/doubleshow/base/assignees{/user}",
  "branches_url": "https://api.github.com/repos/doubleshow/base/branches{/branch}",
  "tags_url": "https://api.github.com/repos/doubleshow/base/tags",
  "blobs_url": "https://api.github.com/repos/doubleshow/base/git/blobs{/sha}",
  "git_tags_url": "https://api.github.com/repos/doubleshow/base/git/tags{/sha}",
  "git_refs_url": "https://api.github.com/repos/doubleshow/base/git/refs{/sha}",
  "trees_url": "https://api.github.com/repos/doubleshow/base/git/trees{/sha}",
  "statuses_url": "https://api.github.com/repos/doubleshow/base/statuses/{sha}",
  "languages_url": "https://api.github.com/repos/doubleshow/base/languages",
  "stargazers_url": "https://api.github.com/repos/doubleshow/base/stargazers",
  "contributors_url": "https://api.github.com/repos/doubleshow/base/contributors",
  "subscribers_url": "https://api.github.com/repos/doubleshow/base/subscribers",
  "subscription_url": "https://api.github.com/repos/doubleshow/base/subscription",
  "commits_url": "https://api.github.com/repos/doubleshow/base/commits{/sha}",
  "git_commits_url": "https://api.github.com/repos/doubleshow/base/git/commits{/sha}",
  "comments_url": "https://api.github.com/repos/doubleshow/base/comments{/number}",
  "issue_comment_url": "https://api.github.com/repos/doubleshow/base/issues/comments{/number}",
  "contents_url": "https://api.github.com/repos/doubleshow/base/contents/{+path}",
  "compare_url": "https://api.github.com/repos/doubleshow/base/compare/{base}...{head}",
  "merges_url": "https://api.github.com/repos/doubleshow/base/merges",
  "archive_url": "https://api.github.com/repos/doubleshow/base/{archive_format}{/ref}",
  "downloads_url": "https://api.github.com/repos/doubleshow/base/downloads",
  "issues_url": "https://api.github.com/repos/doubleshow/base/issues{/number}",
  "pulls_url": "https://api.github.com/repos/doubleshow/base/pulls{/number}",
  "milestones_url": "https://api.github.com/repos/doubleshow/base/milestones{/number}",
  "notifications_url": "https://api.github.com/repos/doubleshow/base/notifications{?since,all,participating}",
  "labels_url": "https://api.github.com/repos/doubleshow/base/labels{/name}",
  "releases_url": "https://api.github.com/repos/doubleshow/base/releases{/id}",
  "created_at": "2015-01-04T16:30:58Z",
  "updated_at": "2015-01-21T13:01:26Z",
  "pushed_at": "2015-01-21T13:01:05Z",
  "git_url": "git://github.com/doubleshow/base.git",
  "ssh_url": "git@github.com:doubleshow/base.git",
  "clone_url": "https://github.com/doubleshow/base.git",
  "svn_url": "https://github.com/doubleshow/base",
  "homepage": null,
  "size": 168,
  "stargazers_count": 1,
  "watchers_count": 1,
  "language": null,
  "has_issues": true,
  "has_downloads": true,
  "has_wiki": true,
  "has_pages": false,
  "forks_count": 0,
  "mirror_url": null,
  "open_issues_count": 0,
  "forks": 0,
  "open_issues": 0,
  "watchers": 1,
  "default_branch": "master"
 },
 {
  "id": 41277010,
  "name": "book",
  "full_name": "doubleshow/book",
  "owner": {
   "login": "doubleshow",
   "id": 129562,
   "avatar_url": "https://avatars.githubusercontent.com/u/129562?v=3",
   "gravatar_id": "",
   "url": "

return _.size(data)

User doubleshow has 30 public repositories

How many public gists does the user doubleshow have?

Data is loaded from https://api.github.com/users/doubleshow/gists

The doubleshow gist data is saved in data. It looks like below.

[
 {
  "url": "https://api.github.com/gists/b303fe255146a0788fa0",
  "forks_url": "https://api.github.com/gists/b303fe255146a0788fa0/forks",
  "commits_url": "https://api.github.com/gists/b303fe255146a0788fa0/commits",
  "id": "b303fe255146a0788fa0",
  "git_pull_url": "https://gist.github.com/b303fe255146a0788fa0.git",
  "git_push_url": "https://gist.github.com/b303fe255146a0788fa0.git",
  "html_url": "https://gist.github.com/b303fe255146a0788fa0",
  "files": {
   "index.xml": {
    "filename": "index.xml",
    "type": "application/xml",
    "language": "XML",
    "raw_url": "https://gist.githubusercontent.com/doubleshow/b303fe255146a0788fa0/raw/c78ef03c42deaba281e4da48b1fc9bf7ff96cebb/index.xml",
    "size": 676
   }
  },
  "public": true,
  "created_at": "2015-10-02T22:41:53Z",
  "updated_at": "2015-10-02T22:41:54Z",
  "description": "craftml",
  "comments": 0,
  "user": null,
  "comments_url": "https://api.github.com/gists/b303fe255146a0788fa0/comments",
  "owner": {
   "login": "doubleshow",
   "id": 129562,
   "avatar_url": "https://avatars.githubusercontent.com/u/129562?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/doubleshow",
   "html_url": "https://github.com/doubleshow",
   "followers_url": "https://api.github.com/users/doubleshow/followers",
   "following_url": "https://api.github.com/users/doubleshow/following{/other_user}",
   "gists_url": "https://api.github.com/users/doubleshow/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/doubleshow/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/doubleshow/subscriptions",
   "organizations_url": "https://api.github.com/users/doubleshow/orgs",
   "repos_url": "https://api.github.com/users/doubleshow/repos",
   "events_url": "https://api.github.com/users/doubleshow/events{/privacy}",
   "received_events_url": "https://api.github.com/users/doubleshow/received_events",
   "type": "User",
   "site_admin": false
  }
 },
 {
  "url": "https://api.github.com/gists/72770d670f7d25cb29c2",
  "forks_url": "https://api.github.com/gists/72770d670f7d25cb29c2/forks",
  "commits_url": "https://api.github.com/gists/72770d670f7d25cb29c2/commits",
  "id": "72770d670f7d25cb29c2",
  "git_pull_url": "https://gist.github.com/72770d670f7d25cb29c2.git",
  "git_push_url": "https://gist.github.com/72770d670f7d25cb29c2.git",
  "html_url": "https://gist.github.com/72770d670f7d25cb29c2",
  "files": {
   "index.xml": {
    "filename": "index.xml",
    "type": "application/xml",
    "language": "XML",
    "raw_url": "https://gist.githubusercontent.com/doubleshow/72770d670f7d25cb29c2/raw/378e75c172e2a11d2ccbecf6a0330f88cf092096/index.xml",
    "size": 323
   }
  },
  "public": true,
  "created_at": "2015-10-01T20:45:19Z",
  "updated_at": "2015-10-01T20:46:35Z",
  "description": "craftml",
  "comments": 0,
  "user": null,
  "comments_url": "https://api.github.com/gists/72770d670f7d25cb29c2/comments",
  "owner": {
   "login": "doubleshow",
   "id": 129562,
   "avatar_url": "https://avatars.githubusercontent.com/u/129562?v=3",
   "gravatar_id": "",
   "url": "https://api.github.com/users/doubleshow",
   "html_url": "https://github.com/doubleshow",
   "followers_url": "https://api.github.com/users/doubleshow/followers",
   "following_url": "https://api.github.com/users/doubleshow/following{/other_user}",
   "gists_url": "https://api.github.com/users/doubleshow/gists{/gist_id}",
   "starred_url": "https://api.github.com/users/doubleshow/starred{/owner}{/repo}",
   "subscriptions_url": "https://api.github.com/users/doubleshow/subscriptions",
   "organizations_url": "https://api.github.com/users/doubleshow/orgs",
   "repos_url": "https://api.github.com/users/doubleshow/repos",
   "events_url": "https://api.github.com/users/doubleshow/events{/privacy}",
   "received_events_url": "https://api.github.com/users/doubleshow/received_events",
   "type": "User",
   "site_admin": false
  }
 },
 {
  "url": "https://api.github.com/gists/d65cc7532b3604d9fb83",
  "forks_url": "https://api.github.com/gists/d65cc7532b3604d9fb83/forks",
  "commits_url": "https://api.github.com/gists/d65cc7532b3604d9fb83/commits",
  "id": "d65cc7532b3604d9fb83",
  "git_pull_url": "https://gist.github.com/d65cc7532b3604d9fb83.git",
  "git_push_url": "https://gist.github.com/d65cc7532b3604d9fb83.git",
  "html_url": "https://gist.github.com/d65cc7532b3604d9fb83",
  "files": {
   "index.xml": {
    "filename": "index.xml",
    "type": "application/xml",
    "language": "XML",
    "raw_url": "https://gist.githubusercontent.com/doubleshow/d65cc7532b3604d9fb83/raw/a14e4fc00ff90baf05282177fc6760e9fac9f193/index.xml",
    "size": 179
   }
  },
  "public": true,
  "created_at": "2015-10-01T19:44:40Z",
  "updated_at": "2015-10-01T19:45:46Z",
  "description": "craftml",
  "comments": 0,
  "user": null,
  "comments_url": "https://api.github.com/gists/d65cc7532b3604d9fb83/comments",
  "owner": {
   "login": "doubleshow",
   "id": 129562,
   "avatar_url": "https://avatars.gi

return _.size(data)

User doubleshow has 30 public gists