/urbit-api.el

Urbit API for emacs in elisp.

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

Urbit HTTP elisp API

Connect your operating system with your personal server.

https://img.shields.io/badge/~-awesome%20urbit-lightgrey.svg

Install

Get aio and request then use M-x package-install-file to install a tarball, or just clone the repo into your load path.

Example

Urbit-http

All of the user facing functions use aio and return promises.

(require 'urbit)
(require 'urbit-http)
(require 'aio)

;; Connect to a ~zod running locally
(aio-wait-for
 (urbit-launch "http://localhost:8080" "lidlut-tabwed-pillex-ridrup"))

;; Send a poke
(urbit-http-poke "hood" "helm-hi" "Hello, world!"
            (lambda () (message "Poke succeeded."))
            (lambda () (message "Poke failed.")))

;; Subscribe to an app
(urbit-http-subscribe "graph-store" "/updates"
                 (lambda (event) (message "Graph update recieved %s" event)))