forked from FabricLabs/maki
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
134 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; | ||
|
||
var config = require('../config'); | ||
var async = require('async'); | ||
var rest = require('restler'); | ||
var qs = require('querystring'); | ||
|
||
var home = 'http://localhost:9200'; | ||
var base = 'https://slack.com/api/users.list'; | ||
var params = { | ||
token: config.slack.token | ||
}; | ||
var url = base + '?' + qs.stringify(params); | ||
|
||
console.log('using URL:', url); | ||
|
||
rest.get(url).on('complete', function(people) { | ||
console.log('people:', people.members); | ||
|
||
people.members.forEach(function(person) { | ||
rest.post(home + '/people', { | ||
headers: { | ||
'Accept': 'application/json' | ||
}, | ||
data: { | ||
username: person.name, | ||
name: { | ||
given: person.profile.first_name, | ||
family: person.profile.last_name | ||
}, | ||
email: person.profile.email, | ||
bio: person.profile.title, | ||
image: { | ||
original: person.profile.image_original, | ||
avatar: person.profile.image_192, | ||
} | ||
} | ||
}).on('complete', function(result) { | ||
console.log('person result:', person.name, result); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.ui.card | ||
a.image(href="/people/#{person.slug}") | ||
img(src="#{person.image.avatar}") | ||
.content | ||
a.header(href="/people/#{person.slug}") #{person.username} | ||
.meta joined in | ||
abbr.tooltipped(title="#{person.created}") #{person.created.getFullYear()} | ||
p #{person.bio} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
extends layouts/default | ||
|
||
block content | ||
|
||
.ui.grid | ||
.row | ||
.ui.text.container(style="margin-top: 2em;") | ||
h1 People: the Maki Community | ||
p We are the people working towards <a href="https://slack-files.com/T09HF1HK9-F1827U79U-5cf8742c4f">the Maki Vision</a> by being members of <a href="https://chat.maki.io">the public chat</a>. Add yourself to this list by <a href="https://chat.maki.io">signing in to Slack</a>, and update it by editing your profile there. | ||
p Conveniently, this page also serves as an example resource that can be synchronized with an oracle (or more simply, a trusted API). Take a <a href="https://github.com/martindale/maki/blob/recognition/tools/slack.sync.people.js">look at the source code</a>! | ||
a.ui.right.floated.huge.primary.labeled.button(href="https://chat.maki.io") | ||
| Add Yourself | ||
i.icon.right.chevron | ||
.row | ||
.ui.five.stackable.cards(style="margin-top: 2em;") | ||
- var shuffled = _.shuffle(people); | ||
for person in shuffled | ||
include partials/person |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends layouts/default | ||
|
||
block content | ||
.ui.grid.stackable | ||
.row | ||
.four.wide.column | ||
include partials/person | ||
.twelve.wide.column | ||
|