{"action":"created","issue":{"url":"https://api.github.com/repos/alysonla/hubber-memory-game/issues/8","labels_url":"https://api.github.com/repos/alysonla/hubber-memory-game/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/alysonla/hubber-memory-game/issues/8/comments","events_url":"https://api.github.com/repos/alysonla/hubber-memory-game/issues/8/events","html_url":"https://github.com/alysonla/hubber-memory-game/pull/8","id":106920100,"number":8,"title":"Fetch the GitHub members","user":{"login":"IonicaBizau","id":2864371,"avatar_url":"https://avatars.githubusercontent.com/u/2864371?v=3","gravatar_id":"","url":"https://api.github.com/users/IonicaBizau","html_url":"https://github.com/IonicaBizau","followers_url":"https://api.github.com/users/IonicaBizau/followers","following_url":"https://api.github.com/users/IonicaBizau/following{/other_user}","gists_url":"https://api.github.com/users/IonicaBizau/gists{/gist_id}","starred_url":"https://api.github.com/users/IonicaBizau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IonicaBizau/subscriptions","organizations_url":"https://api.github.com/users/IonicaBizau/orgs","repos_url":"https://api.github.com/users/IonicaBizau/repos","events_url":"https://api.github.com/users/IonicaBizau/events{/privacy}","received_events_url":"https://api.github.com/users/IonicaBizau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-17T06:31:35Z","updated_at":"2015-09-17T14:28:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alysonla/hubber-memory-game/pulls/8","html_url":"https://github.com/alysonla/hubber-memory-game/pull/8","diff_url":"https://github.com/alysonla/hubber-memory-game/pull/8.diff","patch_url":"https://github.com/alysonla/hubber-memory-game/pull/8.patch"},"body":"This pull request adds the functionality to use the public GitHub API to fetch the GitHub members. :star2: \r\n\r\nTo access the GitHub API, I used [`gh.js`](https://github.com/IonicaBizau/gh.js)–a library created by me. Here is how the code looks like:\r\n\r\n```js\r\nvar gh = new GitHub();\r\ngh.get(\"orgs/github/members\", { all: true }, function (err, members) {\r\n   /* do something with these awesome people */\r\n});\r\n```\r\n\r\nObviously, after three games (there are 3 requests to the members endpoint and 16 requests to `users/<login>` per game–and the rate limit is 60) it will fallback to the `js/Hubbers.js` information, due to the public rate limit. Why 16? Because there are 16 squares and because the `name` resource doesn't appear in the `members` endpoint responses. :balloon: \r\n\r\nTo update the information in that file, I built a tiny script (`build.js`) which uses `gh.js` on the server, fetches the needed info and saves it into the `Hubbers.js` file. This way we can easily update the members info. :rocket: \r\n\r\n```sh\r\n$ node build.js <token>\r\n```\r\n\r\n@alysonla Please test it out and see what else should be fixed/improved. :grin: Of course, the docs should be updated too.\r\n\r\nAnd yeah, it fixes #5! :four_leaf_clover: "},"comment":{"url":"https://api.github.com/repos/alysonla/hubber-memory-game/issues/comments/141103992","html_url":"https://github.com/alysonla/hubber-memory-game/pull/8#issuecomment-141103992","issue_url":"https://api.github.com/repos/alysonla/hubber-memory-game/issues/8","id":141103992,"user":{"login":"IonicaBizau","id":2864371,"avatar_url":"https://avatars.githubusercontent.com/u/2864371?v=3","gravatar_id":"","url":"https://api.github.com/users/IonicaBizau","html_url":"https://github.com/IonicaBizau","followers_url":"https://api.github.com/users/IonicaBizau/followers","following_url":"https://api.github.com/users/IonicaBizau/following{/other_user}","gists_url":"https://api.github.com/users/IonicaBizau/gists{/gist_id}","starred_url":"https://api.github.com/users/IonicaBizau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IonicaBizau/subscriptions","organizations_url":"https://api.github.com/users/IonicaBizau/orgs","repos_url":"https://api.github.com/users/IonicaBizau/repos","events_url":"https://api.github.com/users/IonicaBizau/events{/privacy}","received_events_url":"https://api.github.com/users/IonicaBizau/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T14:28:29Z","updated_at":"2015-09-17T14:28:29Z","body":"@alysonla And should we add a visual thing that shows to the user that something is loading? :thought_balloon: "}}