I’m trying to write a simple webapp that’ll check the JSON feed of my Github profile and simply let me know if I submitted any commits on a daily basis. I remember seeing something like it before but I can’t find it now, so I’d like to recreate it instead.
I have pretty limited knowledge of JSON: I know that my feed shows the date for each commit, so I suppose I need to write some sort of if conditional to check the current date against any commits in the JSON feed, correct?
Also, does anyone have any recommendations for what kind of language would be best for this? Is Javascript too simple? Rails too much? Thanks.
You can leverage the Events API from GitHub to do this.
The following url displays the list of events you’ve triggered.
If you’re willing to only list your commit activity, you would have to filter the events in order to only deal with the PushEvent.
Some may argue that a
Gistis also a Git repository and that creating/updating a Gist is similar to performing a Commit. In that case, make sure to also consider the GistEvent.I’ve wrapped a little sample for you based on your GitHub profile showing your commit log for the last seven days.
You can see a live demo here.
Note: In order to ease the manipulation of dates, the code leverages the moment.js JavaScript library