mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 18:31:44 +03:00
a95449cc64
Stores URLs and their titles for the local ship. Can listen to "submissions" on foreign ships. Has a primitive perspective on groups, treating them as always-interesting. Auto-subscribes to all ships in all groups. Foreign communications untested.
50 lines
851 B
Plaintext
50 lines
851 B
Plaintext
:: 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))
|
|
==
|
|
::
|
|
++ en-json
|
|
=, enjs:format
|
|
|%
|
|
++ page
|
|
|= =^page
|
|
^- json
|
|
%- pairs
|
|
:~ 'title'^s+title.page
|
|
'url'^s+url.page
|
|
'timestamp'^(time time.page)
|
|
==
|
|
--
|
|
::
|
|
++ de-json
|
|
=, dejs:format
|
|
|%
|
|
++ action
|
|
|= =json
|
|
^- ^action
|
|
?> ?=([%o [%add *] ~ ~] json)
|
|
:- %add ::TODO +of doesn't please type system?
|
|
%. q.n.p.json
|
|
(ot 'path'^pa 'title'^so 'url'^so ~)
|
|
--
|
|
--
|