Liking cljdoc? Tell your friends :D

dk.simongray.podcast.comments.nostr

Threads of comments on Nostr, read from relays.

A thread has one of two kinds of root:

  • a note, which podcast:socialInteract names by a nostr: URI of NIP-21 or by a name of NIP-19, such as nevent1… or note1…
  • the episode or the show itself, by the id that NIP-73 gives it, such as podcast:item:guid:…

No post is the root of the thread of an episode or a show, so its root is a comment without content.

The comments are the text notes of kind 1, with the replies of NIP-10, and the comments of kind 1111 of NIP-22. The authors are the events of kind 0 of NIP-01, and an event of kind 5 of NIP-09 deletes a comment of its author.

A relay can send anything. So a reading keeps only the events whose signatures verify and that pass a filter of the request. A thread counts the events that it left out, and the report tells the count.

The relays are those that the root names, and then the :relays of the options, or the default ones. Each relay gets the same questions, and an event that two relays give is one comment.

Threads of comments on Nostr, read from relays.

A thread has one of two kinds of root:

- a note, which podcast:socialInteract names by a nostr: URI of NIP-21
  or by a name of NIP-19, such as nevent1… or note1…
- the episode or the show itself, by the id that NIP-73 gives it, such
  as podcast:item:guid:…

No post is the root of the thread of an episode or a show, so its root
is a comment without content.

The comments are the text notes of kind 1, with the replies of NIP-10,
and the comments of kind 1111 of NIP-22. The authors are the events of
kind 0 of NIP-01, and an event of kind 5 of NIP-09 deletes a comment of
its author.

A relay can send anything. So a reading keeps only the events whose
signatures verify and that pass a filter of the request. A thread
counts the events that it left out, and the report tells the count.

The relays are those that the root names, and then the :relays of the
options, or the default ones. Each relay gets the same questions, and
an event that two relays give is one comment.
raw docstring

aboutclj/s

(about feed)
(about feed item)
(about feed item {:keys [url] :as opts})

The unread thread of the comments about feed, or about its item, by the id that NIP-73 gives a show and an episode, with opts. It's nil for a show or an episode without a guid.

The id of a show is podcast:guid: and its podcast:guid, and the :url of opts is the URL of a feed that declares none. The id of an episode is podcast:item:guid: and the guid of the item.

Such a thread isn't the thread that the podcaster names. When a podcast:socialInteract has the protocol disabled, the podcaster wants no public comments shown.

The unread thread of the comments about `feed`, or about its `item`, by
the id that NIP-73 gives a show and an episode, with `opts`. It's nil
for a show or an episode without a guid.

The id of a show is podcast:guid: and its podcast:guid, and the :url of
`opts` is the URL of a feed that declares none. The id of an episode is
podcast:item:guid: and the guid of the item.

Such a thread isn't the thread that the podcaster names. When a
podcast:socialInteract has the protocol disabled, the podcaster wants
no public comments shown.
sourceraw docstring

batch-sizeclj/s

The most ids or public keys in one filter of a request. The option :batch-size gives another number.

The most ids or public keys in one filter of a request. The option
:batch-size gives another number.
sourceraw docstring

comment-eventclj/s

(comment-event thread content)
(comment-event {:keys [uri] :as thread}
               content
               {:keys [kind url] :or {kind 1111} :as opts})

The event of a new comment with the text content at the root of thread, with the opts below, to post with post!. It has no time and no signature yet.

On a show or an episode, it's a comment of kind 1111 of NIP-22 with the id of NIP-73, or with :kind 1 a note with the id in an i tag, as the app Fountain writes it. On a note, it's a reply of kind 1 of NIP-10.

  • :kind, 1111 or 1, for a thread about a show or an episode
  • :url, the web page of the episode, a hint for other apps
The event of a new comment with the text `content` at the root of
`thread`, with the `opts` below, to post with post!. It has no time and
no signature yet.

On a show or an episode, it's a comment of kind 1111 of NIP-22 with the
id of NIP-73, or with :kind 1 a note with the id in an i tag, as the app
Fountain writes it. On a note, it's a reply of kind 1 of NIP-10.

- :kind, 1111 or 1, for a thread about a show or an episode
- :url, the web page of the episode, a hint for other apps
sourceraw docstring

delete-eventclj/s

(delete-event thread id)
(delete-event thread id reason)

The event that asks the relays to delete the comment id of thread, with the text reason for its readers, to post with post! and the key of its author. It's nil when the thread has no event of that comment.

The event that asks the relays to delete the comment `id` of `thread`,
with the text `reason` for its readers, to post with post! and the key
of its author. It's nil when the thread has no event of that comment.
sourceraw docstring

post!clj/s

(post! thread event signer)
(post! thread
       event
       signer
       {:keys [send allow-pred now-fn]
        :or {send nostr/send! allow-pred nostr/public? now-fn time/now}
        :as opts})

Sign event with signer, and give it to the relays of thread with opts. It gives the signed event and what each relay did with it, or a map with a diagnostic under :error. On the JVM it gives the result, and in ClojureScript a promise of it.

{:event  {…}
 :relays {"wss://relay.example" {:accepted? true}
          "wss://other.example" {:refused "blocked: …"}}}

The event gets the time of now, unless it has one. The relays are those that the root of the thread names, and then the :relays of opts, or the default ones, and each gets the event at once. A result has :nostr/not-published under :error when no relay took the event, and the error of the signer when it didn't sign. The opts are these:

  • :relays, in place of the default relays
  • :send, a function that sends a request map to a relay, in place of nostr/send!
  • :allow-pred, a predicate of the URL of a relay, nostr/public? by default
  • :timeout-seconds, for each relay
  • :now-fn, a function that gives the instant of now, the clock by default
Sign `event` with `signer`, and give it to the relays of `thread` with
`opts`. It gives the signed event and what each relay did with it, or a
map with a diagnostic under :error. On the JVM it gives the result, and
in ClojureScript a promise of it.

    {:event  {…}
     :relays {"wss://relay.example" {:accepted? true}
              "wss://other.example" {:refused "blocked: …"}}}

The event gets the time of now, unless it has one. The relays are those
that the root of the thread names, and then the :relays of `opts`, or
the default ones, and each gets the event at once. A result has
:nostr/not-published under :error when no relay took the event, and the
error of the signer when it didn't sign. The `opts` are these:

- :relays, in place of the default relays
- :send, a function that sends a request map to a relay, in place of
  nostr/send!
- :allow-pred, a predicate of the URL of a relay, nostr/public? by
  default
- :timeout-seconds, for each relay
- :now-fn, a function that gives the instant of now, the clock by default
sourceraw docstring

reaction-eventclj/s

(reaction-event thread id)
(reaction-event {:keys [uri] :as thread} id content)

The event of the reaction content to the comment id of thread, to post with post!. A + is a like, the reaction without content. It's nil when the thread has no event of that comment.

A reaction to the show or the episode at the root of a thread about one is of kind 17, with its id of NIP-73.

The event of the reaction `content` to the comment `id` of `thread`, to
post with post!. A + is a like, the reaction without `content`. It's nil
when the thread has no event of that comment.

A reaction to the show or the episode at the root of a thread about one
is of kind 17, with its id of NIP-73.
sourceraw docstring

relaysclj/s

The relays that podcast-clj asks for comments when neither the root of a thread nor the options name a relay. The page doc/services.md tells when each relay answered.

The relays that podcast-clj asks for comments when neither the root of
a thread nor the options name a relay. The page doc/services.md tells
when each relay answered.
sourceraw docstring

relays-ofclj/s

(relays-of thread)
(relays-of {:keys [uri] :as thread} opts)

The relays that a reading of thread asks, and that post! gives an event to, with opts: those that the name of its root gives, and then the :relays of opts, or relays.

The relays that a reading of `thread` asks, and that post! gives an
event to, with `opts`: those that the name of its root gives, and then
the :relays of `opts`, or relays.
sourceraw docstring

reply-eventclj/s

(reply-event {:keys [root] :as thread} id content)

The event of the text content that replies to the comment id of thread, which a reading gave, to post with post!. It has no time and no signature yet, and it's nil when the thread has no event of that comment.

A reply to a comment of kind 1111 is one too, with the root scope of its parent, as NIP-22 defines it. A reply to a note of kind 1 is a note, with the e tags of NIP-10 that name the root of its thread and the note. A reply to the root of the thread is comment-event.

The event of the text `content` that replies to the comment `id` of
`thread`, which a reading gave, to post with post!. It has no time and
no signature yet, and it's nil when the thread has no event of that
comment.

A reply to a comment of kind 1111 is one too, with the root scope of its
parent, as NIP-22 defines it. A reply to a note of kind 1 is a note,
with the e tags of NIP-10 that name the root of its thread and the note.
A reply to the root of the thread is comment-event.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close