@@ -24,7 +24,7 @@ code isn't 2xx. Save the following as `app/up.hoon`:
2424|%
2525+$ move [bone card]
2626+$ card
27− $% [%hiss wire unit-iden=$~ mark=%httr cage=[mark=%purl vase=purl]]
27+ $% [%hiss wire unit-iden=$~ mark=%httr cage=[mark=%purl vase=purl:eyre]]
2828 [%wait wire @da]
2929 ==
3030+$ action
@@ -35,7 +35,7 @@ code isn't 2xx. Save the following as `app/up.hoon`:
3535--
3636|_ [hid=bowl:gall on=_| in-progress=_| target=@t]
3737++ poke-atom
38− |= url-or-command=@t ^- (quip move +>)
38+ |= url-or-command=@t ^- (quip move _+>)
3939 =+ ^- act/action
4040 ?: ?=($on url-or-command) [%on ~]
4141 ?: ?=($off url-or-command) [%off ~]
@@ -45,11 +45,11 @@ code isn't 2xx. Save the following as `app/up.hoon`:
4545 $off [~ +>.$(on |)]
4646 $on
4747 :- ?: |(on in-progress) ~
48− [ost.hid %hiss /request ~ %httr %purl (need (epur target))]~
48+ [ost.hid %hiss /request ~ %httr %purl (need (de-purl:html target))]~
4949 +>.$(on &, in-progress &)
5050 ==
5151++ sigh-httr
52− |= [wir=wire code=@ud headers=mess body=(unit octs)]
52+ |= [wir=wire code=@ud headers=mess:eyre body=(unit octs)]
5353 ~& 'arrive here'
5454 ^- [(list move) _+>.$]
5555 ?: &((gte code 200) (lth code 300))
@@ -62,10 +62,10 @@ code isn't 2xx. Save the following as `app/up.hoon`:
6262 :_ +>.$
6363 [ost.hid %wait /timer (add ~s10 now.hid)]~
6464++ wake-timer
65− |= [wir=wire $~] ^- (quip move +>)
65+ |= [wir=wire $~] ^- (quip move _+>)
6666 ?: on
6767 :_ +>.$
68− [ost.hid %hiss /request ~ %httr %purl (need (epur target))]~
68+ [ost.hid %hiss /request ~ %httr %purl (need (de-purl:html target))]~
6969 [~ +>.$(in-progress |)]
7070::
7171++ prep ~& target _`. :: computed when the source file changes;
@@ -88,9 +88,9 @@ r=cage]` from `zuse`.
8888
8989> Recall that `++unit` means "maybe". Formally, "`(unit a)` is either null or a pair of null and a value in `a`". Also recall that to pull a value out of a unit (`u.unit`), you must first verify that the unit is not null (for example with `?~`). See `++need`.
9090
91−A `purl` is a parsed url structure, which can be created with `++epur`,
91+A `purl:eyre` is a parsed url structure, which can be created with `de-purl:html`,
9292which is a function that takes a url as text and parses it into a `(unit
93−purl)`. Thus, the result is null if and only if the url is malformed.
93+purl:eyre)`. Thus, the result is null if and only if the url is malformed.
9494'Purl' is also the mark which will be applied to this result.
9595
9696When you send this request, you can expect a `%sigh` with the
@@ -104,7 +104,7 @@ produce a `%wake` when the time comes.
104104Let's take a look at our state:
105105
106106```
107−|_ [hid=bowl:gall on=_| in-progress=_| target=@t}
107+|_ [hid=bowl:gall on=_| in-progress=_| target=@t]
108108```
109109
110110We have three pieces of app-specific state. `target` is the url
@@ -137,7 +137,7 @@ actual url, so we save it in `target`.
137137Here's the move that sends the HTTP request:
138138
139139```
140−[ost.hid %hiss /request ~ %httr %purl (need (epur target))]
140+[ost.hid %hiss /request ~ %httr %purl (need (de-purl:html target))]
141141```
142142
143143> Remember, we are expected to produce a *list* of moves. Note the `~` after the move in the full example. This is a convenient shortcut for creating a list of a single element. It's part of a small family of such shortcuts. `~[a b c]` is `[a b c ~]`, `[a b c]~` is `[[a b c] ~]` and `\`[a b c]` is `[~ a b c]`. These may be mixed and matched to create various convoluted structures and emojis.
@@ -151,7 +151,7 @@ visualize on one line. Here it is more pedantically:
151151 wire=/request
152152 unit-iden=~
153153 mark=%httr
154− cage=[%purl (need (epur target))]
154+ cage=[%purl (need (de-purl:html target))]
155155==
156156```
157157