Commit 64a56737c49b12ec93757440a89e0f9372d249aa
commit changes from vps
Ev Bogue committed on 10/29/2016, 12:25:23 AMParent: 087d12afcf79295f91dca741ce00c7c3ec26f6a5
Parent: 62cff98abf3289863d393a35f5554c0c743472ed
Files changed
index.js | changed |
package.json | changed |
style.css | 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,13 @@ | ||
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'), | |
40 … | + h('p.small.ri', mo(post.value.timestamp).fromNow()), | |
103 | 41 … | h('img.avatar', {src: bloburl + image}), |
104 | 42 … | 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)}) | |
130 | 44 … | ) |
131 | 45 … | ) |
132 | 46 … | ).outerHTML) |
133 | 47 … | } |
package.json | ||
---|---|---|
@@ -1,14 +1,14 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "sdash", |
3 | - "version": "2.0.0", | |
3 … | + "version": "2.0.1", | |
4 | 4 … | "description": "personal gateway to the scuttlebot distributed social network", |
5 | 5 … | "main": "index.js", |
6 | 6 … | "dependencies": { |
7 | 7 … | "hyperscript": "^2.0.2", |
8 | 8 … | "moment": "^2.15.0", |
9 | 9 … | "pull-stream": "^3.4.5", |
10 | - "ssb-avatar": "^0.1.0", | |
10 … | + "ssb-avatar": "^0.2.0", | |
11 | 11 … | "ssb-client": "^4.0.3", |
12 | 12 … | "ssb-markdown": "^3.0.0" |
13 | 13 … | }, |
14 | 14 … | "author": "Ev Bogue" |
Built with git-ssb-web