Skip to content

Instantly share code, notes, and snippets.

@askedrelic
Created January 28, 2013 01:09
Show Gist options
  • Save askedrelic/4651896 to your computer and use it in GitHub Desktop.
Save askedrelic/4651896 to your computer and use it in GitHub Desktop.
import requests
import base64
# requires pygithub library
from github import Github
g = Github(username, password)
repo_readmes = {}
for repo_name in uniq_popular_repos:
repo = g.get_repo('{0}/{1}'.format(repo_name[0],repo_name[1]))
try:
readme = repo.get_readme()
repo_readmes[repo_name] = readme
except:
repo_readmes[repo_name] = 404
#then something like to find H1 headers
[(x[0], re.findall('#.*', base64.decodestring(x[1].content))) for x in repo_readmes.iteritems() if x[1] != 404]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment