Skip to content

Instantly share code, notes, and snippets.

@nrb
Last active August 29, 2015 14:24
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 nrb/d6d2332af467a18bbafb to your computer and use it in GitHub Desktop.
Save nrb/d6d2332af467a18bbafb to your computer and use it in GitHub Desktop.
import github3
try:
prompt = raw_input
except NameError:
prompt = input
def my_two_factor_function():
code = ''
while not code:
# The user could accidentally press Enter before being ready,
# let's protect them from doing that.
code = prompt('Enter 2FA code: ')
return code
g = github3.login('nrb', 'nope', two_factor_callback=my_two_factor_function)
results = g.search_issues('milestone:"kilo 11.0.0" is:closed is:issue repo:rcbops/rpc-openstack')
for result in results:
issue = result.issue
title = issue.title
url = issue.url
print('<a href="%s">%s</a>' % (url, title))
print(results.total_count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment