From 3275a2ac9688bf12bac0ac29b4977c52c3079dfc Mon Sep 17 00:00:00 2001 From: Eric Romano Date: Tue, 23 Apr 2013 15:28:50 -0400 Subject: [PATCH] gitfiti --- gitfiti.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ gitfiti_web.py | 15 +++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 gitfiti.py create mode 100644 gitfiti_web.py diff --git a/gitfiti.py b/gitfiti.py new file mode 100644 index 000000000..9993d0c50 --- /dev/null +++ b/gitfiti.py @@ -0,0 +1,61 @@ +#gitfiti +import os, sys +try: + import requests +except: + print 'the requests module is required' + exit(1) + +BASEURL='https://github.com/' +color_commit_values=[0,1,2,3,4] + + +def get_calendar(username): + """retrieves the github commit calendar data for a username""" + url = BASEURL + 'users/' + username + '/contributions_calendar_data' + req = requests.get(url) + return req.json() + +def trim_calendar(input): + """remote the first 6 days to align data with sundays""" + trim=input[6:] + return trim + +def squash_calendar(input): + """group days into weeks for formatting""" + c=[] + input.pop + return c + +#find date range for N weeks +#each column starts on SUNDAY + +#generate a value insertion plan for a 7xN matrix + +#github new repo in account + +#git init new repo +# git add gitfiti_output + +# start of file: +# git commit -date $(date in the past) gitfiti_output + +# for day in matrix: +# for value in day: +# add a character to gitfiti file +# git commit -m -date $date_value gitfiti_output "g" + +#git add remote (get github url) +#git push -f master + +#profit! + +test=[ +[4,3,2,1,0], +[3,2,1,0,4], +[2,1,0,4,3], +[1,0,4,3,2], +[0,4,3,2,1] +] + +#GIT_AUTHOR_DATE='your date' GIT_COMMITTER_DATE='your date' git commit -m 'new (old) files' diff --git a/gitfiti_web.py b/gitfiti_web.py new file mode 100644 index 000000000..00ce420bd --- /dev/null +++ b/gitfiti_web.py @@ -0,0 +1,15 @@ +#!/bin/env python +#gitfiti_web +from bottle import request, route, run, post, template + +@route("/") +def index(): + return template('index') + +@route() + +def main(): + run(host='localhost', port=8080, debug=True, reloader=True) + +if __name__ == '__main__': + main() \ No newline at end of file