Created
July 9, 2019 21:52
-
-
Save e18r/a573e794b22fbc6b3f784710df6f8edf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#! /usr/bin/env python | |
# Only use with a test Github account | |
# To install: pip install PyGithub | |
from github import Github | |
from sys import argv | |
user = 'e18rtest' # GitHub username | |
pw = 'dVmaNfBsPCSdaVjI' # password | |
repo_index = 0 # GitHub repository number sorted by creation date | |
def login(): | |
print('logging in... ', end='') | |
g = Github(user, pw) | |
repo = g.get_user().get_repos()[repo_index] | |
print('y') | |
return repo | |
def create(start, end): | |
repo = login() | |
for i in range(start, end + 1): | |
print('{} / {}... '.format(i, end), end='') | |
try: | |
repo.create_issue('bulk issue # {}'.format(i)) | |
print('y') | |
except: | |
print('n') | |
repo = login() | |
print('retrying {}... '.format(i), end='') | |
repo.create_issue('bulk issue # {}'.format(i)) | |
print('y') | |
# start issue number, end issue number (inclusive) | |
create(int(argv[1]), int(argv[2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment