git ssb

3+

ev / sdash



Commit af6fa7294573cf01a5867f8f1c6cc6b841b93333

update dependencies

Ev Bogue committed on 10/28/2016, 11:41:14 PM
Parent: 087d12afcf79295f91dca741ce00c7c3ec26f6a5
Parent: 939131de1b3dc97dbc7e870137b2b17017486f75

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -9,31 +9,10 @@
99 var ref = require('ssb-ref')
1010
1111 var title = 'sdash'
1212 var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519'
13-var desc = 'This is <a href="https://gitmx.com/%25qrU04j9vfUJKfq1rGZrQ5ihtSfA4ilfY3wLy7xFv0xk%3D.sha256">sdash</a>, a work-in-progress personal gateway to the <a href="http://ssbc.github.io">scuttlebot</a> distributed social network.'
14-var bloburl = 'http://localhost:8989/blobs/get/'
13 +var bloburl = 'https://evbogue.com/ws/blobs/get/'
1514
16-var loc = 'The World'
17-var email = 'No email'
18-
19-var pin = 'No pinned message, yet'
20-
21-client(function (err, sbot) {
22- pull(
23- sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'email'}}}}], limit: 1, reverse: true}),
24- pull.drain(function (data) {
25- email = data.value.content.email
26- })
27- )
28- pull(
29- sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'location'}}}}], limit: 1, reverse: true}),
30- pull.drain(function (data) {
31- loc = data.value.content.location
32- })
33- )
34-})
35-
3615 http.createServer(function (req, res){
3716 if (req.url === '/') {
3817 client(function (err, sbot) {
3918 avatar(sbot, me, me, function (err, avatar){
@@ -44,39 +23,11 @@
4423 pull(
4524 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}),
4625 pull.drain(function (data) {
4726 post = data
27 + gotPost()
4828 })
4929 )
50- pull(
51- sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'pin'}}}}], limit: 1, reverse: true}),
52- pull.drain(function (data) {
53- getpin = data
54- pull(
55- sbot.query.read({query: [{$filter: { key: getpin.value.content.link}}]}),
56- pull.drain(function (data) {
57- pinned = data
58- })
59- )
60- })
61- )
62- pull(
63- sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'vote'}}}}], limit: 1, reverse: true}),
64- pull.drain(function (data) {
65- vote = data
66- pull(
67- sbot.query.read({query: [{$filter: { key: data.value.content.vote.link}}]}),
68- pull.drain(function (data) {
69- avatar(sbot, me, data.value.author, function (err, avatar){
70- if (err) throw err
71- reauthor = avatar
72- gotPost()
73- })
74- redo = data
75- })
76- )
77- })
78- )
7930 })
8031 function gotPost() {
8132 res.end(
8233 h('html',
@@ -84,50 +35,15 @@
8435 h('title', name + '\'s ' + title),
8536 h('style', fs.readFileSync('style.css', 'utf8'))
8637 ),
8738 h('body',
88- h('div.ad',
89- h('p', {innerHTML: '<a href="https://evbogue.com/liteclient.png"><img src="https://evbogue.com/liteclient.png" style="margin-bottom: 1em; width: 100%;"></a>Get a lite client invite.<br />Email <a href="mailto:ev@evbogue.com">ev@evbogue.com</a>'})
90- ),
91- h('img.profile', {src: bloburl + image}),
92- h('h1',
93- h('a', {href: me }, '@' + name)
94- ),
95- h('p', loc + ' | ',
96- h('a', {href: 'mailto:' + email}, email)
97- ),
98- h('p', {innerHTML: '<a href="/node">Minimal Node</a> | <a href="/minimalist">The Art of Being Minimalist</a>'}),
99- h('p', {innerHTML: desc}),
100- h('hr'),
10139 h('div.msg',
102- h('p.small.ri', 'pinned'),
103- h('img.avatar', {src: bloburl + image}),
104- h('a', {href: me }, '@' + name),
105- h('div', {innerHTML: md.block(pinned.value.content.text)},
106- h('span.date', mo(pinned.value.timestamp).fromNow())
107- )
108- ),
109- h('div.msg',
11040 h('p.small.ri', 'post'),
11141 h('img.avatar', {src: bloburl + image}),
11242 h('a', {href: me }, '@' + name),
11343 h('div', {innerHTML: md.block(post.value.content.text)},
11444 h('span.date', mo(post.value.timestamp).fromNow())
11545 )
116- ),
117- h('div.msg',
118- h('p.small.ri', 'dig'),
119- h('img.avatar', {src: bloburl + image}),
120- h('a', {href: me }, '@' + name), ' dug ',
121- h('a', {href: vote.value.content.vote.link}, redo.value.content.text.substring(0, 40)), '...',
122- h('p.date', mo(vote.value.timestamp).fromNow()),
123- h('div.msg',
124- h('img.avatar', {src: bloburl + reauthor.image}),
125- h('a', {href: reauthor.name }, '@' + reauthor.name),
126- h('div', {innerHTML: md.block(redo.value.content.text)},
127- h('span.date', mo(redo.value.timestamp).fromNow())
128- )
129- )
13046 )
13147 )
13248 ).outerHTML)
13349 }
package.jsonView
@@ -6,9 +6,9 @@
66 "dependencies": {
77 "hyperscript": "^2.0.2",
88 "moment": "^2.15.0",
99 "pull-stream": "^3.4.5",
10- "ssb-avatar": "^0.1.0",
10 + "ssb-avatar": "^0.2.0",
1111 "ssb-client": "^4.0.3",
1212 "ssb-markdown": "^3.0.0"
1313 },
1414 "author": "Ev Bogue"

Built with git-ssb-web