urbit/main/app/twitter-auth/core.hook

35 lines
774 B
Plaintext
Raw Normal View History

2015-01-22 06:31:17 +03:00
:: Input twitter keys
/+ sh-utils
!:
|_ [hide vat=wain]
++ prompts
^- wain
:~ 'User: '
'App token: '
'App secret: '
'User token: '
'User secret: '
''
==
2015-01-22 06:31:17 +03:00
++ peek ,_prompt/[(snag (lent vat) prompts) %text '']
2015-01-23 01:11:20 +03:00
++ posh-txt
|= [@ * p=cord]
2015-01-22 06:31:17 +03:00
=. vat [p vat]
?. =(5 (lent vat)) `+>.$
2015-01-22 06:31:17 +03:00
%.(+< (add-exit ,_`+>.$))
::
++ part
=. vat (flop vat) :: put into order of entry
?. ?=([@ @ @ @ @ ~] vat)
2015-01-22 06:31:17 +03:00
~|([%keys-missing vat] !!)
=+ =< aut=[acc %auth [ctok csec] atok asec]
`[acc=span ctok=cord csec=cord atok=cord asec=cord ~]`vat
2015-01-22 06:31:17 +03:00
|= ost=bone
:_ ~
:^ ost %pass /out
[%g %mess serv our %twit-do !>(aut)]
2015-01-22 06:31:17 +03:00
::
++ poke--args (listen-in . (add-nice ,_`.))
++ serv [our /twit]
--