SHARE
TWEET

Untitled

a guest Jul 21st, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /usr/bin/env python
  2.  
  3. # Only use with a test Github account
  4. # To install: pip install PyGithub
  5.  
  6. from github import Github
  7. from sys import argv
  8.  
  9. user = 'e18rtest' # GitHub username
  10. pw = 'dVmaNfBsPCSdaVjI' # password
  11. repo_index = 0 # GitHub repository number sorted by creation date
  12.  
  13. def login():
  14.     print('logging in... ', end='')
  15.     g = Github(user, pw)
  16.     repo = g.get_user().get_repos()[repo_index]
  17.     print('y')
  18.     return repo
  19.  
  20. def create(start, end):
  21.     repo = login()
  22.     for i in range(start, end + 1):
  23.         print('{} / {}... '.format(i, end), end='')
  24.         try:
  25.             repo.create_issue('bulk issue # {}'.format(i))
  26.             print('y')
  27.         except:
  28.             print('n')
  29.             repo = login()
  30.             print('retrying {}... '.format(i), end='')
  31.             repo.create_issue('bulk issue # {}'.format(i))
  32.             print('y')
  33.  
  34. # start issue number, end issue number (inclusive)
  35. create(int(argv[1]), int(argv[2]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top