Skip to content

Instantly share code, notes, and snippets.

@slowkow
Created April 2, 2014 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slowkow/9927574 to your computer and use it in GitHub Desktop.
Save slowkow/9927574 to your computer and use it in GitHub Desktop.
Print an HTML list of your gists
#!/usr/bin/env python
"""
gists.py
Kamil Slowikowski
April 1, 2014
Print an HTML list of your gists:
./gists.py
<li>2014-03-31T04:07:18Z <a href="https://gist.github.com/9885070">1000 Genomes SNP allele frequencies in different populations</a></li>
<li>2014-02-16T22:30:18Z <a href="https://gist.github.com/9041570">Create a Q-Q plot with ggplot2</a></li>
<li>2014-02-05T22:11:06Z <a href="https://gist.github.com/8834315">Open scientific articles with Foxit, other pdfs with evince</a></li>
<li>2014-02-05T04:11:00Z <a href="https://gist.github.com/8817295">Play with HapMap SNP genotype data</a></li>
"""
import json
import requests
req = requests.get("https://api.github.com/users/slowkow/gists")
gists = json.loads(req.text)
form = '<li>{created_at} <a href="{html_url}">{description}</a></li>'
print '\n'.join(form.format(**g) for g in gists)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment