I am making a very simple chrome extension that displays the number of contributions you did today on GitHub. How can i get that number?
You could use Github GraphQL API to request contributionsCollection with a date range :
query {
viewer {
contributionsCollection(from:"2020-05-05T00:00:00Z", to:"2020-05-05T00:00:00Z") {
contributionCalendar{
totalContributions
}
}
}
}
For a specific user:
query {
user(login:"krissemicolon") {
contributionsCollection(from:"2020-06-01T00:00:00Z", to:"2020-06-01T00:00:00Z") {
contributionCalendar{
totalContributions
}
}
}
}
If using graphql API is not an option you could also parse the calendar svg, checkout this