instagram

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package instagram provides interactions with Instagram social account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents instagram client.

func New

func New(ctx context.Context, p Params) (*Client, error)

New Client constructor.

func (*Client) Block

func (c *Client) Block(ctx context.Context, user models.User) error

Block user.

func (*Client) Follow

func (c *Client) Follow(ctx context.Context, user models.User) error

Follow user.

func (*Client) Followers

func (c *Client) Followers(ctx context.Context) ([]models.User, error)

Followers returns list of followers.

func (*Client) Followings

func (c *Client) Followings(ctx context.Context) ([]models.User, error)

Followings returns list of followings.

func (*Client) GetUserByName

func (c *Client) GetUserByName(_ context.Context, username string) (models.User, error)

GetUserByName finds user by username.

func (*Client) IsUseless

func (c *Client) IsUseless(ctx context.Context, user models.User, threshold int) (bool, error)

IsUseless reports where user is useless for statistics.

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) error

Logout clean session and send logout request.

func (*Client) Unblock

func (c *Client) Unblock(ctx context.Context, user models.User) error

Unblock user.

func (*Client) Unfollow

func (c *Client) Unfollow(ctx context.Context, user models.User) error

Unfollow user.

func (*Client) UploadMedia added in v1.12.0

func (c *Client) UploadMedia(ctx context.Context, file io.Reader, mt media.Type) error

UploadMedia uploads media to the profile.

func (*Client) UserFollowers

func (c *Client) UserFollowers(ctx context.Context, user models.User) ([]models.User, error)

UserFollowers returns user followers.

func (*Client) UserFollowings

func (c *Client) UserFollowings(ctx context.Context, user models.User) ([]models.User, error)

UserFollowings returns user followings.

func (*Client) Username

func (c *Client) Username(_ context.Context) string

Username returns current account username.

type Params added in v1.10.0

type Params struct {
	Sleep       time.Duration
	SessionPath string
	Username    string
}

Params holds Client constructor parameters.

Jump to

Keyboard shortcuts

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