{"action":"created","comment":{"url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/comments/30460092","id":30460092,"diff_hunk":"@@ -47,19 +73,26 @@\n       return;\n     }\n \n-    count = $('<span class=\"count\"><img src=\"images/octocat-spinner-32.gif\" /></span>').appendTo(a);\n-    $.ajax(url)\n-      .done(function(data, textStatus, jqXHR) {\n-        count.html(data && typeof data.length === 'number' ? data.length.toString() : '?');\n-      })\n-      .fail(function(jqXHR, textStatus, errorThrown) {\n-        var rateLimited = jqXHR.getResponseHeader('X-RateLimit-Remaining') === '0'\n-          , rateLimitReset = rateLimited && new Date(1000 * +jqXHR.getResponseHeader('X-RateLimit-Reset'))\n-          , message = rateLimitReset ? 'GitHub rate limit met. Reset at ' + rateLimitReset.toLocaleTimeString() + '.' :\n-                      'Could not get issue count from GitHub: ' + ((jqXHR.responseJSON && jqXHR.responseJSON.message) || errorThrown) + '.';\n-        count.html('?');\n-        count.attr('title', message);\n-      });\n+    count = $('<span class=\"count\"><img src=\"images/octocat-spinner-32.gif\" /></span>').appendTo(a);\r\n+    var cached = storage.get(gh[1]);\n+    if (cached && cached.date >= (new Date() - 1000 * 60 * 60 * 24)) {\r","path":"javascripts/main.js","position":52,"original_position":52,"commit_id":"a2180493e93050854dfac13e89816706d1579025","original_commit_id":"a2180493e93050854dfac13e89816706d1579025","user":{"login":"dahlbyk","id":133987,"avatar_url":"https://avatars.githubusercontent.com/u/133987?v=3","gravatar_id":"","url":"https://api.github.com/users/dahlbyk","html_url":"https://github.com/dahlbyk","followers_url":"https://api.github.com/users/dahlbyk/followers","following_url":"https://api.github.com/users/dahlbyk/following{/other_user}","gists_url":"https://api.github.com/users/dahlbyk/gists{/gist_id}","starred_url":"https://api.github.com/users/dahlbyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dahlbyk/subscriptions","organizations_url":"https://api.github.com/users/dahlbyk/orgs","repos_url":"https://api.github.com/users/dahlbyk/repos","events_url":"https://api.github.com/users/dahlbyk/events{/privacy}","received_events_url":"https://api.github.com/users/dahlbyk/received_events","type":"User","site_admin":false},"body":"I'm never seeing the cache hit. Looks like `cached.date` is a `string`?","created_at":"2015-05-16T10:16:10Z","updated_at":"2015-05-16T10:16:10Z","html_url":"https://github.com/dahlbyk-demo/up-for-grabs.net/pull/1#discussion_r30460092","pull_request_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/comments/30460092"},"html":{"href":"https://github.com/dahlbyk-demo/up-for-grabs.net/pull/1#discussion_r30460092"},"pull_request":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1","id":32624262,"html_url":"https://github.com/dahlbyk-demo/up-for-grabs.net/pull/1","diff_url":"https://github.com/dahlbyk-demo/up-for-grabs.net/pull/1.diff","patch_url":"https://github.com/dahlbyk-demo/up-for-grabs.net/pull/1.patch","issue_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues/1","number":1,"state":"open","locked":false,"title":"Add local storage to issue count","user":{"login":"Steven-Pingel","id":5604387,"avatar_url":"https://avatars.githubusercontent.com/u/5604387?v=3","gravatar_id":"","url":"https://api.github.com/users/Steven-Pingel","html_url":"https://github.com/Steven-Pingel","followers_url":"https://api.github.com/users/Steven-Pingel/followers","following_url":"https://api.github.com/users/Steven-Pingel/following{/other_user}","gists_url":"https://api.github.com/users/Steven-Pingel/gists{/gist_id}","starred_url":"https://api.github.com/users/Steven-Pingel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Steven-Pingel/subscriptions","organizations_url":"https://api.github.com/users/Steven-Pingel/orgs","repos_url":"https://api.github.com/users/Steven-Pingel/repos","events_url":"https://api.github.com/users/Steven-Pingel/events{/privacy}","received_events_url":"https://api.github.com/users/Steven-Pingel/received_events","type":"User","site_admin":false},"body":"Adding local storage to reduce the GH api calls.  Data is considered stale after 24 hours.\r\n\r\nstorage module inspired by : http://visualstudiomagazine.com/articles/2011/11/01/caching-in-on-html5-local-storage.aspx","created_at":"2015-04-03T23:48:43Z","updated_at":"2015-05-16T10:16:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b3adca381d9261c6c7cbba5a3518a84312b4a5d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues/1/comments","statuses_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/statuses/a2180493e93050854dfac13e89816706d1579025","head":{"label":"Steven-Pingel:gh-pages","ref":"gh-pages","sha":"a2180493e93050854dfac13e89816706d1579025","user":{"login":"Steven-Pingel","id":5604387,"avatar_url":"https://avatars.githubusercontent.com/u/5604387?v=3","gravatar_id":"","url":"https://api.github.com/users/Steven-Pingel","html_url":"https://github.com/Steven-Pingel","followers_url":"https://api.github.com/users/Steven-Pingel/followers","following_url":"https://api.github.com/users/Steven-Pingel/following{/other_user}","gists_url":"https://api.github.com/users/Steven-Pingel/gists{/gist_id}","starred_url":"https://api.github.com/users/Steven-Pingel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Steven-Pingel/subscriptions","organizations_url":"https://api.github.com/users/Steven-Pingel/orgs","repos_url":"https://api.github.com/users/Steven-Pingel/repos","events_url":"https://api.github.com/users/Steven-Pingel/events{/privacy}","received_events_url":"https://api.github.com/users/Steven-Pingel/received_events","type":"User","site_admin":false},"repo":{"id":33342986,"name":"up-for-grabs.net","full_name":"Steven-Pingel/up-for-grabs.net","owner":{"login":"Steven-Pingel","id":5604387,"avatar_url":"https://avatars.githubusercontent.com/u/5604387?v=3","gravatar_id":"","url":"https://api.github.com/users/Steven-Pingel","html_url":"https://github.com/Steven-Pingel","followers_url":"https://api.github.com/users/Steven-Pingel/followers","following_url":"https://api.github.com/users/Steven-Pingel/following{/other_user}","gists_url":"https://api.github.com/users/Steven-Pingel/gists{/gist_id}","starred_url":"https://api.github.com/users/Steven-Pingel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Steven-Pingel/subscriptions","organizations_url":"https://api.github.com/users/Steven-Pingel/orgs","repos_url":"https://api.github.com/users/Steven-Pingel/repos","events_url":"https://api.github.com/users/Steven-Pingel/events{/privacy}","received_events_url":"https://api.github.com/users/Steven-Pingel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Steven-Pingel/up-for-grabs.net","description":"Jump in!","fork":true,"url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net","forks_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/forks","keys_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/teams","hooks_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/hooks","issue_events_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/issues/events{/number}","events_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/events","assignees_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/assignees{/user}","branches_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/branches{/branch}","tags_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/tags","blobs_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/git/refs{/sha}","trees_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/statuses/{sha}","languages_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/languages","stargazers_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/stargazers","contributors_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/contributors","subscribers_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/subscribers","subscription_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/subscription","commits_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/commits{/sha}","git_commits_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/git/commits{/sha}","comments_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/comments{/number}","issue_comment_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/issues/comments{/number}","contents_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/contents/{+path}","compare_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/merges","archive_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/downloads","issues_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/issues{/number}","pulls_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/pulls{/number}","milestones_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/milestones{/number}","notifications_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/labels{/name}","releases_url":"https://api.github.com/repos/Steven-Pingel/up-for-grabs.net/releases{/id}","created_at":"2015-04-03T02:48:13Z","updated_at":"2015-04-03T23:56:18Z","pushed_at":"2015-04-03T23:56:18Z","git_url":"git://github.com/Steven-Pingel/up-for-grabs.net.git","ssh_url":"git@github.com:Steven-Pingel/up-for-grabs.net.git","clone_url":"https://github.com/Steven-Pingel/up-for-grabs.net.git","svn_url":"https://github.com/Steven-Pingel/up-for-grabs.net","homepage":"http://up-for-grabs.net/","size":459,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"dahlbyk-demo:gh-pages","ref":"gh-pages","sha":"02b344f92708b2b84b4293030684e00b12537bbc","user":{"login":"dahlbyk-demo","id":1642179,"avatar_url":"https://avatars.githubusercontent.com/u/1642179?v=3","gravatar_id":"","url":"https://api.github.com/users/dahlbyk-demo","html_url":"https://github.com/dahlbyk-demo","followers_url":"https://api.github.com/users/dahlbyk-demo/followers","following_url":"https://api.github.com/users/dahlbyk-demo/following{/other_user}","gists_url":"https://api.github.com/users/dahlbyk-demo/gists{/gist_id}","starred_url":"https://api.github.com/users/dahlbyk-demo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dahlbyk-demo/subscriptions","organizations_url":"https://api.github.com/users/dahlbyk-demo/orgs","repos_url":"https://api.github.com/users/dahlbyk-demo/repos","events_url":"https://api.github.com/users/dahlbyk-demo/events{/privacy}","received_events_url":"https://api.github.com/users/dahlbyk-demo/received_events","type":"Organization","site_admin":false},"repo":{"id":14668611,"name":"up-for-grabs.net","full_name":"dahlbyk-demo/up-for-grabs.net","owner":{"login":"dahlbyk-demo","id":1642179,"avatar_url":"https://avatars.githubusercontent.com/u/1642179?v=3","gravatar_id":"","url":"https://api.github.com/users/dahlbyk-demo","html_url":"https://github.com/dahlbyk-demo","followers_url":"https://api.github.com/users/dahlbyk-demo/followers","following_url":"https://api.github.com/users/dahlbyk-demo/following{/other_user}","gists_url":"https://api.github.com/users/dahlbyk-demo/gists{/gist_id}","starred_url":"https://api.github.com/users/dahlbyk-demo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dahlbyk-demo/subscriptions","organizations_url":"https://api.github.com/users/dahlbyk-demo/orgs","repos_url":"https://api.github.com/users/dahlbyk-demo/repos","events_url":"https://api.github.com/users/dahlbyk-demo/events{/privacy}","received_events_url":"https://api.github.com/users/dahlbyk-demo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dahlbyk-demo/up-for-grabs.net","description":"Jump in!","fork":true,"url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net","forks_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/forks","keys_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/teams","hooks_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/hooks","issue_events_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues/events{/number}","events_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/events","assignees_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/assignees{/user}","branches_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/branches{/branch}","tags_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/tags","blobs_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/git/refs{/sha}","trees_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/statuses/{sha}","languages_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/languages","stargazers_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/stargazers","contributors_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/contributors","subscribers_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/subscribers","subscription_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/subscription","commits_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/commits{/sha}","git_commits_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/git/commits{/sha}","comments_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/comments{/number}","issue_comment_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues/comments{/number}","contents_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/contents/{+path}","compare_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/merges","archive_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/downloads","issues_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues{/number}","pulls_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls{/number}","milestones_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/milestones{/number}","notifications_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/labels{/name}","releases_url":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/releases{/id}","created_at":"2013-11-24T20:28:40Z","updated_at":"2015-02-22T04:35:55Z","pushed_at":"2015-05-16T09:58:49Z","git_url":"git://github.com/dahlbyk-demo/up-for-grabs.net.git","ssh_url":"git@github.com:dahlbyk-demo/up-for-grabs.net.git","clone_url":"https://github.com/dahlbyk-demo/up-for-grabs.net.git","svn_url":"https://github.com/dahlbyk-demo/up-for-grabs.net","homepage":"http://up-for-grabs.net/","size":602,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1"},"html":{"href":"https://github.com/dahlbyk-demo/up-for-grabs.net/pull/1"},"issue":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues/1"},"comments":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dahlbyk-demo/up-for-grabs.net/statuses/a2180493e93050854dfac13e89816706d1579025"}}}}