Documentation ¶
Index ¶
Constants ¶
const ( //Error ErrIsNotInstagram = "Url domain is not instagram.com" InvalidLink = "Invalid Link" )
const ( //Types TypeImage = "GraphImage" TypeVideo = "GraphVideo" TypeSidecar = "GraphSidecar" //Errors InvalidJson = "Json is invalid" )
const ( //Errors ScriptNotFound = "Script window._sharedData not found" DontReadHtmlDoc = "Don`t read HTML document" )
const ( DontReadBody = "Body don`t read" InvalidStatusCode = "StatusCode != 200" )
const (
//ERROR
ErrMedias404 = "Medias not found"
)
Variables ¶
This section is empty.
Functions ¶
func GetAccountUrl ¶
Substitute username in link template
func GetUsernameFromUrl ¶
Parce link and get username URL should be like https://www.instagram.com/username/
Types ¶
type Account ¶
type Account struct { Id string Username string FullName string Biography string ExternalUrl string Followers uint32 Follows uint32 IsPrivate bool IsVerified bool MediaCount uint32 Image struct { ProfilePicUrl string ProfilePicUrlHd string } }
An Account describes an Instagram account info.
func GetAccountByUrl ¶
GetAccountByUrl try to find account by url.
func GetAccountByUsername ¶
Get Account Struct from username
type Media ¶
type Media struct { Id string Type string Caption string Shortcode string Comments int Dimensions struct { Height int Width int } DisplayUrl string Likes int IsVideo bool VideoViews int Resources []Resource Time time.Time }
An Medias describes an Instagram media info.
func GetLastMediasByUrl ¶
GetAccountMedia try to get slice of user's media from the main page by url.
func GetLastMediasByUsername ¶
GetAccountMedia try to get slice of user's media from the main page by username.
func GetMediaByShortCode ¶
GetMediaByShortCode try to find media by code. Code can be find in URL to media, after p/. If URL to media is https://www.instagram.com/p/XXXXXXXXXX/, then code of the media is XXXXXXXXXX.
func GetMediaByUrl ¶
GetMediaByUrl try to find media by url. URL should be like https://www.instagram.com/p/XXXXXXXXXX/