Tilde Friends
|
Making apps for the impatient tilde friend.
ssb
app to create yourself an SSB identityedit
link from any app or new app URL/~username/app/
app.js
save
button or press the save hotkey (Alt+S or [browser-specific modifiers]+S)app.setDocument(html)
- send HTML to the browserprint(...)
- send values to the browser's developer consoleapp.localStorageGet(key)
-> value
app.localStorageSet(key, value)
database()
, shared_database(key)
, my_shared_database(package, key)
db.get(key)
-> value
db.set(key, value)
db.exchange(key, expected, value)
-> exchanged
db.remove(key)
db.getAll()
-> [key1, ...]
db.getLike(pattern)
-> {key1: value1, ...}
ssb.createIdentity()
-> id
ssb.getIdentities()
-> [id1, ...]
ssb.appendMessageWithIdentity(id, content)
-> message_id
ssb.blobStore(blob)
-> blob_id
ssb.blobGet(id)
-> blob
ssb.sqlAsync(query, args, row_callback)
Stock helper code for calling functions across the web server and browser boundary.
import * as tfrpc from "/tfrpc.js";
import * as tfrpc from "/static/tfrpc.js";
tfrpc.register(function my_function() {});
let promise = tfrpc.rpc.my_function();
Attach App
button when composing a post in the SSB app