inslib

package module
v0.0.0-...-08bd343 Latest Latest
Warning

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

Go to latest
Published: May 21, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

README

#inslib

instagram lib for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(node *Node, dir string, IsSplitDay bool, names ...string) (fullname string,
	b bool)

func FindStringSubmatch

func FindStringSubmatch(s, m string) string

func GetDataByName

func GetDataByName(name string) (map[string][]*Node, error)

func GetFilenameByUrl

func GetFilenameByUrl(urli string) string

func IsExist

func IsExist(path string) bool

func Mkdir

func Mkdir(src string) error

func SetHttpProxy

func SetHttpProxy(p string)

func SetHttpSetting

func SetHttpSetting(setting HttpSetting)

set default setting

func SetProxySetting

func SetProxySetting(setting ProxySetting)

func SetTcpProxy

func SetTcpProxy(p string)

Types

type Config

type Config struct {
	CsrfToken string `json:"csrf_token"`
}

type Count

type Count struct {
	Count int64 `json:"count"`
}

type Dimensions

type Dimensions struct {
	Height uint32 `json:"height"`
	Width  uint32 `json:"width"`
}

type EdgeSidecarToChildren

type EdgeSidecarToChildren struct {
	Edges []*Edges `json:"edges"`
}

type Edges

type Edges struct {
	Node *Node `json:"node"`
}

type ExtryData

type ExtryData struct {
	//profile page
	ProfilePage []*ProfilePage `json:"ProfilePage"`
	//post page
	PostPage []*PostPage `json:"PostPage"`
}

type Graphql

type Graphql struct {
	ShortcodeMedia *ShortcodeMedia `json:"shortcode_media"`
}

type HttpRequest

type HttpRequest struct {
	// contains filtered or unexported fields
}

func Get

func Get(url string, params ...url.Values) *HttpRequest

func NewRequest

func NewRequest(method, url string, body io.Reader) *HttpRequest

func Post

func Post(url string, params ...url.Values) *HttpRequest

func (*HttpRequest) Bytes

func (m *HttpRequest) Bytes() ([]byte, error)

func (*HttpRequest) DoRequest

func (m *HttpRequest) DoRequest() (*http.Response, error)

func (*HttpRequest) EnableCookie

func (m *HttpRequest) EnableCookie() *HttpRequest

func (*HttpRequest) GetRequest

func (m *HttpRequest) GetRequest() *http.Request

func (*HttpRequest) Header

func (m *HttpRequest) Header(key, value string) *HttpRequest

func (*HttpRequest) SetCsrftoken

func (m *HttpRequest) SetCsrftoken(csrftoken string) *HttpRequest

func (*HttpRequest) SetHttpProxy

func (m *HttpRequest) SetHttpProxy(p string) *HttpRequest

func (*HttpRequest) SetReferer

func (m *HttpRequest) SetReferer(referer string) *HttpRequest

func (*HttpRequest) SetTcpProxy

func (m *HttpRequest) SetTcpProxy(p string) *HttpRequest

func (*HttpRequest) String

func (m *HttpRequest) String() (string, error)

func (*HttpRequest) ToFile

func (m *HttpRequest) ToFile(filename string) error

func (*HttpRequest) ToJson

func (m *HttpRequest) ToJson(v interface{}) error

func (*HttpRequest) UserAget

func (m *HttpRequest) UserAget(user_agent string) *HttpRequest

type HttpSetting

type HttpSetting struct {
	UserAgent   string
	Referer     string
	Csrftoken   string
	ContentType string

	EnableCookie bool
	Transport    *http.Transport
	// contains filtered or unexported fields
}

type Media

type Media struct {
	Nodes    []*Node   `json:"nodes"`
	PageInfo *PageInfo `json:"page_info"`
}

type Node

type Node struct {
	TypeName     string      `json:"__typename"` //GraphSidecar GraphImage GraphVideo
	Id           string      `json:"id"`
	ShortCode    string      `json:"shortcode"`
	Code         string      `json:"code"`
	Date         int64       `json:"date"`
	ThumbnailSrc string      `json:"thumbnail_src"`
	DisplaySrc   string      `json:"display_src"`
	DisplayUrl   string      `json:"display_url"`
	VideoUrl     string      `json:"video_url"`
	IsVideo      bool        `json:"is_video"`
	Comments     *Count      `json:"comments"`
	Likes        *Count      `json:"likes"`
	Dimensions   *Dimensions `json:"dimensions"`
}

Node

func GetDataByCode

func GetDataByCode(code string) (nodes []*Node, err error)

func GetDataByUrl

func GetDataByUrl(urli string) (nodes []*Node, err error)

type PageInfo

type PageInfo struct {
	HasPreviousPage bool   `json:"has_previous_page"`
	StartCursor     string `json:"start_cursor"`
	EndCursor       string `json:"end_cursor"`
	HasNextPage     bool   `json:"has_next_page"`
}

type PostMedia

type PostMedia struct {
	EdgeSidecarToChildren *EdgeSidecarToChildren `json:"edge_sidecar_to_children"`
	*Node
}

type PostPage

type PostPage struct {
	Media   *PostMedia `json:"media"`
	Graphql *Graphql   `json:"graphql"`
}

type ProfilePage

type ProfilePage struct {
	User *User `json:"user"`
}

type ProxySetting

type ProxySetting struct {
	HttpProxy string //http proxy
	TcpProxy  string //tcp proxy
}

type QueryPage

type QueryPage struct {
	Status string   `json:"status"`
	Media  *Media   `json:"media"`
	Users  []*Users `json:"users"`
}

api query response struct

type ShortcodeMedia

type ShortcodeMedia struct {
	EdgeSidecarToChildren *EdgeSidecarToChildren `json:"edge_sidecar_to_children"`
	*Node
}

type User

type User struct {
	Id              string `json:"id"`
	Username        string `json:"username"`
	Fullname        string `json:"full_name"`
	ProfilePicUrl   string `json:"profile_pic_url"`
	ProfilePicId    string `json:"profile_pic_id"`
	ProfilePicUrlHd string `json:"profile_pic_url_hd"`
	FollowerCount   int64  `json:"follower_count"`
	FollowBy        *Count `json:"followed_by"`
	Follows         *Count `json:"follows"`
	Media           *Media `json:"media"`
}

type Users

type Users struct {
	User *User `json:"user"`
}

func GetUsers

func GetUsers(query string) ([]*Users, error)

type WebPage

type WebPage struct {
	ExtryData    *ExtryData `json:"entry_data"`
	Config       *Config    `json:"config"`
	Hostname     string     `json:"hostname"`
	CountryCode  string     `json:"country_code"`
	LanguageCode string     `json:"language_code"`
	Platform     string     `json:"platform"`
}

ins web request struct

func GetWebPage

func GetWebPage(urli string) (wp WebPage, err error)

Jump to

Keyboard shortcuts

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