Skip to content

Instantly share code, notes, and snippets.

@aivuk
Created January 28, 2015 03:36
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 aivuk/172124337771ef48c610 to your computer and use it in GitHub Desktop.
Save aivuk/172124337771ef48c610 to your computer and use it in GitHub Desktop.
Create issues in Github from file
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