Created
January 28, 2013 01:09
-
-
Save askedrelic/4651896 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
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