Library for connecting to a running Urbit ship
Project description
from urlock import urlock.Urlock
import baseconvert
import time
import random
import dumper
zod = Urlock("http://localhost:8080", "lidlut-tabwed-pillex-ridrup")
r = zod.connect()
s = zod.subscribe("zod", "chat-store", "/mailbox/~/~zod/mc")
pipe = zod.sse_pipe()
s = baseconvert.base(random.getrandbits(128), 10, 32, string=True).lower()
uid = '0v' + '.'.join(s[i:i+5] for i in range(0, len(s), 5))[::-1]
p = zod.poke("zod", "chat-hook", "json", {"message": {"path": "/~/~zod/mc",
"envelope": {"uid": uid,
"number": 1,
"author": "~zod",
"when": int(time.time() * 1000),
"letter": {"text": "this shit is new"}}}})
for m in pipe.events():
dumper.dump(m)
0.1 2020-06-01
- Initial publication
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
urlock-0.1.1.tar.gz
(1.6 kB
view hashes)
Built Distribution
urlock-0.1.1-py3-none-any.whl
(2.4 kB
view hashes)