Documentation ¶
Index ¶
- Constants
- func GetGiphyLongURL(shortURL string) (longURL string, err error)
- func GetURLContent(url string) (data []byte, err error)
- type GiphyOembedData
- type LinkPreviewData
- func GetGenericLinkPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetGiphyPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetGiphyShortURLPreviewData(shortURL string) (data LinkPreviewData, err error)
- func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetTenorPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetYoutubePreviewData(link string) (previewData LinkPreviewData, err error)
- type Site
- type TenorOembedData
- type YoutubeOembedData
Constants ¶
View Source
const GiphyOembedLink = "https://giphy.com/services/oembed?url=%s"
View Source
const TenorOembedLink = "https://tenor.com/oembed?url=%s"
View Source
const YoutubeOembedLink = "https://www.youtube.com/oembed?format=json&url=%s"
Variables ¶
This section is empty.
Functions ¶
func GetGiphyLongURL ¶ added in v0.70.0
Giphy has a shortener service called gph.is, the oembed service doesn't work with shortened urls, so we need to fetch the long url first
func GetURLContent ¶
Types ¶
type GiphyOembedData ¶ added in v0.70.0
type GiphyOembedData struct { ProviderName string `json:"provider_name"` Title string `json:"title"` URL string `json:"url"` Height int `json:"height"` Width int `json:"width"` }
func GetGiphyOembed ¶ added in v0.70.0
func GetGiphyOembed(url string) (data GiphyOembedData, err error)
type LinkPreviewData ¶
type LinkPreviewData struct { Site string `json:"site" meta:"og:site_name"` Title string `json:"title" meta:"og:title"` ThumbnailURL string `json:"thumbnailUrl" meta:"og:image"` ContentType string `json:"contentType"` Height int `json:"height"` Width int `json:"width"` }
func GetGenericLinkPreviewData ¶ added in v0.71.1
func GetGenericLinkPreviewData(link string) (previewData LinkPreviewData, err error)
func GetGiphyPreviewData ¶ added in v0.70.0
func GetGiphyPreviewData(link string) (previewData LinkPreviewData, err error)
func GetGiphyShortURLPreviewData ¶ added in v0.70.0
func GetGiphyShortURLPreviewData(shortURL string) (data LinkPreviewData, err error)
func GetLinkPreviewData ¶
func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error)
func GetTenorPreviewData ¶ added in v0.70.0
func GetTenorPreviewData(link string) (previewData LinkPreviewData, err error)
func GetYoutubePreviewData ¶
func GetYoutubePreviewData(link string) (previewData LinkPreviewData, err error)
type Site ¶
type Site struct { Title string `json:"title"` Address string `json:"address"` ImageSite bool `json:"imageSite"` }
func LinkPreviewWhitelist ¶
func LinkPreviewWhitelist() []Site
type TenorOembedData ¶ added in v0.70.0
type TenorOembedData struct { ProviderName string `json:"provider_name"` ThumbnailURL string `json:"thumbnail_url"` AuthorName string `json:"author_name"` Height int `json:"height"` Width int `json:"width"` }
func GetTenorOembed ¶ added in v0.70.0
func GetTenorOembed(url string) (data TenorOembedData, err error)
type YoutubeOembedData ¶ added in v0.70.0
type YoutubeOembedData struct { ProviderName string `json:"provider_name"` Title string `json:"title"` ThumbnailURL string `json:"thumbnail_url"` }
func GetYoutubeOembed ¶
func GetYoutubeOembed(url string) (data YoutubeOembedData, err error)
Click to show internal directories.
Click to hide internal directories.