Skip to content

Instantly share code, notes, and snippets.

@punchagan
Created August 15, 2013 12:59
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 punchagan/6240635 to your computer and use it in GitHub Desktop.
Save punchagan/6240635 to your computer and use it in GitHub Desktop.
Simple Issue fetching from GitHub
import github
import codecs
from getpass import getpass
passwd = getpass()
gh = github.Github('punchagan', passwd)
o2b = gh.get_repo('punchagan/org2blog')
open_issues = list(o2b.get_issues(state='open'))
closed_issues =list(o2b.get_issues(state='closed'))
all_issues = sorted(open_issues + closed_issues, key=lambda x: x.number)
with codecs.open('foo.org', 'w', 'utf8') as f:
for issue in all_issues:
f.write('* %s #%s %s\n\n' % (issue.state.upper(), issue.number, issue.title))
f.write(' %s\n\n' % issue.html_url)
#f.write(' %s\n\n\n' % issue.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment