Created
September 26, 2015 22:42
-
-
Save buie/f95e982f2d4aef4ebac8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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