Skip to content

Instantly share code, notes, and snippets.

@buie
Created September 26, 2015 22:42
Show Gist options
  • Save buie/f95e982f2d4aef4ebac8 to your computer and use it in GitHub Desktop.
Save buie/f95e982f2d4aef4ebac8 to your computer and use it in GitHub Desktop.
from StringIO import StringIO
import pycurl
username = 'buie'
url = 'https://github.com/users/' + username + '/contributions'
storage = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, url)
c.setopt(c.WRITEFUNCTION, storage.write)
c.perform()
c.close()
content = storage.getvalue()
#print content
file = open("graphout", "w+")
file.write(content)
with open("/Library/WebServer/Documents/andrewjbuie/images/graph", "w+") as fout:
with open("graphout", "rt") as fin:
for line in fin:
if "text" not in line:
fout.write(line.replace('#eeeeee', '#808080'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment