Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API - stars, get the date then star is created

Tags:

github-api

The GitHub API provides functionality to get stared items sorted by created date. But, I can't find a possibility to get this date.

Only three date-type fields are present in the response:

created_at: '2013-06-13T21:10:36Z',
updated_at: '2013-06-18T07:45:56Z',
pushed_at: '2013-06-17T16:52:44Z',

create_at here is always that date the repository created, not star. updated_at does not give the right information either.

On the GitHub site, if you check your stars, data is sorted properly and the correct time span is rendered. But it looks like the API misses that information.

That gist clearly show, that data returned "sorted", but created_at is wrong.

like image 673
Alexander Beletsky Avatar asked Jun 24 '13 14:06

Alexander Beletsky


People also ask

What happens when you star in GitHub?

About stars You can star repositories and topics to discover similar projects on GitHub. When you star repositories or topics, GitHub may recommend related content on your personal dashboard. For more information, see "Finding ways to contribute to open source on GitHub" and "About your personal dashboard."

Do GitHub stars mean anything?

Particularly, GitHub users can star a repository, presumably to manifest interest or satisfaction with an open source project. However, the real and practical meaning of starring a project was never the subject of an in- depth and well-founded empirical investigation.

What happens when you star a repository?

When you star a project you can keep track of it, but you won't be notified of every change. Think of starring a project on GitHub as a more casual way of watching, the equivalent of bookmarking it for later. To make it easier to do that, every repo now has a star button next to the familiar watch button.


2 Answers

This can be done in the GitHub API v3 by adding the header:

Accept: application/vnd.github.v3.star+json

see here:

https://developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps-1

https://developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps

like image 197
timqian Avatar answered Oct 20 '22 17:10

timqian


There is absolutely no way to get this information from the API. Your best chance of getting it is going through events either on the repository or each user that has starred the repository and that could take tons of parsing because the events could be in the thousands. The number of API calls to do so would be immense.

like image 34
Ian Stapleton Cordasco Avatar answered Oct 20 '22 16:10

Ian Stapleton Cordasco