added basic applications command
This commit is contained in:
parent
d6132776df
commit
ad04225586
17
gotipy.py
17
gotipy.py
@ -1,5 +1,6 @@
|
||||
import requests
|
||||
import json
|
||||
from pprint import pprint
|
||||
|
||||
class gotipy(object):
|
||||
def __init__(self, token, url):
|
||||
@ -11,14 +12,22 @@ class gotipy(object):
|
||||
self.title = title
|
||||
self.message = message
|
||||
self.requrl = self.url + '/message'
|
||||
print(self.requrl)
|
||||
|
||||
#define a new dict for the message
|
||||
data = {}
|
||||
data["message"] = self.message
|
||||
data["title"] = self.title
|
||||
jdata = json.dumps(data)
|
||||
|
||||
print(jdata)
|
||||
req = requests.post(self.requrl, headers=self.headers, json=data)
|
||||
print(req.text)
|
||||
try:
|
||||
return req.json()['error']
|
||||
except:
|
||||
return "Message Sent :)"
|
||||
def getApplications(self):
|
||||
self.requrl = self.url + '/application'
|
||||
|
||||
req = requests.get(self.requrl, headers=self.headers)
|
||||
try:
|
||||
return req.json()['error']
|
||||
except:
|
||||
return req.json()
|
||||
|
||||
BIN
gotipy.pyc
BIN
gotipy.pyc
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user