Created
January 28, 2015 03:36
-
-
Save aivuk/172124337771ef48c610 to your computer and use it in GitHub Desktop.
Create issues in Github from file
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
from subprocess import Popen | |
from json import dumps | |
import codecs | |
issue_info = {} | |
issue_info['milestone'] = 1 | |
cmd = ["curl", | |
"-i", | |
"-X", | |
"POST", | |
"-d", | |
None, # Get from file | |
"https://api.github.com/repos/okfn-brasil/gastos_abertos/issues?access_token=SECRET_TOKEN"] | |
issues = codecs.open('lissues', 'r', 'utf8').readlines() | |
for issue in issues: | |
issue_info['title'] = issue.capitalize() | |
cmd[5] = dumps(issue_info, ensure_ascii=False, encoding='utf8') | |
p = Popen(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment