[modules/github] Use header for token

Doesnt allow sniffers to get the access token from url.
Closes #104
This commit is contained in:
ibrokemypie 2017-06-05 09:44:07 +10:00
parent 0bfb725ae0
commit ae536ee70d
No known key found for this signature in database
GPG key ID: 972E990922570890

View file

@ -44,7 +44,7 @@ class Module(bumblebee.engine.Module):
self._count = 0 self._count = 0
return return
notifications = requests.get("https://api.github.com/notifications?access_token={}".format(token)).text notifications = requests.get("https://api.github.com/notifications", headers={"Authorization":"token "+format(token)}).text
unread = 0 unread = 0
for notification in json.loads(notifications): for notification in json.loads(notifications):
if "unread" in notification and notification["unread"] == True: if "unread" in notification and notification["unread"] == True: