19 lines
409 B
Python
19 lines
409 B
Python
#
|
|
# Copyright 2015 (c) Anna Schumaker
|
|
#
|
|
import json
|
|
from urllib import parse
|
|
from urllib import request
|
|
|
|
__SLACK_SERVER = "https://slack.com/api"
|
|
|
|
def call(method, **kwargs):
|
|
args = parse.urlencode(kwargs)
|
|
with request.urlopen("%s/%s?%s" % (__SLACK_SERVER, method, args)) as req:
|
|
return json.loads(req.read().decode())
|
|
return {"ok" : False}
|
|
|
|
|
|
def test():
|
|
return call("api.test")["ok"]
|