Files: f1cc08ac986f18880000b780dae6fb2043e76948 / modules / getstars.js
634 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | var config = require ('../config')() |
4 | |
5 | module.exports.getstars = function (msg, sbot) { |
6 | var star = config.emojiUrl + 'star.png' |
7 | var digs = h('a') |
8 | |
9 | var votes = [] |
10 | for(var k in CACHE) { |
11 | if (CACHE[k].content.vote != null) { |
12 | if(CACHE[k].content.type == 'vote' && |
13 | (CACHE[k].content.vote == msg.key || |
14 | CACHE[k].content.vote.link == msg.key |
15 | )) |
16 | votes.push({source: CACHE[k].author, dest: k, rel: 'vote'}) |
17 | } |
18 | } |
19 | var digs |
20 | for (i = 0; i < votes.length; i++) { |
21 | digs = '<img src="' + star + '" class="emoji">' + digs |
22 | } |
23 | return h('span', {innerHTML: digs}) |
24 | } |
25 | |
26 |
Built with git-ssb-web