Documentation ¶
Index ¶
- func JSONLD(URL string, htmlContent string) ([]map[string]interface{}, []error)
- func ParseOpenGraph(URL string, htmlContent string) (interface{}, []error)
- func ParseXCards(URL string, htmlContent string) (interface{}, []error)
- type Article
- type Book
- type MicrodataItem
- type Music
- type MusicSong
- type OpenGraph
- type OpenGraphAudio
- type OpenGraphImage
- type OpenGraphVideo
- type Profile
- type Video
- type VideoActor
- type XCards
- type XCardsAudio
- type XCardsImage
- type XCardsVideo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseOpenGraph ¶
func ParseXCards ¶
Types ¶
type Article ¶
type Article struct { PublishedTime time.Time `json:"article:published_time,omitempty"` ModifiedTime time.Time `json:"article:modified_time,omitempty"` ExpirationTime time.Time `json:"article:expiration_time,omitempty"` Author []string `json:"article:author,omitempty"` Section string `json:"article:section,omitempty"` Tag []string `json:"article:tag,omitempty"` }
Article represents article-specific metadata
type Book ¶
type Book struct { Author []string `json:"book:author,omitempty"` ISBN string `json:"book:isbn,omitempty"` ReleaseDate time.Time `json:"book:release_date,omitempty"` Tag []string `json:"book:tag,omitempty"` }
Book represents book-specific metadata
type MicrodataItem ¶
type MicrodataItem struct { Type string `json:"type,omitempty"` ID *string `json:"id,omitempty"` Properties map[string]interface{} `json:"properties,omitempty"` }
func W3CMicrodata ¶
func W3CMicrodata(URL string, htmlContent string) ([]MicrodataItem, []error)
type Music ¶
type Music struct { Duration int `json:"music:duration,omitempty"` Album string `json:"music:album,omitempty"` AlbumDisc int `json:"music:album:disc,omitempty"` AlbumTrack int `json:"music:album:track,omitempty"` Musician []string `json:"music:musician,omitempty"` Song []MusicSong `json:"music:song,omitempty"` Creator []string `json:"music:creator,omitempty"` ReleaseDate string `json:"music:release_date,omitempty"` }
Music represents music-specific metadata
type OpenGraph ¶
type OpenGraph struct { // Basic metadata Type string `json:"og:type"` Title string `json:"og:title"` URL string `json:"og:url"` // Optional metadata Description string `json:"og:description,omitempty"` Determiner string `json:"og:determiner,omitempty"` Locale string `json:"og:locale,omitempty"` LocaleAlternate []string `json:"og:locale:alternate,omitempty"` SiteName string `json:"og:site_name,omitempty"` // Media OpenGraphImage []OpenGraphImage `json:"og:image,omitempty"` OpenGraphVideo []OpenGraphVideo `json:"og:video,omitempty"` OpenGraphAudio []OpenGraphAudio `json:"og:audio,omitempty"` // Music specific Music *Music `json:"music,omitempty"` // Video specific Video *Video `json:"video,omitempty"` // Article specific Article *Article `json:"article,omitempty"` // Book specific Book *Book `json:"book,omitempty"` // Profile specific Profile *Profile `json:"profile,omitempty"` }
func NewOpenGraph ¶
func NewOpenGraph() *OpenGraph
NewOpenGraph creates a new OpenGraph instance with basic initialization
type OpenGraphAudio ¶
type OpenGraphAudio struct { URL string `json:"og:audio"` SecureURL string `json:"og:audio:secure_url,omitempty"` Type string `json:"og:audio:type,omitempty"` }
OpenGraphAudio represents OpenGraph audio object
type OpenGraphImage ¶
type OpenGraphImage struct { URL string `json:"og:image"` SecureURL string `json:"og:image:secure_url,omitempty"` Type string `json:"og:image:type,omitempty"` Width int `json:"og:image:width,omitempty"` Height int `json:"og:image:height,omitempty"` Alt string `json:"og:image:alt,omitempty"` }
OpenGraphImage represents OpenGraph image object
type OpenGraphVideo ¶
type OpenGraphVideo struct { URL string `json:"og:video"` SecureURL string `json:"og:video:secure_url,omitempty"` Type string `json:"og:video:type,omitempty"` Width int `json:"og:video:width,omitempty"` Height int `json:"og:video:height,omitempty"` }
OpenGraphVideo represents OpenGraph video object
type Profile ¶
type Profile struct { FirstName string `json:"profile:first_name,omitempty"` LastName string `json:"profile:last_name,omitempty"` Username string `json:"profile:username,omitempty"` Gender string `json:"profile:gender,omitempty"` }
Profile represents profile-specific metadata
type Video ¶
type Video struct { Duration int `json:"video:duration,omitempty"` Actor []VideoActor `json:"video:actor,omitempty"` Director []string `json:"video:director,omitempty"` Writer []string `json:"video:writer,omitempty"` ReleaseDate time.Time `json:"video:release_date,omitempty"` Tag []string `json:"video:tag,omitempty"` Series string `json:"video:series,omitempty"` }
type VideoActor ¶
type XCards ¶
type XCards struct { // X specific metadata Card string `json:"twitter:card,omitempty"` Site string `json:"twitter:site,omitempty"` Creator string `json:"twitter:creator,omitempty"` // Basic Metadata Type string `json:"twitter:type,omitempty"` Title string `json:"twitter:title,omitempty"` URL string `json:"twitter:url,omitempty"` // Optional metadata Description string `json:"twitter:description,omitempty"` Determiner string `json:"twitter:determiner,omitempty"` Locale string `json:"twitter:locale,omitempty"` LocaleAlternate []string `json:"twitter:locale:alternate,omitempty"` SiteName string `json:"twitter:site_name,omitempty"` // Media OpenGraphImage []OpenGraphImage `json:"og:image,omitempty"` OpenGraphAudio []OpenGraphAudio `json:"og:audio,omitempty"` OpenGraphVideo []OpenGraphVideo `json:"og:video,omitempty"` XCardsImage []XCardsImage `json:"twitter:image,omitempty"` XCardsAudio []XCardsAudio `json:"twitter:audio,omitempty"` XCardsVideo []XCardsVideo `json:"twitter:video,omitempty"` // Music specific Music *Music `json:"music,omitempty"` // Video specific Video *Video `json:"video,omitempty"` // Article specific Article *Article `json:"article,omitempty"` // Book specific Book *Book `json:"book,omitempty"` // Profile specific Profile *Profile `json:"profile,omitempty"` }
type XCardsAudio ¶
type XCardsAudio struct { URL string `json:"twitter:audio"` SecureURL string `json:"twitter:audio:secure_url,omitempty"` Type string `json:"twitter:audio:type,omitempty"` }
XCardsAudio represents XCards audio object
type XCardsImage ¶
type XCardsImage struct { URL string `json:"twitter:image"` SecureURL string `json:"twitter:image:secure_url,omitempty"` Type string `json:"twitter:image:type,omitempty"` Width int `json:"twitter:image:width,omitempty"` Height int `json:"twitter:image:height,omitempty"` Alt string `json:"twitter:image:alt,omitempty"` }
XCardsImage represents XCards image object
type XCardsVideo ¶
type XCardsVideo struct { URL string `json:"twitter:video"` SecureURL string `json:"twitter:video:secure_url,omitempty"` Type string `json:"twitter:video:type,omitempty"` Width int `json:"twitter:video:width,omitempty"` Height int `json:"twitter:video:height,omitempty"` }
XCardsVideo represents XCards video object
Click to show internal directories.
Click to hide internal directories.