instagram

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InstagramURLPattern = regexp.MustCompile(`^https?://(?:www\.)?instagram\.com/(?:p|reel|stories)/[a-zA-Z0-9_-]+`)
	LikesRegex          = regexp.MustCompile(`^([0-9Kk\.,]+) likes`)
	CommentsRegex       = regexp.MustCompile(`,\s*([0-9Kk\.,]+)\s*comments`)
	UserRegex           = regexp.MustCompile(`-\s*(.*?)\s*on`)
	DateRegex           = regexp.MustCompile(`on\s(.*?):`)
	CaptionRegex        = regexp.MustCompile(`:\s*"(.*)"`)
)

Functions

This section is empty.

Types

type InstaService

type InstaService struct {
	Client        *http.Client
	Providers     []Provider
	FastVideoSave Provider
	TheSocialCat  Provider
}

func NewInsta

func NewInsta(client *http.Client) *InstaService

func (*InstaService) ExtractInstagramData

func (insta *InstaService) ExtractInstagramData(doc *goquery.Document) InstagramData

func (*InstaService) GetInfo

func (insta *InstaService) GetInfo(url string) (InstagramData, error)

func (*InstaService) GetProvider

func (i *InstaService) GetProvider(name string) (Provider, error)

func (*InstaService) ParseMetaDescription

func (insta *InstaService) ParseMetaDescription(descText string, data *InstagramData)

func (*InstaService) Stream

type InstagramData

type InstagramData struct {
	Username  string `json:"username"`
	Likes     string `json:"likes"`
	Comments  string `json:"comments"`
	Caption   string `json:"caption"`
	Date      string `json:"date"`
	Thumbnail string `json:"thumbnail"`
}

type Provider

type Provider interface {
	Name() string
	BaseURL() string
	Stream(url string) (providers.InstaStreamResult, error)
}

func DefaultProviders

func DefaultProviders(client *http.Client) []Provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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