card

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	HtmlTitle       string
	MetaTitle       string
	MetaDescription string

	FacebookTitle       string
	FacebookDescription string
	FacebookImageURL    string
	FacebookSiteName    string
	FacebookURL         string

	TwitterTitle       string
	TwitterDescription string
	TwitterImageURL    string
	TwitterURL         string

	Response *http.Response
	Document *goquery.Document
}

Card scrapes the information of social media card.

func NewCard

func NewCard(rawurl string) (*Card, error)

NewCard downloads card information from the url.

func (*Card) Description

func (c *Card) Description() string

Description retrieves the suitable card description.

func (*Card) Image

func (c *Card) Image() ([]byte, error)

Image returns the image content at ImageURL.

func (*Card) ImageURL

func (c *Card) ImageURL() string

ImageURL retrieves the suitable card image url.

func (*Card) Title

func (c *Card) Title() string

Title retrieves the suitable card title.

func (*Card) URL

func (c *Card) URL() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL