Skip to content

Commit

Permalink
Add oEmbed discovery links into Stream builder
Browse files Browse the repository at this point in the history
  • Loading branch information
benpate committed Nov 8, 2024
1 parent 42e03d7 commit 84be404
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/builder_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,16 @@ func (w Stream) ETag() string {
return w._stream.ETag()
}

// OEmbedJSON returns the URL for the oEmbed JSON endpoint for this stream
func (w Stream) OEmbedJSON() string {
return w.Host() + "/.oembed?url=" + w.Permalink() + "&format=json"
}

// OEmbedXML returns the URL for the oEmbed XML endpoint for this stream
func (w Stream) OEmbedXML() string {
return w.Host() + "/.oembed?url=" + w.Permalink() + "&format=xml"
}

// HasGrandparent returns TRUE if the stream
func (w Stream) HasGrandparent() bool {
return w._stream.HasGrandparent()
Expand Down

0 comments on commit 84be404

Please sign in to comment.