Commit af6fa7294573cf01a5867f8f1c6cc6b841b93333
update dependencies
Ev Bogue committed on 10/28/2016, 11:41:14 PMParent: 087d12afcf79295f91dca741ce00c7c3ec26f6a5
Parent: 939131de1b3dc97dbc7e870137b2b17017486f75
Files changed
index.js | changed |
package.json | changed |
index.js | |||
---|---|---|---|
@@ -9,31 +9,10 @@ | |||
9 | 9 … | var ref = require('ssb-ref') | |
10 | 10 … | ||
11 | 11 … | var title = 'sdash' | |
12 | 12 … | 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/' | ||
15 | 14 … | ||
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 | - | ||
36 | 15 … | http.createServer(function (req, res){ | |
37 | 16 … | if (req.url === '/') { | |
38 | 17 … | client(function (err, sbot) { | |
39 | 18 … | avatar(sbot, me, me, function (err, avatar){ | |
@@ -44,39 +23,11 @@ | |||
44 | 23 … | pull( | |
45 | 24 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}), | |
46 | 25 … | pull.drain(function (data) { | |
47 | 26 … | post = data | |
27 … | + gotPost() | ||
48 | 28 … | }) | |
49 | 29 … | ) | |
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 | - ) | ||
79 | 30 … | }) | |
80 | 31 … | function gotPost() { | |
81 | 32 … | res.end( | |
82 | 33 … | h('html', | |
@@ -84,50 +35,15 @@ | |||
84 | 35 … | h('title', name + '\'s ' + title), | |
85 | 36 … | h('style', fs.readFileSync('style.css', 'utf8')) | |
86 | 37 … | ), | |
87 | 38 … | 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'), | ||
101 | 39 … | 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', | ||
110 | 40 … | h('p.small.ri', 'post'), | |
111 | 41 … | h('img.avatar', {src: bloburl + image}), | |
112 | 42 … | h('a', {href: me }, '@' + name), | |
113 | 43 … | h('div', {innerHTML: md.block(post.value.content.text)}, | |
114 | 44 … | h('span.date', mo(post.value.timestamp).fromNow()) | |
115 | 45 … | ) | |
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 | - ) | ||
130 | 46 … | ) | |
131 | 47 … | ) | |
132 | 48 … | ).outerHTML) | |
133 | 49 … | } |
Built with git-ssb-web