git ssb

3+

ev / sdash



Commit 64a56737c49b12ec93757440a89e0f9372d249aa

commit changes from vps

Ev Bogue committed on 10/29/2016, 12:25:23 AM
Parent: 087d12afcf79295f91dca741ce00c7c3ec26f6a5
Parent: 62cff98abf3289863d393a35f5554c0c743472ed

Files changed

index.jschanged
package.jsonchanged
style.csschanged
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,13 @@
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'),
40 + h('p.small.ri', mo(post.value.timestamp).fromNow()),
10341 h('img.avatar', {src: bloburl + image}),
10442 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',
110- h('p.small.ri', 'post'),
111- h('img.avatar', {src: bloburl + image}),
112- h('a', {href: me }, '@' + name),
113- h('div', {innerHTML: md.block(post.value.content.text)},
114- h('span.date', mo(post.value.timestamp).fromNow())
115- )
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- )
43 + h('div', {innerHTML: md.block(post.value.content.text)})
13044 )
13145 )
13246 ).outerHTML)
13347 }
package.jsonView
@@ -1,14 +1,14 @@
11 {
22 "name": "sdash",
3- "version": "2.0.0",
3 + "version": "2.0.1",
44 "description": "personal gateway to the scuttlebot distributed social network",
55 "main": "index.js",
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"
style.cssView
@@ -1,8 +1,8 @@
11 body {
22 font-family: 'Source Sans Pro', sans-serif;
33 color: #333;
4- width: 60%;
4 + width: 100%;
55 margin-right: auto;
66 margin-left: auto;
77 }
88

Built with git-ssb-web