Created
August 15, 2013 12:59
-
-
Save punchagan/6240635 to your computer and use it in GitHub Desktop.
Simple Issue fetching from GitHub
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 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