Skip to content

Instantly share code, notes, and snippets.

@ialexi
Created December 4, 2009 20:32
Show Gist options
  • Select an option

  • Save ialexi/249339 to your computer and use it in GitHub Desktop.

Select an option

Save ialexi/249339 to your computer and use it in GitHub Desktop.
import urllib, urllib2
HOST = "localhost"
PORT = 8003
class CorneliusError: pass
def update(path, message):
global HOST, PORT
result = urllib2.urlopen("http://" + HOST + ":" + str(PORT) + "/" + urllib.quote(path + ";" + message))
res = result.read()
if res == "{sent:true}":
return True
else:
raise CorneliusError()
def connect(uid, toWhat):
return update("::connect", uid + "->" + toWhat)
def disconnect(uid, fromWhat):
return update("::disconnect", uid + "->" + fromWhat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment