user environment variables
parent
2a6e8f6a03
commit
2810d5adb1
|
@ -2,12 +2,10 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
|
||||||
USING: io.sockets.secure kernel http http.server http.server.dispatchers accessors furnace.actions namespaces http.server.responses io.servers io.sockets.secure.debug json.reader assocs combinators sequences arrays threads locals formatting json.writer urls http.client hashtables math ;
|
USING: io.sockets.secure kernel http http.server http.server.dispatchers accessors furnace.actions namespaces http.server.responses io.servers io.sockets.secure.debug json.reader assocs combinators sequences arrays threads locals formatting json.writer urls http.client hashtables math ;
|
||||||
USING: prettyprint io.encodings.utf8 io io.files ;
|
USING: prettyprint io.encodings.utf8 io io.files environment ;
|
||||||
|
|
||||||
IN: bonerbonerboner.services.slack
|
IN: bonerbonerboner.services.slack
|
||||||
|
|
||||||
SYMBOLS: slack-callbacks current-slack-webhook-url current-slack-authorization-token ;
|
|
||||||
|
|
||||||
{ } slack-callbacks set-global
|
{ } slack-callbacks set-global
|
||||||
|
|
||||||
TUPLE: slack < dispatcher ;
|
TUPLE: slack < dispatcher ;
|
||||||
|
@ -46,14 +44,14 @@ TUPLE: slack < dispatcher ;
|
||||||
"https://slack.com/api/users.profile.get" >url
|
"https://slack.com/api/users.profile.get" >url
|
||||||
{ "user" "token" }
|
{ "user" "token" }
|
||||||
] dip
|
] dip
|
||||||
current-slack-authorization-token get 2array zip
|
"SLACK_AUTH_TOKEN" os-env 2array zip
|
||||||
set-query-params
|
set-query-params
|
||||||
http-get swap drop json>
|
http-get swap drop json>
|
||||||
"profile" of "real_name" of ;
|
"profile" of "real_name" of ;
|
||||||
|
|
||||||
: slack-post-message ( payload -- )
|
: slack-post-message ( payload -- )
|
||||||
>json
|
>json
|
||||||
current-slack-webhook-url get >url
|
"SLACK_WEBHOOK_URL" os-env >url
|
||||||
<post-request>
|
<post-request>
|
||||||
http-request 2drop ;
|
http-request 2drop ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue