MintbeanHackathons / MintbeanPlatform

This is what powers https://mintbean.io
GNU Affero General Public License v3.0
24 stars 15 forks source link

Github Integration - Github Calendar #21

Open monarchwadia opened 4 years ago

monarchwadia commented 4 years ago

Pull data for a user based on Github ID, and construct a Github Calendar + Contributions list (as seen on Github)

leanjunio commented 4 years ago

Is it possible to use something like this? https://github.com/Bloggify/github-calendar

drydenje commented 4 years ago

I've been experimenting a little with this one.

While that component would work, the other option would be to make a graphql call to github and pull other information we might need in one call

user(login: "monarchwadia") {
    contributionsCollection {
      contributionCalendar {
        totalContributions
        weeks {
          contributionDays {
            contributionCount
            weekday
            date
          }
        }
      }
    }
  }

will return

  "data": {
    "user": {
      "contributionsCollection": {
        "contributionCalendar": {
          "totalContributions": 884,
          "weeks": [
            {
              "contributionDays": [
                {
                  "contributionCount": 0,
                  "weekday": 0,
                  "date": "2019-05-05T00:00:00.000+00:00"
                },
                {
                  "contributionCount": 5,
                  "weekday": 1,
                  "date": "2019-05-06T00:00:00.000+00:00"
                },
...etc

we could then use vue-calendar-heatmap (just one i've gotten to work quickly) to display the calendar.

Just some thoughts..