2020-09-01 04:54:39 +03:00
|
|
|
:: link [landscape]:
|
|
|
|
::
|
|
|
|
:: social bookmarking
|
2019-11-19 19:26:05 +03:00
|
|
|
::
|
|
|
|
:: the paths under which links are submitted are generally expected to
|
|
|
|
:: correspond to existing group paths. for strictly-local collections of
|
|
|
|
:: links, arbitrary paths are probably fair game, but could trip up
|
|
|
|
:: primitive ui implementations.
|
|
|
|
::
|
2020-02-05 19:39:08 +03:00
|
|
|
:: urls in paths are expected to be encoded using +wood, for @ta sanity.
|
2020-02-07 23:43:11 +03:00
|
|
|
:: generally, use /lib/link's +build-discussion-path.
|
2020-02-05 19:39:08 +03:00
|
|
|
::
|
2019-12-21 02:51:49 +03:00
|
|
|
:: see link-listen-hook to see what's synced in, and similarly
|
|
|
|
:: see link-proxy-hook to see what's exposed.
|
|
|
|
::
|
2019-11-19 19:26:05 +03:00
|
|
|
:: scry and subscription paths:
|
|
|
|
::
|
2020-02-07 23:43:11 +03:00
|
|
|
:: (map path pages) %local-pages
|
2020-01-15 04:46:24 +03:00
|
|
|
:: /local-pages our saved pages
|
|
|
|
:: /local-pages/some-path our saved pages on path
|
|
|
|
::
|
2020-02-07 23:43:11 +03:00
|
|
|
:: (map path submissions) %submissions
|
2020-01-15 04:46:24 +03:00
|
|
|
:: /submissions all submissions we've seen
|
|
|
|
:: /submissions/some-path all submissions we've seen on path
|
|
|
|
::
|
2020-02-07 23:43:11 +03:00
|
|
|
:: (map path (map url notes)) %annotations
|
2020-01-15 04:46:24 +03:00
|
|
|
:: /annotations our comments
|
2020-02-05 19:39:08 +03:00
|
|
|
:: /annotations/wood-url our comments on url
|
|
|
|
:: /annotations/wood-url/some-path our comments on url on path
|
2020-01-15 04:46:24 +03:00
|
|
|
:: /annotations//some-path our comments on path
|
|
|
|
::
|
2020-02-07 23:43:11 +03:00
|
|
|
:: (map path (map url comments)) %discussions
|
2020-01-15 04:46:24 +03:00
|
|
|
:: /discussions all comments
|
2020-02-05 19:39:08 +03:00
|
|
|
:: /discussions/wood-url all comments on url
|
|
|
|
:: /discussions/wood-url/some-path all comments on url on path
|
2020-01-15 04:46:24 +03:00
|
|
|
:: /discussions//some-path all comments on path
|
2019-11-19 19:26:05 +03:00
|
|
|
::
|
2020-02-07 23:49:16 +03:00
|
|
|
:: subscription-only paths:
|
|
|
|
::
|
|
|
|
:: [path url] %observation
|
|
|
|
:: /seen updates whenever an item is seen
|
|
|
|
::
|
|
|
|
:: scry-only paths:
|
|
|
|
::
|
2020-02-14 03:57:58 +03:00
|
|
|
::
|
|
|
|
:: (map path (set url))
|
|
|
|
:: /unseen the ones we haven't seen yet
|
|
|
|
::
|
2020-02-10 22:18:42 +03:00
|
|
|
:: (set url)
|
2020-02-14 03:54:16 +03:00
|
|
|
:: /unseen/some-path the ones we haven't seen here yet
|
2020-02-10 22:18:42 +03:00
|
|
|
::
|
2020-02-07 23:49:16 +03:00
|
|
|
:: ?
|
2020-02-10 22:18:42 +03:00
|
|
|
:: /seen/wood-url/some-path have we seen this here
|
2020-02-07 23:49:16 +03:00
|
|
|
::
|
2020-08-18 22:41:24 +03:00
|
|
|
/- *link, gra=graph-store, *resource
|
|
|
|
/+ store=link-store, graph-store, default-agent, verb, dbug
|
2019-11-19 19:26:05 +03:00
|
|
|
::
|
|
|
|
|%
|
2020-08-18 22:41:24 +03:00
|
|
|
+$ state-any $%(state-1 state-0)
|
|
|
|
+$ state-1 [%1 ~]
|
2019-11-19 19:26:05 +03:00
|
|
|
+$ state-0
|
|
|
|
$: %0
|
|
|
|
by-group=(map path links)
|
|
|
|
by-site=(map site (list [path submission]))
|
2020-01-15 04:46:24 +03:00
|
|
|
discussions=(per-path-url discussion)
|
2019-11-19 19:26:05 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ links
|
|
|
|
$: ::NOTE all lists by recency
|
|
|
|
=submissions
|
|
|
|
ours=pages
|
2020-02-07 23:49:16 +03:00
|
|
|
seen=(set url)
|
2019-11-19 19:26:05 +03:00
|
|
|
==
|
|
|
|
::
|
2019-12-21 02:51:49 +03:00
|
|
|
+$ discussion
|
|
|
|
$: =comments
|
|
|
|
ours=notes
|
|
|
|
==
|
|
|
|
::
|
2019-11-19 19:26:05 +03:00
|
|
|
+$ card card:agent:gall
|
|
|
|
--
|
|
|
|
::
|
2020-08-18 22:41:24 +03:00
|
|
|
=| state-1
|
2019-11-19 19:26:05 +03:00
|
|
|
=* state -
|
|
|
|
::
|
2020-01-29 21:21:40 +03:00
|
|
|
%- agent:dbug
|
2019-11-20 00:56:29 +03:00
|
|
|
%+ verb |
|
2019-11-19 19:26:05 +03:00
|
|
|
^- agent:gall
|
|
|
|
|_ =bowl:gall
|
2020-08-18 22:41:24 +03:00
|
|
|
+* this .
|
|
|
|
do ~(. +> bowl)
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
|
|
|
::
|
|
|
|
++ on-init on-init:def
|
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
|
|
|
|= old=vase
|
|
|
|
^- (quip card _this)
|
|
|
|
=/ s !<(state-any old)
|
|
|
|
?: ?=(%1 -.s)
|
|
|
|
[~ this(state s)]
|
|
|
|
::
|
|
|
|
:_ this(state *state-1)
|
|
|
|
=/ orm orm:graph-store
|
|
|
|
|^ ^- (list card)
|
2020-09-01 20:57:19 +03:00
|
|
|
%- zing
|
|
|
|
%+ turn ~(tap by by-group.s)
|
2020-08-18 22:41:24 +03:00
|
|
|
|= [=path =links]
|
2020-09-01 20:57:19 +03:00
|
|
|
^- (list card)
|
2020-08-18 22:41:24 +03:00
|
|
|
?. ?=([@ @ *] path)
|
|
|
|
(on-bad-path path links)
|
2020-09-01 20:57:19 +03:00
|
|
|
=/ =resource [(slav %p i.path) i.t.path]
|
|
|
|
:_ [(archive-graph resource)]~
|
|
|
|
%+ add-graph resource
|
2020-08-18 22:41:24 +03:00
|
|
|
^- graph:gra
|
|
|
|
%+ gas:orm ~
|
|
|
|
=/ comments (~(gut by discussions.s) path *(map url discussion))
|
|
|
|
%+ turn submissions.links
|
|
|
|
|= sub=submission
|
|
|
|
^- [atom node:gra]
|
|
|
|
:- time.sub
|
|
|
|
=/ contents ~[text+title.sub url+url.sub]
|
|
|
|
=/ parent-hash `@ux`(sham ~ ship.sub time.sub contents)
|
|
|
|
:- ^- post:gra
|
|
|
|
:* author=ship.sub
|
|
|
|
index=~[time.sub]
|
|
|
|
time-sent=time.sub
|
|
|
|
contents
|
|
|
|
hash=`parent-hash
|
|
|
|
signatures=~
|
2020-01-15 04:46:24 +03:00
|
|
|
==
|
2020-08-18 22:41:24 +03:00
|
|
|
^- internal-graph:gra
|
|
|
|
=/ dis (~(get by comments) url.sub)
|
|
|
|
?~ dis
|
|
|
|
[%empty ~]
|
|
|
|
:- %graph
|
|
|
|
^- graph:gra
|
|
|
|
%+ gas:orm ~
|
|
|
|
%+ turn comments.u.dis
|
|
|
|
|= [=ship =time udon=@t]
|
|
|
|
^- [atom node:gra]
|
|
|
|
:- time
|
|
|
|
:_ `internal-graph:gra`[%empty ~]
|
|
|
|
=/ contents ~[text+udon]
|
|
|
|
:* author=ship
|
|
|
|
index=~[time.sub time]
|
|
|
|
time-sent=time
|
|
|
|
contents
|
|
|
|
hash=``@ux`(sham `parent-hash ship time contents)
|
|
|
|
signatures=~
|
|
|
|
==
|
2020-01-10 23:55:42 +03:00
|
|
|
::
|
2020-08-18 22:41:24 +03:00
|
|
|
++ on-bad-path
|
|
|
|
|= [=path =links]
|
2020-09-14 22:49:41 +03:00
|
|
|
^- (list card)
|
2020-08-18 22:41:24 +03:00
|
|
|
~| discarding-malformed-links+[path links]
|
|
|
|
~
|
|
|
|
::
|
|
|
|
++ add-graph
|
|
|
|
|= [=resource =graph:gra]
|
|
|
|
^- card
|
2020-09-01 20:57:19 +03:00
|
|
|
%- poke-graph-store
|
2020-08-18 22:41:24 +03:00
|
|
|
[%0 now.bowl %add-graph resource graph `%graph-validator-link]
|
2020-09-01 20:57:19 +03:00
|
|
|
::
|
|
|
|
++ archive-graph
|
|
|
|
|= =resource
|
|
|
|
^- card
|
|
|
|
%- poke-graph-store
|
|
|
|
[%0 now.bowl %archive-graph resource]
|
|
|
|
::
|
|
|
|
++ poke-graph-store
|
|
|
|
|= =update:gra
|
|
|
|
^- card
|
|
|
|
:* %pass /migrate-link %agent [our.bowl %graph-store]
|
|
|
|
%poke %graph-update !>(update)
|
|
|
|
==
|
2020-01-15 04:46:24 +03:00
|
|
|
--
|
2019-12-21 02:51:49 +03:00
|
|
|
::
|
2020-08-18 22:41:24 +03:00
|
|
|
++ on-poke on-poke:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
++ on-watch on-watch:def
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-arvo on-arvo:def
|
|
|
|
++ on-fail on-fail:def
|
2019-11-19 19:26:05 +03:00
|
|
|
--
|