refactor to work with browserify as a static page
%9clsY0haPibJLTmBynItyCWjNxnveaBcTE0pEwjxJ18=.sha256
master
from browserify-static-page
refactor to work with browserify as a static page
this changes how the data is fetched from sbot, so that it's done all at once in a file called data.js
as a single asynchronous function. this way, we can use configurify
to pre-fetch the data as a browserify transform, so it's available to the browser without needing access to sbot. i kept the image urls the same, so they depend on a local sbot running (i'd like to make this configurable, but for now it's the same as the daily stats graph).
keep in mind, this means the graph only updates when it's re-browserified, so if anyone wants to host an active graph i recommend a daily cron job running the build script or something to keep it up to date. i'm interested down the road in how to use sbot directly in the browser, but for now this works. :)
/cc @ev
83bc901e
· 12/9/2016, 12:53:32 AM@dinosaur This is awesome!
ssb-ws
serves images to the public web.
See: https://evbogue.com/ws/blobs/get/&6/avNqHBq8nm9wnqx6dHXRoi4s5yuilh/9MFI95y0as=.sha256
@ev okay cool, well i'll make it so you can configure a base url to find blobs, which defaults to http://localhost:7777/ (the default local Patchwork / sbot
address)
also, did you notice you can also access the same blob at:
https://evbogue.com/blobs/get/&6/avNqHBq8nm9wnqx6dHXRoi4s5yuilh/9MFI95y0as=.sha256 ?
5ab82c84
· 12/9/2016, 1:29:26 AMnow you can configure a different blob base url with BLOB_URL
environment variable.
so for example, to run the local dev server using your remote blobs, you can do BLOB_URL=https://evbogue.com/blobs/get/ npm start
. i'll redeploy the http://dinosaur.is/ssb-graphviz site using your remote blobs. :smile:
oops BLOBS_URL
i'm wondering if a better approach is to make ssb-graphviz
a plugin to sbot
, so it would automatically run alongside sbot
(which means pub owners can easily host a live graph of their pub's view of ssb) and therefore have direct access to all the sbot goodies. also this way we can do live and lazy queries, rather than a single query for everything during the compilation step.
closing in favor of %M0R0mWi....
while this works right meow: http://dinosaur.is/ssb-graphviz/, i don't think it's the right approach.
Built with git-ssb-web