2023-04-26 22:01:27 +03:00
|
|
|
:: Hosting/Email
|
|
|
|
:: Query the Hosting backend for a customer's email address
|
|
|
|
::
|
2023-04-26 22:24:54 +03:00
|
|
|
:: > -bark!hosting-email "[API_KEY]" ~dovmer-davmet
|
2023-04-26 22:01:27 +03:00
|
|
|
::
|
|
|
|
:: API Response:
|
|
|
|
:: {
|
|
|
|
:: "ship": "dovmer-davmet",
|
|
|
|
:: "email": "james.muturi+t17@tlon.io"
|
|
|
|
:: }
|
|
|
|
::
|
|
|
|
:: Output:
|
|
|
|
:: james.muturi+t17@tlon.io
|
|
|
|
::
|
|
|
|
/- spider
|
|
|
|
/+ *strandio
|
|
|
|
=, strand=strand:spider
|
|
|
|
=, dejs:format
|
|
|
|
|^ ted
|
|
|
|
++ build-headers
|
|
|
|
|= api-key=tape
|
|
|
|
^- header-list:http
|
|
|
|
:~ ['Content-Type' 'application/json']
|
|
|
|
['APIKey' (crip api-key)]
|
|
|
|
==
|
|
|
|
++ api-get
|
|
|
|
|= [api-key=tape ship=@p]
|
|
|
|
%: send-request
|
|
|
|
method=%'GET'
|
|
|
|
url=(crip "https://tlon.network/v1/ships/{<ship>}/email")
|
|
|
|
header-list=(build-headers api-key)
|
|
|
|
body=~
|
|
|
|
==
|
|
|
|
++ mine-json
|
|
|
|
%- ot
|
|
|
|
:~ ship+so
|
|
|
|
email+so
|
|
|
|
==
|
|
|
|
++ ted
|
|
|
|
^- thread:spider
|
|
|
|
|= arg=vase
|
|
|
|
=/ m (strand ,vase)
|
|
|
|
^- form:m
|
|
|
|
=/ arg-mold
|
|
|
|
$: api-key=tape
|
|
|
|
ship=@p
|
|
|
|
==
|
|
|
|
=/ args !<((unit arg-mold) arg)
|
2023-04-26 22:24:54 +03:00
|
|
|
?~ args (pure:m !>(~))
|
2023-04-26 22:01:27 +03:00
|
|
|
;< ~ bind:m (api-get api-key.u.args ship.u.args)
|
|
|
|
;< rep=client-response:iris bind:m
|
|
|
|
take-client-response
|
|
|
|
?> ?=(%finished -.rep)
|
2023-04-26 22:24:54 +03:00
|
|
|
?~ full-file.rep (pure:m !>(~))
|
2023-04-26 22:01:27 +03:00
|
|
|
=/ body=cord q.data.u.full-file.rep
|
2023-08-10 20:41:48 +03:00
|
|
|
=/ parsed=(unit json) (de:json:html body)
|
2023-04-26 22:24:54 +03:00
|
|
|
?~ parsed (pure:m !>(~))
|
|
|
|
?~ u.parsed (pure:m !>(~))
|
2023-04-26 22:01:27 +03:00
|
|
|
=/ mined (mine-json u.parsed)
|
2023-04-26 22:27:05 +03:00
|
|
|
(pure:m !>([~ +.mined]))
|
2023-04-26 22:01:27 +03:00
|
|
|
--
|