mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-09-27 20:16:57 +02:00
NIP-25: Add External Content Reactions (#2020)
This commit is contained in:
28
25.md
28
25.md
@@ -45,25 +45,39 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: S
|
||||
}
|
||||
```
|
||||
|
||||
Reactions to a website
|
||||
External Content Reactions
|
||||
---------------------
|
||||
|
||||
If the target of the reaction is a website, the reaction MUST be a `kind 17` event and MUST include an `r` tag with the website's URL.
|
||||
If the target of a reaction is not a native nostr event, the reaction MUST be a `kind 17` event and MUST include [NIP-73](73.md) external content `k` + `i` tags to properly reference the content.
|
||||
|
||||
_Reacting to a website:_
|
||||
```jsonc
|
||||
{
|
||||
"kind": 17,
|
||||
"content": "⭐",
|
||||
"tags": [
|
||||
["r", "https://example.com/"]
|
||||
["k", "web"],
|
||||
["i", "https://example.com"]
|
||||
],
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
URLs SHOULD be [normalized](https://datatracker.ietf.org/doc/html/rfc3986#section-6), so that reactions to the same website are not omitted from queries.
|
||||
A fragment MAY be attached to the URL, to react to a section of the page.
|
||||
It should be noted that a URL with a fragment is not considered to be the same URL as the original.
|
||||
_Reacting to a podcast episode:_
|
||||
```jsonc
|
||||
{
|
||||
"kind": 17,
|
||||
"content": "+",
|
||||
"tags": [
|
||||
["k", "podcast:guid"],
|
||||
["i", "podcast:guid:917393e3-1b1e-5cef-ace4-edaa54e1f810", "https://fountain.fm/show/QRT0l2EfrKXNGDlRrmjL"],
|
||||
["k", "podcast:item:guid"],
|
||||
["i", "podcast:item:guid:PC20-229", "https://fountain.fm/episode/DQqBg5sD3qFGMCZoSuLF"]
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Custom Emoji Reaction
|
||||
---------------------
|
||||
|
Reference in New Issue
Block a user