Skip to content

Instantly share code, notes, and snippets.

@ecounysis
Created July 20, 2011 17:15
Show Gist options
  • Save ecounysis/1095388 to your computer and use it in GitHub Desktop.
Save ecounysis/1095388 to your computer and use it in GitHub Desktop.
A Gist for Displaying Gists
import cgi
print "Content-Type: text/html"
print
form = cgi.FieldStorage()
if 'g' not in form:
out = ""
else:
gist_no = form['g'].value
if 'w' not in form:
out = "<script type='text/javascript' src='https://gist.github.com/" + gist_no + ".js'></script>"
else:
w = form['w'].value
h = "500"
if 'h' in form:
h = form['h'].value
out = "<iframe width='" + w + "' height='" + h + "' src='gist.py?g=" + gist_no + "'></iframe>"
print out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment