From f00f2a744e4097936bb0f990f3b0e2ebfa55c584 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 26 Jan 2015 20:30:22 -0800 Subject: [PATCH] Posting tweets --- main/app/rodeo/core.hook | 46 +++++++++++++++++++++++++++++--------- main/app/talk/core.hook | 1 + main/app/twit/core.hook | 4 ++-- main/lib/twitter/core.hook | 1 + main/sur/twitter/core.hook | 24 +++++++++++--------- 5 files changed, 54 insertions(+), 22 deletions(-) diff --git a/main/app/rodeo/core.hook b/main/app/rodeo/core.hook index 37b7d0eeb3..1641ba3a04 100644 --- a/main/app/rodeo/core.hook +++ b/main/app/rodeo/core.hook @@ -2,7 +2,7 @@ :::: /hook/core/rodeo/app :: /? 314 -/- *rodeo +/- *rodeo, *twitter /+ rodeo :: :::: @@ -60,11 +60,15 @@ $: %g :: application $% [%mean p=ares] :: cancel [%nice ~] :: acknowledge - [%rush %rodeo-report report] :: refresh + [%rush p=silt] :: subs data == == :: $: %t :: $% [%wake ~] :: timer wakeup == == == :: + ++ silt + $% [%rodeo-report p=report] :: refresh + [%twit-stat p=twit-stat] :: tweet reciept + == ++ move ,[p=bone q=(mold note gift)] :: all actions ++ hapt ,[p=ship q=path] :: app instance ++ note :: requests @@ -84,7 +88,7 @@ $% [%wait p=@da] :: == == == :: ++ twim :: twitter endpoints - $%([%mine p=span] [%stat p=@uv]) :: + $%([%stat p=@uv]) :: -- |_ [hid=hide house] ++ ra :: transaction core @@ -176,7 +180,13 @@ ++ ra-twitter :: %twitter response |= [met=twim sih=sign] ^+ +> - !! + ?+ sih ~&([%rodeo-bad-twitter sih] !!) + [%g ?(%nice %mean) ~] + +> + [%g %rush %twit-stat *] + ~& got-tweet/p.p.sih + +> + == :: ++ ra-repeat :: %repeat response |= [num=@ud her=ship man=span sih=sign] @@ -267,7 +277,7 @@ %| ?. pub +> ?- -.p.tay %twitter - !! + (ra-tweet p.p.tay tip) == == :: ++ ra-record :: add to story @@ -294,6 +304,22 @@ == +>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tip)) :: + ++ ra-tweet :: send to /twit + |= [who=span sey=serial * sta=statement] + ~! sta + ?> ?=(%lin -.r.sta) + %^ ra-emil + :* ost + %pass /twitter/stat/(scot %uv sey) + %g %mess + [our.hid /twit] our.hid + [%twit-do !>(`twit-do`[who %post sey q.r.sta])] + == + :* ost + %pass /twitter/stat/(scot %uv sey) + [%g %show [our.hid /twit] our.hid /post/(scot %uv sey)] + == + ~ ++ pa :: story core |_ $: man=span story @@ -369,10 +395,10 @@ :_ ~ :- /friend/show/[man]/(scot %p p.p.tay)/[q.p.tay] [%g %took [p.p.tay /rodeo] our.hid] - ?+ -.+>+.sih ~&([%rodeo-odd-friend sih] !!) + ?+ -.p.p.sih ~&([%rodeo-odd-friend sih] !!) %config +>.$ - %group (pa-remind tay +.+>+.sih) - %grams (pa-lesson q.+.+>+.sih) + %group (pa-remind tay +.p.p.sih) + %grams (pa-lesson q.+.p.p.sih) == == :: @@ -618,8 +644,8 @@ =- ra-abet:(~(ra-twitter ra ost ~) met sih) ^= met ?+ t.pax ~& [%rodeo-twitter-strange-path pax] !! - [%mine @ @ ~] - [i.t.pax i.t.t.t.pax] + :: [%mine @ @ ~] + :: [i.t.pax i.t.t.t.pax] [%stat @ ~] [i.t.pax (slav %uv i.t.t.pax)] == diff --git a/main/app/talk/core.hook b/main/app/talk/core.hook index 35b7ef0cf6..f173789ac4 100644 --- a/main/app/talk/core.hook +++ b/main/app/talk/core.hook @@ -597,6 +597,7 @@ ++ pour |= [ost=bone pax=path sih=*] ^- [(list move) _+>] + ~| sign=sih => .(sih ((hard sign) sih)) :: ~& talk-pour/sih ?~ pax ~& talk-pour-strange-path/pax !! diff --git a/main/app/twit/core.hook b/main/app/twit/core.hook index 7242edc6ac..72a7e4603b 100644 --- a/main/app/twit/core.hook +++ b/main/app/twit/core.hook @@ -16,7 +16,7 @@ :: ++ axle :: app state $: %0 - kes=(map span keys) :: auth + kes=(map span keys:twit-do) :: auth out=(map ,@uvI (each ,[span cord] stat)) :: sent tweets ran=(map path ,[p=@ud q=@da]) :: polls active fed=(jar path stat) :: feed cache @@ -44,7 +44,7 @@ [%t %wake ~] :: timeout ping == :: -++ stat ,[id=@u who=@ta now=@da txt=@t] :: recieved tweet +++ stat twit-stat :: recieved tweet -- !: :::: diff --git a/main/lib/twitter/core.hook b/main/lib/twitter/core.hook index 3152e6f387..db903cf581 100644 --- a/main/lib/twitter/core.hook +++ b/main/lib/twitter/core.hook @@ -4,6 +4,7 @@ :: /? 314 /- *twitter +=+ twit !: :::: functions :: diff --git a/main/sur/twitter/core.hook b/main/sur/twitter/core.hook index 1780f24049..bd3447fbec 100644 --- a/main/sur/twitter/core.hook +++ b/main/sur/twitter/core.hook @@ -1,12 +1,16 @@ |% -++ twit-do ,[p=span q=command] :: user and action -++ command :: poke action - $% [%auth p=keys] :: set API keys - [%post p=@uvI q=cord] :: post a tweet - == -:: -++ keys :: twitter-key type - $: con=[tok=@t sec=@t] :: user key pair - acc=[tok=@t sec=@t] :: app key pair - == +++ twit-do => twit ,[p=span q=command] :: user and action +++ twit-stat ,[id=@u who=@ta now=@da txt=@t] :: recieved tweet +++ twit + |% + ++ keys :: twitter-key type + $: 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 + == + -- --