2019-11-19 19:26:05 +03:00
|
|
|
:: link: social bookmarking
|
|
|
|
::
|
|
|
|
/- *link
|
|
|
|
::
|
|
|
|
|%
|
|
|
|
++ site-from-url
|
|
|
|
|= =url
|
|
|
|
^- site
|
|
|
|
=/ murl=(unit purl:eyre)
|
|
|
|
(de-purl:html url)
|
|
|
|
?~ murl 'http://example.com'
|
|
|
|
%^ cat 3
|
|
|
|
:: render protocol
|
|
|
|
::
|
|
|
|
=* sec p.p.u.murl
|
|
|
|
?:(sec 'https://' 'http://')
|
|
|
|
:: render host
|
|
|
|
::
|
|
|
|
=* host r.p.u.murl
|
|
|
|
?- -.host
|
|
|
|
%& (roll (join '.' p.host) (cury cat 3))
|
|
|
|
%| (rsh 3 1 (scot %if p.host))
|
|
|
|
==
|
|
|
|
::
|
2019-12-21 02:51:49 +03:00
|
|
|
++ split-discussion-path
|
|
|
|
|= =path
|
|
|
|
^- [=^path =url]
|
|
|
|
~| [%path-too-short path]
|
|
|
|
?> (gth (lent path) 1) ::TODO ?= would TMI
|
|
|
|
=/ end=@ud (dec (lent path))
|
2020-01-08 04:38:39 +03:00
|
|
|
:- (scag end path)
|
|
|
|
(de-base64:mimes:html (snag end path))
|
2019-12-21 02:51:49 +03:00
|
|
|
::
|
2019-11-19 19:26:05 +03:00
|
|
|
++ en-json
|
|
|
|
=, enjs:format
|
|
|
|
|%
|
2019-12-18 18:19:03 +03:00
|
|
|
++ submission
|
|
|
|
|= sub=^submission
|
|
|
|
^- json
|
|
|
|
=+ p=(page +.sub)
|
|
|
|
?> ?=([%o *] p)
|
|
|
|
o+(~(put by p.p) 'ship' (ship ship.sub))
|
|
|
|
::
|
2019-11-19 19:26:05 +03:00
|
|
|
++ page
|
|
|
|
|= =^page
|
|
|
|
^- json
|
|
|
|
%- pairs
|
|
|
|
:~ 'title'^s+title.page
|
|
|
|
'url'^s+url.page
|
|
|
|
'timestamp'^(time time.page)
|
|
|
|
==
|
2019-12-21 02:51:49 +03:00
|
|
|
::
|
|
|
|
++ comment
|
|
|
|
|= =^comment
|
|
|
|
^- json
|
|
|
|
%- pairs
|
|
|
|
:~ 'ship'^(ship ship.comment)
|
|
|
|
'time'^(time time.comment)
|
|
|
|
'udon'^s+udon.comment ::TODO convert?
|
|
|
|
==
|
2019-11-19 19:26:05 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
++ de-json
|
|
|
|
=, dejs:format
|
|
|
|
|%
|
2019-12-21 02:51:49 +03:00
|
|
|
:: +action: json into action
|
|
|
|
::
|
|
|
|
:: formats:
|
|
|
|
:: {save: {path: '/path', title: 'title', url: 'url'}}
|
|
|
|
:: {note: {path: '/path', url: 'url', udon: 'text, maybe udon'}}
|
|
|
|
::
|
2019-11-19 19:26:05 +03:00
|
|
|
++ action
|
|
|
|
|= =json
|
|
|
|
^- ^action
|
2019-12-21 02:51:49 +03:00
|
|
|
::TODO the type system doesn't like +of here?
|
|
|
|
?+ json ~|(json !!)
|
|
|
|
[%o [%save *] ~ ~]
|
|
|
|
:- %save
|
|
|
|
%. q.n.p.json
|
|
|
|
(ot 'path'^pa 'title'^so 'url'^so ~)
|
|
|
|
::
|
|
|
|
[%o [%note *] ~ ~]
|
|
|
|
:- %note
|
|
|
|
%. q.n.p.json
|
|
|
|
(ot 'path'^pa 'url'^so 'udon'^so ~)
|
|
|
|
==
|
2019-11-19 19:26:05 +03:00
|
|
|
--
|
|
|
|
--
|