Skip to content

Instantly share code, notes, and snippets.

@sigmavirus24
Created November 26, 2012 19:53
Show Gist options
  • Save sigmavirus24/4150241 to your computer and use it in GitHub Desktop.
Save sigmavirus24/4150241 to your computer and use it in GitHub Desktop.
zen collection
from github3 import login, GitHubError
import os
import time
def collect_zen(sleep_time):
g = login(os.environ.get('GHUSER'), os.environ.get('GHPASS'))
zen_cache = set()
while g.ratelimit_remaining > 1:
try:
zen_cache.add(g.zen())
except GitHubError:
break
time.sleep(sleep_time)
return zen_cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment