Skip to content

Instantly share code, notes, and snippets.

@pengwynn
Created August 28, 2013 13:56
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 pengwynn/6366324 to your computer and use it in GitHub Desktop.
Save pengwynn/6366324 to your computer and use it in GitHub Desktop.
ETags and GitHub API paging
curl -i https://api.github.com/users/pengwynn/starred\?per_page\=1
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 28 Aug 2013 13:52:09 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 53
X-RateLimit-Reset: 1377700904
Cache-Control: public, max-age=60, s-maxage=60
Last-Modified: Wed, 28 Aug 2013 13:48:19 GMT
ETag: "d8bc8195c7b6cf52f49f20e1cfd473dc"
Vary: Accept
X-GitHub-Media-Type: github.beta
Link: <https://api.github.com/user/865/starred?per_page=1&page=2>; rel="next", <https://api.github.com/user/865/starred?per_page=1&page=575>; rel="last"
X-Content-Type-Options: nosniff
Content-Length: 4960
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: c8bbc48b-6489-4af5-92fa-ad37a0e34e71
Vary: Accept-Encoding
[
{
"id": 12335495,
"name": "feedbin",
"full_name": "feedbin/feedbin",
"owner": {
"login": "feedbin",
"id": 2721081,
"avatar_url": "https://0.gravatar.com/avatar/97a1d991d59ca4d3493746c860a89ee5?d=https%3A%2F%2Fidenticons.github.com%2F4e9e168a2a2f63176338bd52d04bc0a7.png",
"gravatar_id": "97a1d991d59ca4d3493746c860a89ee5",
"url": "https://api.github.com/users/feedbin",
"html_url": "https://github.com/feedbin",
"followers_url": "https://api.github.com/users/feedbin/followers",
"following_url": "https://api.github.com/users/feedbin/following{/other_user}",
"gists_url": "https://api.github.com/users/feedbin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/feedbin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/feedbin/subscriptions",
"organizations_url": "https://api.github.com/users/feedbin/orgs",
"repos_url": "https://api.github.com/users/feedbin/repos",
"events_url": "https://api.github.com/users/feedbin/events{/privacy}",
"received_events_url": "https://api.github.com/users/feedbin/received_events",
"type": "Organization"
},
"private": false,
"html_url": "https://github.com/feedbin/feedbin",
"description": "RSS Reader",
"fork": false,
"url": "https://api.github.com/repos/feedbin/feedbin",
"forks_url": "https://api.github.com/repos/feedbin/feedbin/forks",
"keys_url": "https://api.github.com/repos/feedbin/feedbin/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/feedbin/feedbin/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/feedbin/feedbin/teams",
"hooks_url": "https://api.github.com/repos/feedbin/feedbin/hooks",
"issue_events_url": "https://api.github.com/repos/feedbin/feedbin/issues/events{/number}",
"events_url": "https://api.github.com/repos/feedbin/feedbin/events",
"assignees_url": "https://api.github.com/repos/feedbin/feedbin/assignees{/user}",
"branches_url": "https://api.github.com/repos/feedbin/feedbin/branches{/branch}",
"tags_url": "https://api.github.com/repos/feedbin/feedbin/tags",
"blobs_url": "https://api.github.com/repos/feedbin/feedbin/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/feedbin/feedbin/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/feedbin/feedbin/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/feedbin/feedbin/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/feedbin/feedbin/statuses/{sha}",
"languages_url": "https://api.github.com/repos/feedbin/feedbin/languages",
"stargazers_url": "https://api.github.com/repos/feedbin/feedbin/stargazers",
"contributors_url": "https://api.github.com/repos/feedbin/feedbin/contributors",
"subscribers_url": "https://api.github.com/repos/feedbin/feedbin/subscribers",
"subscription_url": "https://api.github.com/repos/feedbin/feedbin/subscription",
"commits_url": "https://api.github.com/repos/feedbin/feedbin/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/feedbin/feedbin/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/feedbin/feedbin/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/feedbin/feedbin/issues/comments/{number}",
"contents_url": "https://api.github.com/repos/feedbin/feedbin/contents/{+path}",
"compare_url": "https://api.github.com/repos/feedbin/feedbin/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/feedbin/feedbin/merges",
"archive_url": "https://api.github.com/repos/feedbin/feedbin/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/feedbin/feedbin/downloads",
"issues_url": "https://api.github.com/repos/feedbin/feedbin/issues{/number}",
"pulls_url": "https://api.github.com/repos/feedbin/feedbin/pulls{/number}",
"milestones_url": "https://api.github.com/repos/feedbin/feedbin/milestones{/number}",
"notifications_url": "https://api.github.com/repos/feedbin/feedbin/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/feedbin/feedbin/labels{/name}",
"created_at": "2013-08-24T00:31:31Z",
"updated_at": "2013-08-28T13:48:19Z",
"pushed_at": "2013-08-28T13:20:05Z",
"git_url": "git://github.com/feedbin/feedbin.git",
"ssh_url": "git@github.com:feedbin/feedbin.git",
"clone_url": "https://github.com/feedbin/feedbin.git",
"svn_url": "https://github.com/feedbin/feedbin",
"homepage": "https://feedbin.me",
"size": 2503,
"watchers_count": 332,
"language": "Ruby",
"has_issues": true,
"has_downloads": true,
"has_wiki": true,
"forks_count": 18,
"mirror_url": null,
"open_issues_count": 1,
"forks": 18,
"open_issues": 1,
"watchers": 332,
"master_branch": "master",
"default_branch": "master"
}
]
curl -i https://api.github.com/users/pengwynn/starred\?per_page\=1 -H'If-None-Match: "d8bc8195c7b6cf52f49f20e1cfd473dc"'
HTTP/1.1 304 Not Modified
Server: GitHub.com
Date: Wed, 28 Aug 2013 13:53:08 GMT
Status: 304 Not Modified
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 53
X-RateLimit-Reset: 1377700904
Cache-Control: public, max-age=60, s-maxage=60
Last-Modified: Wed, 28 Aug 2013 13:48:19 GMT
ETag: "d8bc8195c7b6cf52f49f20e1cfd473dc"
X-Content-Type-Options: nosniff
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: 59f49349-e510-4129-a8c0-c537a8d84ab5
Vary: Accept-Encoding
# @pengwynn stars google/go-github offstage
curl -i https://api.github.com/users/pengwynn/starred\?per_page\=1 -H'If-None-Match: "d8bc8195c7b6cf52f49f20e1cfd473dc"'
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 28 Aug 2013 13:54:02 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 52
X-RateLimit-Reset: 1377700904
Cache-Control: public, max-age=60, s-maxage=60
Last-Modified: Wed, 28 Aug 2013 13:53:52 GMT
ETag: "932f5c9578067760d6fad804e872b1f1"
Vary: Accept
X-GitHub-Media-Type: github.beta
Link: <https://api.github.com/user/865/starred?per_page=1&page=2>; rel="next", <https://api.github.com/user/865/starred?per_page=1&page=576>; rel="last"
X-Content-Type-Options: nosniff
Content-Length: 5053
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: 41b2c7c5-b3a4-456c-9f67-bb51e47b88bd
Vary: Accept-Encoding
[
{
"id": 10270722,
"name": "go-github",
"full_name": "google/go-github",
"owner": {
"login": "google",
"id": 1342004,
"avatar_url": "https://2.gravatar.com/avatar/24ba30616d2a20673f54c2aee36d159e?d=https%3A%2F%2Fidenticons.github.com%2Ffaac4cb508e248b07982aabe19e96059.png",
"gravatar_id": "24ba30616d2a20673f54c2aee36d159e",
"url": "https://api.github.com/users/google",
"html_url": "https://github.com/google",
"followers_url": "https://api.github.com/users/google/followers",
"following_url": "https://api.github.com/users/google/following{/other_user}",
"gists_url": "https://api.github.com/users/google/gists{/gist_id}",
"starred_url": "https://api.github.com/users/google/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/google/subscriptions",
"organizations_url": "https://api.github.com/users/google/orgs",
"repos_url": "https://api.github.com/users/google/repos",
"events_url": "https://api.github.com/users/google/events{/privacy}",
"received_events_url": "https://api.github.com/users/google/received_events",
"type": "Organization"
},
"private": false,
"html_url": "https://github.com/google/go-github",
"description": "Go library for accessing the GitHub API",
"fork": false,
"url": "https://api.github.com/repos/google/go-github",
"forks_url": "https://api.github.com/repos/google/go-github/forks",
"keys_url": "https://api.github.com/repos/google/go-github/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/google/go-github/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/google/go-github/teams",
"hooks_url": "https://api.github.com/repos/google/go-github/hooks",
"issue_events_url": "https://api.github.com/repos/google/go-github/issues/events{/number}",
"events_url": "https://api.github.com/repos/google/go-github/events",
"assignees_url": "https://api.github.com/repos/google/go-github/assignees{/user}",
"branches_url": "https://api.github.com/repos/google/go-github/branches{/branch}",
"tags_url": "https://api.github.com/repos/google/go-github/tags",
"blobs_url": "https://api.github.com/repos/google/go-github/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/google/go-github/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/google/go-github/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/google/go-github/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/google/go-github/statuses/{sha}",
"languages_url": "https://api.github.com/repos/google/go-github/languages",
"stargazers_url": "https://api.github.com/repos/google/go-github/stargazers",
"contributors_url": "https://api.github.com/repos/google/go-github/contributors",
"subscribers_url": "https://api.github.com/repos/google/go-github/subscribers",
"subscription_url": "https://api.github.com/repos/google/go-github/subscription",
"commits_url": "https://api.github.com/repos/google/go-github/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/google/go-github/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/google/go-github/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/google/go-github/issues/comments/{number}",
"contents_url": "https://api.github.com/repos/google/go-github/contents/{+path}",
"compare_url": "https://api.github.com/repos/google/go-github/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/google/go-github/merges",
"archive_url": "https://api.github.com/repos/google/go-github/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/google/go-github/downloads",
"issues_url": "https://api.github.com/repos/google/go-github/issues{/number}",
"pulls_url": "https://api.github.com/repos/google/go-github/pulls{/number}",
"milestones_url": "https://api.github.com/repos/google/go-github/milestones{/number}",
"notifications_url": "https://api.github.com/repos/google/go-github/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/google/go-github/labels{/name}",
"created_at": "2013-05-24T16:42:58Z",
"updated_at": "2013-08-28T13:53:52Z",
"pushed_at": "2013-08-23T14:46:10Z",
"git_url": "git://github.com/google/go-github.git",
"ssh_url": "git@github.com:google/go-github.git",
"clone_url": "https://github.com/google/go-github.git",
"svn_url": "https://github.com/google/go-github",
"homepage": "http://godoc.org/github.com/google/go-github/github",
"size": 569,
"watchers_count": 181,
"language": "Go",
"has_issues": true,
"has_downloads": true,
"has_wiki": false,
"forks_count": 35,
"mirror_url": null,
"open_issues_count": 12,
"forks": 35,
"open_issues": 12,
"watchers": 181,
"master_branch": "master",
"default_branch": "master"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment