models

package
v0.2.2-alpha.0...-91a53d1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AboutUserResponse

type AboutUserResponse struct {
	DefaultResponse
	User LoggedInUser `json:"user"`
}

type Candidate

type Candidate struct {
	URL    string
	Width  int
	Height int
}

type Caption

type Caption struct {
	Status       string `json:"status"`
	UserID       int    `json:"user_id"`
	CreatedAtUTC int64  `json:"created_at_utc"`
	CreatedAt    int64  `json:"created_at"`
	BitFlags     int    `json:"bit_flags"`
	User         User   `json:"user"`
	ContentType  string `json:"content_type"`
	Text         string `json:"text"`
	MediaID      int64  `json:"media_id"`
	Pk           int64  `json:"pk"`
	Type         int    `json:"type"`
}

type CommentsResponse

type CommentsResponse struct {
	DefaultResponse
	NextMaxId string          `json:"next_max_id"`
	Comments  json.RawMessage `json:"comments"`
}

type DefaultParams

type DefaultParams struct {
	ID        string
	RankToken string
	MaxID     string
}

type DefaultResponse

type DefaultResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

type FeedItem

type FeedItem struct {
	MediaOrAd      MediaOrAd      `json:"media_or_ad"`
	SuggestedUsers SuggestedUsers `json:"suggested_users"`
}

type HashtagFeedParams

type HashtagFeedParams struct {
	ID    string
	MaxID string
}

type ImageVersions2

type ImageVersions2 struct {
	Candidates []Candidate `json:"candidates"`
}

type Inbox

type Inbox struct {
	Threads   []*Thread `json:"threads"`
	Instagram *Instagram
}

Inbox type

func (*Inbox) ApproveAllThreads

func (inbox *Inbox) ApproveAllThreads() error

ApproveAllThreads will approve all pending message requests

func (*Inbox) GetFeed

func (inbox *Inbox) GetFeed() ([]*Thread, error)

GetFeed returns you inbox feed

type Instagram

type Instagram struct {
	Username     string
	Password     string
	Proxy        string
	Pk           int64
	AgentPool    *utils.SuperAgentPool
	Inbox        *Inbox
	TimelineFeed *TimelineFeed
	Cookies      []*http.Cookie
}

func (*Instagram) CreateSignature

func (ig *Instagram) CreateSignature() (sigVersion string, signedBody string)

func (*Instagram) GetComments

func (ig *Instagram) GetComments(mediaId, maxId string) ([]constants.UserCompetitor, string, error)

func (*Instagram) GetFeedOf

func (ig *Instagram) GetFeedOf(feedName, tag, maxId string) (json.RawMessage, string, error)

func (*Instagram) GetLikers

func (ig *Instagram) GetLikers(mediaId, maxId string) ([]constants.UserCompetitor, string, error)

func (*Instagram) GetLocationIdByName

func (ig *Instagram) GetLocationIdByName(location, maxId string) ([]constants.Location, string, error)

func (*Instagram) GetLocationSections

func (ig *Instagram) GetLocationSections(id, maxId, sectionTab string) ([]*constants.LocationSection, string, error)

func (*Instagram) GetPosts

func (ig *Instagram) GetPosts(userId, maxId string) ([]constants.MediaItem, string, error)

func (*Instagram) GetUserByName

func (ig *Instagram) GetUserByName(userName string) (LoggedInUser, error)

func (*Instagram) GetUserFollowers

func (ig *Instagram) GetUserFollowers(userId string, maxId string) ([]constants.UserCompetitor, string, error)

func (*Instagram) GetUserFollowing

func (ig *Instagram) GetUserFollowing(userId string, maxId string) ([]constants.UserCompetitor, string, error)

func (*Instagram) Like

func (ig *Instagram) Like(mediaID string) error

func (*Instagram) Login

func (ig *Instagram) Login() (err error)

func (*Instagram) SendRequest

func (ig *Instagram) SendRequest(agent *gorequest.SuperAgent) (*http.Response, string, []error)

func (*Instagram) Unlike

func (ig *Instagram) Unlike(mediaID string) error

type ItemsResponse

type ItemsResponse struct {
	DefaultResponse
	NextMaxId string          `json:"next_max_id"`
	Items     json.RawMessage `json:"items"`
}

type Location

type Location struct {
	ExternalSource   string     `json:"external_source"`
	City             string     `json:"city"`
	Name             string     `json:"name"`
	FacebookPlacesID int64      `json:"facebook_places_id"`
	Address          string     `json:"address"`
	Lat              float64    `json:"lat"`
	Lng              float64    `json:"lng"`
	Pk               int64      `json:"pk"`
	Instagram        *Instagram `json:"-"`
}

func (Location) GetRankedMedias

func (location Location) GetRankedMedias() ([]*Media, error)

func (Location) GetRecentMedias

func (location Location) GetRecentMedias() ([]*Media, error)

type LocationSectionRequest

type LocationSectionRequest struct {
	Tab  string `json:"tab"`
	UUID string `json:"_uuid"`
}

type LocationSectionResponse

type LocationSectionResponse struct {
	DefaultResponse
	NextMaxId string                       `json:"next_max_id"`
	Sections  []*constants.LocationSection `json:"sections"`
}

type LocationSectionTab

type LocationSectionTab string
const (
	LocationSectionTabRanked LocationSectionTab = "ranked"
	LocationSectionTabRecent LocationSectionTab = "recent"
)

type LoggedInUser

type LoggedInUser struct {
	Pk            int64 `json:"pk"`
	FollowerCount int   `json:"follower_count"`
}

type Media

type Media struct {
	Pk              int            `json:"pk"`
	ID              string         `json:"id"`
	DeviceTimestamp int            `json:"device_timestamp"`
	MediaType       int            `json:"media_type"`
	Code            string         `json:"code"`
	ImageVersions2  ImageVersions2 `json:"image_versions2"`
	Location        Location       `json:"location"`
	LikeCount       int            `json:"like_count"`
	HasLiked        bool           `json:"has_liked"`
}

type MediaOrAd

type MediaOrAd struct {
	Pk              int64           `json:"pk"`
	ID              string          `json:"id"`
	MediaType       int             `json:"media_type"`
	ImageVersions2  ImageVersions2  `json:"image_versions2"`
	Caption         Caption         `json:"caption"`
	CaptionIsEdited bool            `json:"caption_is_edited"`
	VideoVersions   []*VideoVersion `json:"video_versions"`
	VideoDuriation  float64         `json:"video_duration"`
	User            User            `json:"user"`
	HasMoreComments bool            `json:"has_more_comments"`
	HasLiked        bool            `json:"has_liked"`
	HasAudio        bool            `json:"has_audio"`
	NextMaxID       int64           `json:"next_max_id"`
	ViewCount       int             `json:"view_count"`
	CommentCount    int             `json:"comment_count"`
	LikeCount       int             `json:"like_count"`
}

type PostsResponse

type PostsResponse struct {
	DefaultResponse
	NextMaxId string          `json:"next_max_id"`
	Items     json.RawMessage `json:"items"`
}

type RankTokenGenerator

type RankTokenGenerator interface {
	GenerateRankToken(string) string
}

type SectionResponse

type SectionResponse struct {
	DefaultResponse
	NextMaxId string              `json:"next_max_id"`
	Sections  []constants.Section `json:"sections"`
}

type SuggestedUsers

type SuggestedUsers struct {
	Title            string `json:"title"`
	ViewAllText      string `json:"view_all_text"`
	LandingSiteTitle string `json:"landing_site_title"`
	LandingSiteType  string `json:"landing_site_type"`
	Type             int    `json:"type"`
	TrackingToken    string `json:"tracking_token"`
}

type Thread

type Thread struct {
	ID             string         `json:"thread_id"`
	Users          []*User        `json:"users"`
	Items          []*ThreadItem  `json:"items"`
	ImageVersions2 ImageVersions2 `json:"image_versions2"`
	HasNewer       bool           `json:"has_newer"`
	Instagram      *Instagram     `json:"-"`
}

func (*Thread) BroadcastText

func (thread *Thread) BroadcastText(text string) error

func (*Thread) Show

func (thread *Thread) Show() (*Thread, error)

type ThreadItem

type ThreadItem struct {
	ID        string `json:"item_id"`
	UserID    int    `json:"user_id"`
	ItemType  string `json:"item_type"`
	Timestamp int    `json:"timestamp"`

	// depends on ItemType
	Placeholder placeholderSchema `json:"placeholder"`
	Text        string            `json:"text"`
	MediaShare  Media             `json:"media_share"`
	Location    Location          `json:"location"`
}

type TimelineFeed

type TimelineFeed struct {
	Items         []*FeedItem `json:"feed_items"`
	MoreAvailable bool        `json:"-"`
	Cursor        string      `json:"-"`
	Instagram     *Instagram  `json:"-"`
	RankTokenGenerator
}

func (*TimelineFeed) Get

func (feed *TimelineFeed) Get() ([]*FeedItem, error)

func (*TimelineFeed) GetCursor

func (feed *TimelineFeed) GetCursor() string

func (*TimelineFeed) IsMoreAvailable

func (feed *TimelineFeed) IsMoreAvailable() bool

func (*TimelineFeed) SetCursor

func (feed *TimelineFeed) SetCursor(maxID string)

type User

type User struct {
	Username string `json:"username"`
	Pk       int    `json:"pk"`
}

type UsersResponse

type UsersResponse struct {
	DefaultResponse
	NextMaxId string          `json:"next_max_id"`
	Users     json.RawMessage `json:"users"`
}

type VideoVersion

type VideoVersion struct {
	URL    string `json:"url"`
	Width  int    `json:"width"`
	Type   int    `json:"type"`
	Height int    `json:"height"`
}

Jump to

Keyboard shortcuts

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