Tag: Github

Auto-Generated Github User Page With py-github

June 29, 2010 » Geek

Update (2010-06-30)

So I got antsy about this and I upgraded to using pystache instead of my homebrew templating system. This was my first run in with mustache, and I have to say I like it, even though I used the bare minimum feature set.

New code is at http://github.com/jmhobbs/jmhobbs.github.com

Github has a cool feature called “Github Pages” that let you host static content on a subdomain of github, e.g. http://jmhobbs.github.com/.

They also provide an auto-generator for project pages that has a nice clean format which I really like. So I decided to make my user page match the look and feel of the project pages. And to boot I wanted to be able have it auto-generate since I want it to be “hands free”, otherwise I’ll forget to update it.

To make this happen I whipped up my template and then grabbed the excellent py-github from Dustin Sallings, which I have used before.

Without furthur ado I’ll just show you the source. It’s not complicated, just some API calls then search replace on a template file. If you want to use it, be sure to get the most recent version from http://github.com/jmhobbs/jmhobbs.github.com.

Throw in a cron job and you are set. Beware of lot’s of “page build” notices from Github though.

except AttributeError:
repo_string = repo_string + ‘


repo_string = repo_string + “


template = template.replace( ‘<% repos %>‘, repo_string )

ga = “””


if False != settings[‘google_analytics’]:
template = template.replace( ‘<% google_analytics %>‘, ga )
template = template.replace( ‘<% ga_code %>‘, settings[‘google_analytics’] )
template = template.replace( ‘<% google_analytics %>‘, ” )

print “Writing file…”
f = open( ‘index.html’, ‘w’ )
f.write( template )

print “Done!”

if __name__ == “__main__”:

Wow. You actually scrolled through all of that. Amazing.

I was featured on Github! Sort of.

February 12, 2010 » Geek, Life

So I logged onto my twitter account this morning to find a message from @changelogshow telling me they had written an article about my fork of Storytlr.

That’s was pretty cool on it’s own, until I realized that The Changelog is the source of featured repo’s on Explore GitHub.

Awesome! I love github. There is so much amazing software on there, and I was lucky enough to have my repo featured!

I didn’t even develop the software, it’s a fork of the Storytlr core written by @eschnou & @alardw (and a fine piece of software at that). I just wrote some plugins and fixed the stuff that was broken for me.

Even so, it felt great to be on there! This is one of the first times anyone has ever made it clear that what I was doing in the open source world was seen and dare I say it appreciated. Unspeakably cool.

Look! That’s me!