diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-10-24 16:09:58 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-10-24 16:09:58 -0700 |
commit | 2eb2a964a50e0bccefabf12ddf689d42bf02432b (patch) | |
tree | eccb2ed293a0c10125dae86de7985a0ec59936dd | |
parent | bb5561f68d8cb4e1f739a2ea3cc36ccc5d3c4627 (diff) | |
download | wee-slack-2eb2a964a50e0bccefabf12ddf689d42bf02432b.tar.gz |
lots more changes - revert to using installed curl
-rw-r--r-- | wee_slack.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index cc07557..c7beb2c 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -806,6 +806,13 @@ def async_slack_api_request(domain, token, request, data): url = 'https://%s/api/%s' % (domain, request) queue.append(['url:%s' % (url), post, 20000, 'url_processor_cb', str(data)]) +#def async_slack_api_request(request, data): +# t = time.time() +# request += "?t=%s" % t +# data["token"] = slack_api_token +# data = urllib.urlencode(data) +# command = 'curl --data "%s" https://%s/api/%s' % (data,domain,request) +# w.hook_process(command, 5000, '', '') queue = [] url_processor_lock=False @@ -827,7 +834,9 @@ def async_queue_cb(data, remaining_calls): except: pass if item.__class__ == list: - w.hook_process_hashtable(*item) + #w.hook_process_hashtable(*item) + command = 'curl --data "%s" %s' % (item[1]["postfields"], item[0][4:]) + w.hook_process(command, 10000, item[3], item[4]) else: item.mark_read(False) url_processor_lock=False @@ -836,8 +845,8 @@ def async_queue_cb(data, remaining_calls): return w.WEECHAT_RC_OK def url_processor_cb(data, command, return_code, out, err): - url_processor_lock=False global url_processor_lock, big_data + url_processor_lock=False if return_code == 0: url_processor_lock=False identifier = sha.sha(str(data) + command).hexdigest() |