git ssb

3+

ev / sdash



Commit 17b07347cac60d6c6ad5588e2408644c177b2c9c

get images and name from sbot

Ev Bogue committed on 8/18/2016, 11:14:09 PM
Parent: 2dceaa4a1e9af879885c4b6a6b4a93d73ae64a65

Files changed

index.jadechanged
index.jschanged
package.jsonchanged
index.jadeView
@@ -2,10 +2,10 @@
22 html
33 head
44 title= title
55 meta(charset='utf8')
6- link(rel='stylesheet' href='http://evbogue.com/reserva/reserva.css')
7- link(rel='stylesheet' href='http://evbogue.com/style.css')
6 + // link(rel='stylesheet' href='http://evbogue.com/reserva/reserva.css')
7 + // link(rel='stylesheet' href='http://evbogue.com/style.css')
88 body
9- img(src='http://evbogue.com/2016ev-mar.jpg' class='profile' style='float: left; margin-right: .5ex; width: 75px;')
9 + img(src='http://localhost:8989/blobs/get/#{image}' class='profile' style='float: left; margin-right: .5ex; width: 75px;')
1010 p(style='float: right;')<span style='float: right; font-size: .8em;'>#{date} on <a href='http://evbogue.com/patchbayinstall' target='_parent'>Patchbay</a>
11- p <a href='http://evbogue.com/ev' target='_parent'>@ev</a> #{message}
11 + p <a href='http://evbogue.com/ev' target='_parent'>@#{name}</a> #{message}
index.jsView
@@ -1,15 +1,13 @@
11 var client = require('ssb-client');
22 var pull = require('pull-stream');
3 +var avatar = require('ssb-avatar');
34 var moment = require('moment');
45 var app = require('koa')();
56 var router = require('koa-router')();
67 var views = require('co-views');
78
8-var port = 4000;
9-var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519'
10-var message = 'I said nothing';
11-var date = 'Today!';
9 +var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519';
1210
1311 app.use(router.routes())
1412
1513 var render = views(__dirname, { ext: 'jade'});
@@ -18,8 +16,15 @@
1816 client(function (err, sbot) {
1917 if (err) {
2018 throw err;
2119 }
20 + avatar(sbot, me, me, function (err, avatar){
21 + if (err) {
22 + throw err;
23 + }
24 + name = avatar.name;
25 + image = avatar.image;
26 + })
2227 pull(sbot.createUserStream({
2328 id: me,
2429 limit: 1,
2530 reverse: true
@@ -43,10 +48,9 @@
4348 }
4449 gotMessage();
4550 }));
4651 });
47- function gotMessage() {
48- }
49- this.body = yield render('index', {title: 'sdash', message, date});
52 + function gotMessage() {}
53 + this.body = yield render('index', {title: 'sdash', message, date, name, image});
5054 });
51-app.listen(port);
55 +app.listen(4000);
5256
package.jsonView
@@ -8,9 +8,11 @@
88 "jade": "^1.11.0",
99 "koa": "^1.2.1",
1010 "koa-router": "^5.4.0",
1111 "moment": "^2.14.1",
12 + "pull-paramap": "^1.1.6",
1213 "pull-stream": "^3.4.3",
14 + "ssb-avatar": "^0.1.0",
1315 "ssb-client": "^4.0.3"
1416 },
1517 "author": "Ev Bogue"
1618 }

Built with git-ssb-web