curl - Getting starred_at from GitHub API call to stargazers -
the github api docs say creation timestamps can collected well:
you can find out when stars created passing following custom content-type via
acceptheader.
when so, don't starred_at stamp:
url --header "accept: application/vnd.github.v3.star+json" -i https://api.github.com/repos/basho-labs/puppet-riak/stargazers http/1.1 200 ok server: github.com date: tue, 31 mar 2015 18:59:31 gmt content-type: application/json; charset=utf-8 content-length: 29317 status: 200 ok x-ratelimit-limit: 60 x-ratelimit-remaining: 53 x-ratelimit-reset: 1427831425 cache-control: public, max-age=60, s-maxage=60 etag: "5fac5a4065248d5bf7aa87361239ca51" vary: accept x-github-media-type: github.v3; param=star; format=json link: <https://api.github.com/repositories/5506317/stargazers?page=2>; rel="next", <https://api.github.com/repositories/5506317/stargazers?page=2>; rel="last" x-xss-protection: 1; mode=block x-frame-options: deny content-security-policy: default-src 'none' access-control-allow-credentials: true access-control-expose-headers: etag, link, x-github-otp, x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, x-oauth-scopes, x-accepted-oauth-scopes, x-poll-interval access-control-allow-origin: * x-github-request-id: 4926f860:5d3f:23a8cba:551aee93 strict-transport-security: max-age=31536000; includesubdomains; preload x-content-type-options: nosniff vary: accept-encoding x-served-by: a241e1a8264a6ace03db946c85b92db3 [ { "login": "seancribbs", "id": 1772, "avatar_url": "https://avatars.githubusercontent.com/u/1772?v=3", "gravatar_id": "", "url": "https://api.github.com/users/seancribbs", "html_url": "https://github.com/seancribbs", "followers_url": "https://api.github.com/users/seancribbs/followers", "following_url": "https://api.github.com/users/seancribbs/following{/other_user}", "gists_url": "https://api.github.com/users/seancribbs/gists{/gist_id}", "starred_url": "https://api.github.com/users/seancribbs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/seancribbs/subscriptions", "organizations_url": "https://api.github.com/users/seancribbs/orgs", "repos_url": "https://api.github.com/users/seancribbs/repos", "events_url": "https://api.github.com/users/seancribbs/events{/privacy}", "received_events_url": "https://api.github.com/users/seancribbs/received_events", "type": "user", "site_admin": false }, ... , on.
is syntax off?
that statement made in documentation list repositories being starred api endpoint, gets starred repositories given user (get /users/:username/starred), not list stargazers endpoint (get /repos/:owner/:repo/stargazers), shows users have starred particular repository:
list repositories being starred star creation timestamps
you can find out when stars created passing following custom content-type via accept header.
accept: application/vnd.github.v3.star+json
it works fine get /users/:username/starred:
curl --header "accept: application/vnd.github.v3.star+json" -i \ https://api.github.com/users/:user/starred http/1.1 200 ok server: github.com date: tue, 31 mar 2015 19:32:24 gmt content-type: application/json; charset=utf-8 status: 200 ok ... [ { "starred_at": "2015-02-13t18:33:22z", ... } ]
Comments
Post a Comment