models

package
v0.2.7-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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 ImageVersions2

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

type Inbox

type Inbox struct {
	Threads      []*Thread  `json:"threads"`
	HasOlder     bool       `json:"has_older"`
	OldestCursor string     `json:"oldest_cursor"`
	Instagram    *Instagram `json:"-"`
}

Inbox type

func (*Inbox) ApproveAllThreads

func (inbox *Inbox) ApproveAllThreads() error

ApproveAllThreads will approve all pending message requests

func (*Inbox) GetCursor

func (inbox *Inbox) GetCursor() string

func (*Inbox) GetFeed

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

GetFeed returns you inbox feed

func (*Inbox) IsMoreAvailalbe

func (inbox *Inbox) IsMoreAvailalbe() bool

func (*Inbox) SetCursor

func (inbox *Inbox) SetCursor(cursor string)

type Instagram

type Instagram struct {
	Config       *config.Config
	Session      session.Session
	AgentPool    *utils.SuperAgentPool
	Inbox        *Inbox
	TimelineFeed *TimelineFeed
	// contains filtered or unexported fields
}

func (*Instagram) CreateSignature

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

func (*Instagram) Like

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

func (*Instagram) Login

func (ig *Instagram) Login() error

func (*Instagram) SendRequest

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

func (*Instagram) Unlike

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

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 Media

type Media struct {
	Pk                   int            `json:"pk"`
	ID                   string         `json:"id"`
	MediaType            int            `json:"media_type"`
	FilterType           int            `json:"filter_type"`
	CarouselMedia        []*Media       `json:"carousel_media"`
	ImageVersions2       ImageVersions2 `json:"image_versions2"`
	Location             Location       `json:"location"`
	OriginalWidth        int            `json:"original_width"`
	OriginalHeight       int            `json:"original_height"`
	Lat                  float64        `json:"lat"`
	Lng                  float64        `json:"lng"`
	Code                 string         `json:"code"`
	LikeCount            int            `json:"like_count"`
	CommentCount         int            `json:"comment_count"`
	Caption              Caption        `json:"caption"`
	HasLiked             bool           `json:"has_liked"`
	HasMoreComments      bool           `json:"has_more_comments"`
	ClientCacheKey       string         `json:"client_cache_key"`
	OrganicTrackingToken string         `json:"organic_tracking_token"`
	DeviceTimestamp      int            `json:"device_timestamp"`
	TakenAt              int            `json:"taken_at"`
}

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 RankTokenGenerator

type RankTokenGenerator interface {
	GenerateRankToken(string) string
}

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"`
	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 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