go-frameproto/writeframeposturl.go

22 lines
629 B
Go
Raw Normal View History

2024-02-13 17:02:16 +00:00
package frameproto
import (
"io"
)
// WriteFramePostURL will write the HTML <meta/> element for the Frame-Protocol's (i.e., Farcaster Frame's) "fc:frame:post_url" name-value pair.
//
// For example, this call:
//
// var url string = "https://example.com/my/post/path.php"
//
2024-02-13 18:03:14 +00:00
// frameproto.WriteFramePostURL(writer, url)
2024-02-13 17:02:16 +00:00
//
// Would write this HTML <meta/> element:
//
// <meta property="fc:frame:post_url" content="https://example.com/my/post/path.php" />
2024-02-15 17:43:14 +00:00
func WriteFramePostURL(writer io.Writer, url string) error {
2024-02-13 17:02:16 +00:00
const property string = MetaPropertyFramePostURL
2024-02-15 17:43:14 +00:00
return writeMetaPropertyContent(writer, property, url)
2024-02-13 17:02:16 +00:00
}