Skip to content

Commit

Permalink
Add client_token
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiiwoong committed Aug 4, 2020
1 parent 7e9686a commit 5853a72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion parsecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from urllib.request import urlopen
from urllib import parse


client_token = 'token 517d413e9c97d986ad0839084d9a2d2cf2dbd0f9'
headers = {'Authorization': client_token}
login = requests.get('https://api.github.com/repos/prometheus/docs', headers=headers)

def parseGiturl(githubUrl):
url = parse.urlparse(githubUrl)
Expand Down
11 changes: 7 additions & 4 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

def write_repo():

exporterContent = parsecontent.getContent(
'https://github.com/NexClipper/NexClipper')
exporterReadme = parsecontent.getReadme(
'https://github.com/NexClipper/NexClipper')
client_token = 'token 517d413e9c97d986ad0839084d9a2d2cf2dbd0f9'
headers = {'Authorization': client_token}
login = requests.get('https://api.github.com/repos/prometheus/docs', headers=headers)
# print(login.json())

exporterContent = parsecontent.getContent('https://github.com/NexClipper/NexClipper')
exporterReadme = parsecontent.getReadme('https://github.com/NexClipper/NexClipper')

print(exporterContent.get('fork'))
print(exporterReadme.get('type'))
Expand Down

0 comments on commit 5853a72

Please sign in to comment.