You are reading content from Scuttlebutt
@cel %JB7GoEW9QxuP6DDNPpMKA7oX23RWZVJty9VTANlZO7Q=.sha256

ssbget.c

Get a SSB message from scuttlebot's flumedb on your filesystem. Reads log.offset and keys.ht (flumeview-hashtable) from ~/.ssb/flume and ~/.ssb/ooo. It does not connect to scuttlebot RPC or do network operations.

Install

wget -qO ssbget.c 'http://localhost:8989/blobs/get/&BovbI2zpAJnrAwQvrb3GAkN9JzBSn6pPvwDO6w/I4ks=.sha256'
cc ssbget.c -o ssbget
mv ssbget ~/.local/bin/ # or somewhere

Usage

ssbget <msg_id>

Environmental variables ssb_path or ssb_appname may be used to specify a different base directory than ~/.ssb.

Example

$ ssbget %HsB1YeYB0SmURYjm4WMLMKjlyBVsU26VarolJ1VhTr8=.sha256
{"key":"%HsB1YeYB0SmURYjm4WMLMKjlyBVsU26VarolJ1VhTr8=.sha256","value":{"previous":"%HeAz/YiYTQR4ZLSZ8+6YxwR8z2kXNMEGiLQ/g6ilehQ=.sha256","author":"@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519","sequence":4145,"timestamp":1486932021493,"hash":"sha256","content":{"type":"lol"},"signature":"Sq3bFKK0sOuI+eXr2vXHbNB28a8NWnRLQoRcJOHhPD4O/DBN2U8Vbbqnauc3brJNG4V6W/Ti6B704X849CUnBw==.sig.ed25519"},"timestamp":1506393246000}

#flume #cli #sbot

@kas %GfluD6Gu99Ac3gqhfKK1C29j9Cvv95pdQczN4CvMsPg=.sha256

Nice. I like! :heart_eyes:

@Dominic %d4sj8pIFyTdwSPcEIDJCJ2P59ZMrn7UlqUjql5WZ5Zw=.sha256

@cel This looks great!

One comment though, I know c isn't really about camel case, but if do ssb_get it's easy to do a 1:1 map in both directions... I bet if things are consistent it will be easy to convert this into bindings, or something.

@Dominic %m3yFfETZn8JfvPnQcckD7doqaIqcKGi0rdbVy3GqbSE=.sha256

Aha, see you are doing an in-place read of json the json key - the "key" property, which conveniently happens to be the first key. I've also been wondering how fast reading json in place would be - not parsing into a data structure, just scanning past, validating, until you find the thing you were looking for.

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
Join Scuttlebutt now