Posting tweets

This commit is contained in:
Anton Dyudin 2015-01-26 20:30:22 -08:00
parent 83007d6c30
commit f00f2a744e
5 changed files with 54 additions and 22 deletions

View File

@ -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)]
==

View File

@ -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 !!

View File

@ -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
--
!:
::::

View File

@ -4,6 +4,7 @@
::
/? 314
/- *twitter
=+ twit
!:
:::: functions
::

View File

@ -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
==
--
--