diff --git a/lib/oauth1.hoon b/lib/oauth1.hoon index 92eadae6b..9fe2c6382 100644 --- a/lib/oauth1.hoon +++ b/lib/oauth1.hoon @@ -1,42 +1,53 @@ -++ oauth :: OAuth 1.0 header - |= $: med=meth - url=tape - pas=(list tape) - key=keys - zet=@ - ken=@ - == - ^- @t - =+ non=(turn (rip 2 (shaw zet 128 ken)) |=(a=@ ~(x ne a))) - =+ tim=(slag 2 (scow %ui (unt zet))) - =+ sky=(crip :(weld (urle (trip sec.con.key)) "&" (urle (trip sec.acc.key)))) - =+ ^= bas - ^- tape - =+ ^= hds - %- reel :_ |=([p=tape q=tape] :(weld p "&" q)) - %- sort :_ aor - %- weld :- pas - ^- (list tape) - :~ :(weld "oauth_consumer_key=" (trip tok.con.key)) - :(weld "oauth_nonce=" non) - :(weld "oauth_signature_method=HMAC-SHA1") - :(weld "oauth_timestamp=" tim) - :(weld "oauth_token=" (trip tok.acc.key)) - :(weld "oauth_version=1.0") - == - ;: weld - (trip (cuss (trip `@t`med))) "&" - (urle url) "&" - (urle (scag (dec (lent hds)) `tape`hds)) - == - =+ sig=`tape`(sifo (swap 3 (hmac (swap 3 sky) (crip bas)))) - %- crip - ;: weld "OAuth " - "oauth_consumer_key=" "\"" (trip tok.con.key) "\", " - "oauth_nonce=" "\"" non "\", " - "oauth_signature=" "\"" (urle sig) "\", " - "oauth_signature_method=\"HMAC-SHA1\", " - "oauth_timestamp=" "\"" tim "\", " - "oauth_token=" "\"" (trip tok.acc.key) "\", " - "oauth_version=1.0" +:: OAuth 1.0 %authorization header +:: +:::: /hoon/oauth1/lib + :: +|% +++ keys + $: con/{tok/@t sec/@t} :: user key pair + acc/{tok/@t sec/@t} :: app key pair == +-- +:: +:::: + :: +|= $: med/meth + url/tape + pas/(list tape) + key/keys + zet/time + ken/@ + == +^- @t +=+ non=(turn (rip 2 (shaw zet 128 ken)) |=(a/@ ~(x ne a))) +=+ tim=(slag 2 (scow %ui (unt zet))) +=+ sky=(crip :(weld (urle (trip sec.con.key)) "&" (urle (trip sec.acc.key)))) +=+ ^= bas + ^- tape + =+ ^= hds + =- (reel (sort - aor) |=({p/tape q/tape} :(weld p "&" q))) + %+ weld pas + ^- (list tape) + :~ :(weld "oauth_consumer_key=" (trip tok.con.key)) + :(weld "oauth_nonce=" non) + :(weld "oauth_signature_method=HMAC-SHA1") + :(weld "oauth_timestamp=" tim) + :(weld "oauth_token=" (trip tok.acc.key)) + :(weld "oauth_version=1.0") + == + ;: weld + (trip (cuss (trip `@t`med))) "&" + (urle url) "&" + (urle (scag (dec (lent hds)) `tape`hds)) + == +=+ sig=`tape`(sifo (swap 3 (hmac (swap 3 sky) (crip bas)))) +%- crip +;: weld "OAuth " + "oauth_consumer_key=" "\"" (trip tok.con.key) "\", " + "oauth_nonce=" "\"" non "\", " + "oauth_signature=" "\"" (urle sig) "\", " + "oauth_signature_method=\"HMAC-SHA1\", " + "oauth_timestamp=" "\"" tim "\", " + "oauth_token=" "\"" (trip tok.acc.key) "\", " + "oauth_version=1.0" +== diff --git a/lib/oauth2.hoon b/lib/oauth2.hoon index 49809a505..ddb90a947 100644 --- a/lib/oauth2.hoon +++ b/lib/oauth2.hoon @@ -9,8 +9,8 @@ |= {a/@t b/@t t/@t} ^- @t ?: =('' t) t - %+ add (lsh 3 1 $(t (rsh 3 1 t))) - =+ c=(mod t (bex 8)) + %+ mix (lsh 3 1 $(t (rsh 3 1 t))) + =+ c=(end 3 1 t) ?:(=(a c) b c) :: ++ join diff --git a/lib/twitter.hoon b/lib/twitter.hoon index 1551d432a..538fd3a57 100644 --- a/lib/twitter.hoon +++ b/lib/twitter.hoon @@ -3,54 +3,57 @@ :::: /hoon/twitter/lib :: /? 314 -/- twitter -/+ oauth1 -=+ sur-twit:^twitter :: XX +/- twitter +/+ oauth1 +=+ oauth1=oauth1 +=+ sur-twit:^twitter :: XX !: :::: functions :: |% ++ fass :: rewrite path - |= a=path + |= a/path %- trip %^ gsub '-' '_' %+ reel a - |= [p=@t q=@t] + |= {p/@t q/@t} (cat 3 '/' (cat 3 p q)) :: ++ gsub :: replace chars - |= [a=@t b=@t t=@t] + |= {a/@t b/@t t/@t} ^- @t - ?~ t t - %+ add (lsh 3 1 $(t (rsh 3 1 t))) - =+ c=(mod t (bex 8)) + ?: =('' t) t + %+ mix (lsh 3 1 $(t (rsh 3 1 t))) + =+ c=(end 3 1 t) ?:(=(a c) b c) :: ++ valve :: produce request - |= $: med=meth - [rus=tape quy=quay] - key=keys - est=time - eny=@ + |= $: med/meth + {rus/tape quy/quay} + key/keys + est/time + eny/@ == ^- hiss =+ url="https://api.twitter.com/1.1{rus}.json" - =+ req=|=(a=tape (scan a auri:epur)) + =+ req=|=(a/tape (scan a auri:epur)) =+ ^= help - |= quy=(list ,[tape tape]) + |= quy/(list {tape tape}) ^- (list tape) %+ turn quy - |= a=[p=tape q=tape] + |= a/{p/tape q/tape} :(weld (urle p.a) "=" (urle q.a)) - =+ tan=(turn quy |=([p=@t q=@t] [(trip p) (trip q)])) - =+ har=(help (turn tan |=(p=[p=tape q=tape] [p.p (urle q.p)]))) + =+ tan=(turn quy |=({p/@t q/@t} [(trip p) (trip q)])) + =+ har=(help (turn tan |=(p/{p/tape q/tape} [p.p (urle q.p)]))) =+ hab=(help tan) - =+ lav=(reel har |=([p=tape q=tape] :(weld p "&" q))) + =+ lav=(reel har |=({p/tape q/tape} :(weld p "&" q))) =+ voy=?:(=(0 (lent lav)) ~ (scag (dec (lent lav)) `tape`lav)) - =+ vab=(reel hab |=([p=tape q=tape] :(weld p "&" q))) + =+ vab=(reel hab |=({p/tape q/tape} :(weld p "&" q))) =+ vur=(crip ?:(=(0 (lent vab)) ~ (scag (dec (lent vab)) `tape`vab))) =+ ^= head %- ~(gas by *math) + ~! ^twitter + ~! oauth1:^twitter :~ ['authorization' [(oauth1 med url hab key est eny) ~]] ['content-type' ['application/x-www-form-urlencoded' ~]] == @@ -72,92 +75,92 @@ -- ++ twir :: response parsers |% - ++ fasp |*([a=@tas b=*] [(gsub '-' '_' a) b]) + ++ fasp |*({a/@tas b/*} [(gsub '-' '_' a) b]) ++ user (cook crip (plus ;~(pose aln cab))) - ++ mean (ot errors/(ar (ot message/so code/ni ~)) ~):jo + ++ mean (ot errors+(ar (ot message+so code+ni ~)) ~):jo ++ stat =+ jo - ^- $+(json (unit ,[id=@u who=@ta now=@da txt=@t])) + ^- $-(json (unit {id+@u who+@ta now+@da txt+@t})) %- ot - :~ id/ni - user/(ot (fasp screen-name/(su user)) ~) - (fasp created-at/da) - text/so + :~ id+ni + user+(ot (fasp screen-name+(su user)) ~) + (fasp created-at+da) + text+so == ++ usel =+ jo - ^- $+(json (unit (list ,who=@ta))) - =- (ot users/(ar -) ~) - (ot (fasp screen-name/(su user)) ~) + ^- $-(json (unit (list who/@ta))) + =- (ot users+(ar -) ~) + (ot (fasp screen-name+(su user)) ~) -- ++ main => |% :: request structures - ++ dev ,@t :: device name - ++ gat ,@t :: grant type - ++ lat ,@t :: latitude + ++ dev @t :: device name + ++ gat @t :: grant type + ++ lat @t :: latitude ++ lid (list tid) - ++ lon ,@t :: longitude + ++ lon @t :: longitude ++ lsc (list scr) - ++ lst (list ,@t) - ++ nam ,@t :: location name - ++ pla ,@t :: place-id - ++ scr ,@t :: screen name - ++ slu ,@t :: category name - ++ tid ,@u - ++ tok ,@t :: oauth token - ++ url ,@t :: callback url + ++ lst (list @t) + ++ nam @t :: location name + ++ pla @t :: place-id + ++ scr @t :: screen name + ++ slu @t :: category name + ++ tid @u + ++ tok @t :: oauth token + ++ url @t :: callback url :: - ++ at ,[%access-token p=tok] - ++ de ,[%device p=dev] - ++ fo ,[%follow p=lid] - ++ gr ,[%grant-type p=gat] - ++ id ,[%id p=tid] - ++ ii ,[%'!inline' p=@t] - ++ is ,[%id p=lid] - ++ la ,[%lat p=lat] - ++ lo ,[%long p=lon] - ++ na ,[%name p=lid] - ++ oa ,[%oauth-callback p=url] - ++ os ,[%source-screen-name p=scr] - ++ pl ,[%place-id p=pla] - ++ qq ,[%q p=@t] - ++ sc ,[%screen-name p=scr] + ++ at {$access-token p/tok} + ++ de {$device p/dev} + ++ fo {$follow p/lid} + ++ gr {$grant-type p/gat} + ++ id {$id p/tid} + ++ ii {$'!inline' p/@t} + ++ is {$id p/lid} + ++ la {$lat p/lat} + ++ lo {$long p/lon} + ++ na {$name p/lid} + ++ oa {$oauth-callback p/url} + ++ os {$source-screen-name p/scr} + ++ pl {$place-id p/pla} + ++ qq {$q p/@t} + ++ sc {$screen-name p/scr} ++ sd ?(ui sc) - ++ ss ,[%screen-name p=lsc] - ++ sl ,[%slug p=slu] - ++ si ,[%source-id p=tid] - ++ st ,[%status p=@t] - ++ te ,[%text p=@t] - ++ ti ,[%target-id p=tid] - ++ ts ,[%target-screen-name p=scr] - ++ tr ,[%track p=lst] - ++ ur ,[%url p=url] - ++ ui ,[%user-id p=tid] - ++ us ,[%user-id p=lid] + ++ ss {$screen-name p/lsc} + ++ sl {$slug p/slu} + ++ si {$source-id p/tid} + ++ st {$status p/@t} + ++ te {$text p/@t} + ++ ti {$target-id p/tid} + ++ ts {$target-screen-name p/scr} + ++ tr {$track p/lst} + ++ ur {$url p/url} + ++ ui {$user-id p/tid} + ++ us {$user-id p/lid} -- - |_ [key=keys est=time eny=@uw] + |_ {key/keys est/time eny/@uw} ++ lutt |=(@ `@t`(rsh 3 2 (scot %ui +<))) ++ llsc |= (list scr) - (roll +< |=([p=scr q=@t] (cat 3 (cat 3 q ',') p))) + (roll +< |=({p/scr q/@t} (cat 3 (cat 3 q ',') p))) :: ++ llst - |= (list ,@t) - (roll +< |=([p=@t q=@t] (cat 3 (cat 3 q ',') p))) + |= (list @t) + (roll +< |=({p/@t q/@t} (cat 3 (cat 3 q ',') p))) :: ++ llid |= (list tid) - (roll +< |=([p=tid q=@t] (cat 3 (cat 3 q ',') (lutt p)))) + (roll +< |=({p/tid q/@t} (cat 3 (cat 3 q ',') (lutt p)))) :: ++ mold :: construct request - |* [med=meth pax=path a=$+(* *)] - |= [args=a quy=quay] + |* {med/meth pax/path a/$-(* *)} + |= {args/a quy/quay} (valve med (cowl pax args quy) key est eny) :: ++ cowl :: handle parameters - |= $: pax=path - ban=(list ,[p=@t q=?(@ (list ,@))]) - quy=quay + |= $: pax/path + ban/(list {p/@t q/?(@ (list @))}) + quy/quay == ^- [path quay] ?~ ban @@ -168,335 +171,335 @@ !! :- (fass pax) %+ welp quy - %+ turn `(list ,[p=@t q=?(@ (list ,@))])`ban - |= [p=@t q=?(@ (list ,@))] + %+ turn `(list {p/@t q/?(@ (list @))})`ban + |= {p/@t q/?(@ (list @))} ^- [@t @t] :- (gsub '-' '_' p) ?@ q ?- p - ?(%id %source-id %target-id %user-id) (lutt q) + ?($id $source-id $target-id $user-id) (lutt q) @ `@t`q == ?- p - ?(%follow %id %name %user-id) (llid q) - %track (llst q) - %screen-name (llsc q) + ?($follow $id $name $user-id) (llid q) + $track (llst q) + $screen-name (llsc q) * !! == :: ++ stat-ment - (mold %get /statuses/mentions-timeline ,~) + (mold %get /statuses/mentions-timeline $~) :: ++ stat-user - (mold %get /statuses/user-timeline ,[sd ~]) + (mold %get /statuses/user-timeline {sd $~}) :: ++ stat-home - (mold %get /statuses/home-timeline ,~) + (mold %get /statuses/home-timeline $~) :: ++ stat-retw - (mold %get /statuses/retweets-of-me ,~) + (mold %get /statuses/retweets-of-me $~) :: ++ stat-rets-iddd - (mold %get /statuses/retweets ,[ii ~]) + (mold %get /statuses/retweets {ii $~}) :: ++ stat-show - (mold %get /statuses/show ,[id ~]) + (mold %get /statuses/show {id $~}) :: ++ stat-dest-iddd - (mold %post /statuses/destroy ,[ii ~]) + (mold %post /statuses/destroy {ii $~}) :: ++ stat-upda - (mold %post /statuses/update ,[st ~]) + (mold %post /statuses/update {st $~}) :: ++ stat-retw-iddd - (mold %post /statuses/retweet ,[ii ~]) + (mold %post /statuses/retweet {ii $~}) :: ++ stat-oemb-iddd - (mold %get /statuses/oembed ,[id ~]) + (mold %get /statuses/oembed {id $~}) :: ++ stat-oemb-urll - (mold %get /statuses/oembed ,[ur ~]) + (mold %get /statuses/oembed {ur $~}) :: ++ stat-retw-idss - (mold %get /statuses/retweeters/ids ,[id ~]) + (mold %get /statuses/retweeters/ids {id $~}) :: ++ sear-twee - (mold %get /search/tweets ,[qq ~]) + (mold %get /search/tweets {qq $~}) :: ++ stat-filt-foll - (mold %post /statuses/filter ,[?(fo tr) ~]) + (mold %post /statuses/filter {?(fo tr) $~}) :: ++ stat-samp - (mold %get /statuses/sample ,~) + (mold %get /statuses/sample $~) :: ++ stat-fire - (mold %get /statuses/firehose ,~) + (mold %get /statuses/firehose $~) :: ++ user - (mold %get /user ,~) + (mold %get /user $~) :: ++ site - (mold %get /site ,[fo ~]) + (mold %get /site {fo $~}) :: ++ dire - (mold %get /direct-messages ,~) + (mold %get /direct-messages $~) :: ++ dire-sent - (mold %get /direct-messages/sent ,~) + (mold %get /direct-messages/sent $~) :: ++ dire-show - (mold %get /direct-messages/show ,[id ~]) + (mold %get /direct-messages/show {id $~}) :: ++ dire-dest - (mold %post /direct-messages/destroy ,[id ~]) + (mold %post /direct-messages/destroy {id $~}) :: ++ dire-neww - (mold %post /direct-messages/new ,[sd te ~]) + (mold %post /direct-messages/new {sd te $~}) :: ++ frie-nore-idss - (mold %get /friendships/no-retweets/ids ,~) + (mold %get /friendships/no-retweets/ids $~) :: ++ frie-idss - (mold %get /friends/ids ,[sd ~]) + (mold %get /friends/ids {sd $~}) :: ++ foll-idss - (mold %get /followers/ids ,[sd ~]) + (mold %get /followers/ids {sd $~}) :: ++ frie-inco - (mold %get /friendships/incoming ,~) + (mold %get /friendships/incoming $~) :: ++ frie-outg - (mold %get /friendships/outgoing ,~) + (mold %get /friendships/outgoing $~) :: ++ frie-crea - (mold %post /friendships/create ,[sd ~]) + (mold %post /friendships/create {sd $~}) :: ++ frie-dest - (mold %post /friendships/destroy ,[sd ~]) + (mold %post /friendships/destroy {sd $~}) :: ++ frie-upda - (mold %post /friendships/update ,[sd ~]) + (mold %post /friendships/update {sd $~}) :: ++ frie-show - (mold %get /friendships/show ,[?(si os) ?(ti ts) ~]) + (mold %get /friendships/show {?(si os) ?(ti ts) $~}) :: ++ frie-list - (mold %get /friends/list ,[sd ~]) + (mold %get /friends/list {sd $~}) :: ++ foll-list - (mold %get /followers/list ,[sd ~]) + (mold %get /followers/list {sd $~}) :: ++ frie-look - (mold %get /friendships/lookup ,[?(us ss) ~]) + (mold %get /friendships/lookup {?(us ss) $~}) :: ++ acco-sett-gett - (mold %get /account/settings ,~) + (mold %get /account/settings $~) :: ++ acco-veri - (mold %get /account/verify-credentials ,~) + (mold %get /account/verify-credentials $~) :: ++ acco-sett-post - (mold %post /account/settings ,~) + (mold %post /account/settings $~) :: ++ acco-upda-deli - (mold %post /account/update-delivery-device ,[de ~]) + (mold %post /account/update-delivery-device {de $~}) :: ++ acco-upda-prof - (mold %post /account/update-profile ,~) + (mold %post /account/update-profile $~) :: ++ acco-upda-prof-back - (mold %post /account/update-profile-background-image ,~) + (mold %post /account/update-profile-background-image $~) :: ++ acco-upda-prof-colo - (mold %post /account/update-profile-colors ,~) + (mold %post /account/update-profile-colors $~) :: ++ bloc-list - (mold %get /blocks/list ,~) + (mold %get /blocks/list $~) :: ++ bloc-idss - (mold %get /blocks/ids ,~) + (mold %get /blocks/ids $~) :: ++ bloc-crea - (mold %post /blocks/create ,[sd ~]) + (mold %post /blocks/create {sd $~}) :: ++ bloc-dest - (mold %post /blocks/destroy ,[sd ~]) + (mold %post /blocks/destroy {sd $~}) :: ++ user-look - (mold %get /users/lookup ,[?(us ss) ~]) + (mold %get /users/lookup {?(us ss) $~}) :: ++ user-show - (mold %get /users/show ,[sd ~]) + (mold %get /users/show {sd $~}) :: ++ user-sear - (mold %get /users/search ,[qq ~]) + (mold %get /users/search {qq $~}) :: ++ user-cont-tees - (mold %get /users/contributees ,[sd ~]) + (mold %get /users/contributees {sd $~}) :: ++ user-cont-tors - (mold %get /users/contributors ,[sd ~]) + (mold %get /users/contributors {sd $~}) :: ++ acco-remo - (mold %post /account/remove-profile-banner ,~) + (mold %post /account/remove-profile-banner $~) :: ++ user-prof - (mold %get /users/profile-banner ,[sd ~]) + (mold %get /users/profile-banner {sd $~}) :: ++ mute-user-crea - (mold %post /mutes/users/create ,[sd ~]) + (mold %post /mutes/users/create {sd $~}) :: ++ mute-user-dest - (mold %post /mutes/users/destroy ,[sd ~]) + (mold %post /mutes/users/destroy {sd $~}) :: ++ mute-user-idss - (mold %get /mutes/users/ids ,~) + (mold %get /mutes/users/ids $~) :: ++ mute-user-list - (mold %get /mutes/users/list ,~) + (mold %get /mutes/users/list $~) :: ++ user-sugg-slug - (mold %get /users/suggestions ,[sl ~]) + (mold %get /users/suggestions {sl $~}) :: ++ user-sugg - (mold %get /users/suggestions ,~) + (mold %get /users/suggestions $~) :: ++ favo-list - (mold %get /favorites/list ,~) + (mold %get /favorites/list $~) :: ++ favo-dest - (mold %post /favorites/destroy ,[id ~]) + (mold %post /favorites/destroy {id $~}) :: ++ favo-crea - (mold %post /favorites/create ,[id ~]) + (mold %post /favorites/create {id $~}) :: ++ list-list - (mold %get /lists/list ,~) + (mold %get /lists/list $~) :: ++ list-stat - (mold %get /lists/statuses ,~) + (mold %get /lists/statuses $~) :: ++ list-memb-dest - (mold %post /lists/members/destroy ,~) + (mold %post /lists/members/destroy $~) :: ++ list-memb-hips - (mold %get /lists/memberships ,[sd ~]) + (mold %get /lists/memberships {sd $~}) :: ++ list-subs-bers - (mold %get /lists/subscribers ,~) + (mold %get /lists/subscribers $~) :: ++ list-subs-crea - (mold %post /lists/subscribers/create ,~) + (mold %post /lists/subscribers/create $~) :: ++ list-subs-show - (mold %get /lists/subscribers/show ,[sd ~]) + (mold %get /lists/subscribers/show {sd $~}) :: ++ list-subs-dest - (mold %post /lists/subscribers/destroy ,~) + (mold %post /lists/subscribers/destroy $~) :: ++ list-memb-crea-alll - (mold %post /lists/members/create-all ,[?(us ss) ~]) + (mold %post /lists/members/create-all {?(us ss) $~}) :: ++ list-memb-show - (mold %get /lists/members/show ,[sd ~]) + (mold %get /lists/members/show {sd $~}) :: ++ list-memb-bers - (mold %get /lists/members ,~) + (mold %get /lists/members $~) :: ++ list-memb-crea - (mold %post /lists/members/create ,[sd ~]) + (mold %post /lists/members/create {sd $~}) :: ++ list-dest - (mold %post /lists/destroy ,~) + (mold %post /lists/destroy $~) :: ++ list-upda - (mold %post /lists/update ,~) + (mold %post /lists/update $~) :: ++ list-crea - (mold %post /lists/create ,[na ~]) + (mold %post /lists/create {na $~}) :: ++ list-show - (mold %get /lists/show ,~) + (mold %get /lists/show $~) :: ++ list-subs-ions - (mold %get /lists/subscriptions ,[sd ~]) + (mold %get /lists/subscriptions {sd $~}) :: ++ list-memb-dest-alll - (mold %post /lists/members/destroy-all ,[?(us ss) ~]) + (mold %post /lists/members/destroy-all {?(us ss) $~}) :: ++ list-owne - (mold %get /lists/ownerships ,[sd ~]) + (mold %get /lists/ownerships {sd $~}) :: ++ save-list - (mold %get /saved-searches/list ,~) + (mold %get /saved-searches/list $~) :: ++ save-show-iddd - (mold %get /saved-searches/show ,[ii ~]) + (mold %get /saved-searches/show {ii $~}) :: ++ save-crea - (mold %post /saved-searches/create ,[qq ~]) + (mold %post /saved-searches/create {qq $~}) :: ++ save-dest-iddd - (mold %post /saved-searches/destroy ,[ii ~]) + (mold %post /saved-searches/destroy {ii $~}) :: ++ geoo-iddd-plac - (mold %get /geo/id ,[ii ~]) + (mold %get /geo/id {ii $~}) :: ++ geoo-reve - (mold %get /geo/reverse-geocode ,[la lo ~]) + (mold %get /geo/reverse-geocode {la lo $~}) :: ++ geoo-sear - (mold %get /geo/search ,~) + (mold %get /geo/search $~) :: ++ geoo-simi - (mold %get /geo/similar-places ,[la lo na ~]) + (mold %get /geo/similar-places {la lo na $~}) :: ++ tren-plac - (mold %get /trends/place ,[id ~]) + (mold %get /trends/place {id $~}) :: ++ tren-avai - (mold %get /trends/available ,~) + (mold %get /trends/available $~) :: ++ tren-clos - (mold %get /trends/closest ,[la lo ~]) + (mold %get /trends/closest {la lo $~}) :: ++ user-repo - (mold %post /users/report-spam ,[sd ~]) + (mold %post /users/report-spam {sd $~}) :: ++ oaut-auth-cate - (mold %get /oauth/authenticate ,~) + (mold %get /oauth/authenticate $~) :: ++ oaut-auth-rize - (mold %get /oauth/authorize ,~) + (mold %get /oauth/authorize $~) :: ++ oaut-acce - (mold %post /oauth/access-token ,~) + (mold %post /oauth/access-token $~) :: ++ oaut-requ - (mold %post /oauth/request-token ,[oa ~]) + (mold %post /oauth/request-token {oa $~}) :: ++ oaut-toke - (mold %post /oauth2/token ,[gr ~]) + (mold %post /oauth2/token {gr $~}) :: ++ oaut-inva - (mold %post /oauth2/invalidate-token ,[at ~]) + (mold %post /oauth2/invalidate-token {at $~}) :: ++ help-conf - (mold %get /help/configuration ,~) + (mold %get /help/configuration $~) :: ++ help-lang - (mold %get /help/languages ,~) + (mold %get /help/languages $~) :: ++ help-priv - (mold %get /help/privacy ,~) + (mold %get /help/privacy $~) :: ++ help-toss - (mold %get /help/tos ,~) + (mold %get /help/tos $~) :: ++ appl-rate - (mold %get /application/rate-limit-status ,~) + (mold %get /application/rate-limit-status $~) :: ++ stat-look - (mold %get /statuses/lookup ,[us ~]) + (mold %get /statuses/lookup {us $~}) -- -- diff --git a/sur/twitter.hoon b/sur/twitter.hoon index 9c8395f33..141329dbb 100644 --- a/sur/twitter.hoon +++ b/sur/twitter.hoon @@ -1,13 +1,13 @@ |% -++ stat ,[id=@u who=@ta now=@da txt=@t] :: recieved tweet +++ stat {id/@u who/@ta now/@da txt/@t} :: recieved tweet ++ keys :: twitter-key type - $: con=[tok=@t sec=@t] :: user key pair - acc=[tok=@t sec=@t] :: app key pair + $: con/{tok/@t sec/@t} :: user key pair + acc/{tok/@t sec/@t} :: app key pair == :: ++ command :: poke action - $% [%auth p=keys] :: set API keys - [%post p=@uvI q=cord] :: post a tweet + $% {$auth p/keys} :: set API keys + {$post p/@uvI q/cord} :: post a tweet == ++ sur-twit . :: XX --